06 de Abril de 2012

Conversão de $\mathrm\LaTeX$ com MathJax
Sobre MathJax, divulgo o artigo An invitation to use MathJax  em IMU-Net 52: March 2012 (A Bimonthly Email Newsletter from the International Mathematical Union Editor: Mireille Chaleyat-Maurel, University Paris Descartes, Paris, France):
An invitation to use MathJax (em IMU ON THE WEB)

" The use of mathematical equations in a web page has always been challenging. The first attempts used the standard (ASCII) characters to imitate mathematics so expressions like x^2+y^2=z^2 could be understood. As LaTeX came into vogue, it was used as an encoding of mathematics so that expressions like $\int_{-\infty}^\infty e^{-x^2} dx=\sqrt{\pi}$, while not directly viewable, could at least be interpreted by those sufficiently familiar with LaTeX syntax. The next stage of development involved the insertion of graphic files into the web page. Mathematics text in LaTeX format would be specially denoted, and each such snippet would be sent through LaTeX with the output being converted to a graphics format that could then be inserted into the page. This did allow recognizable mathematics, but it was not without drawbacks: the mathematics would not resize when the page was zoomed resulting in mismatched font sizes between text and mathematicals, and the graphics could not reshape themselves if the page dimensions changed. The arrival of MathJax completely changed this situation. The different approach is to have the computer supporting the browser use JavaScript to draw the mathematics on the page. This allows a very accurate presentation, with no jaggies (visible pixelation) associated with graphic insertions. It also allows greater access to the things that the browser does best: resizing and reflowing for example. Want to see if it works with your browser? If you're connected to the net, take the little snippet of HTML code following this paragraph and put it into a file on your computer. Then open the file with your browser. If all goes well, you will have a centred equation which will remain centred if you change the width of the display. Also, the mathematics will remain perfectly rendered and crisp as you zoom in.

<script type="text/javascript"
</script>
<body>
Here is a special equation:
$e^{i\pi}+1=0$
The five most important mathematical constants, all in one!
</body>
A picture is really worth a thousand words. The adventurous might want to replace the equation in the example with their own favourite, or take the LaTeX example from the first paragraph and see how (beautifully) it appears. There are (intentional) limitations to MathJax. It is designed to render pieces of mathematics rather than complete bodies of text. The browser itself is capable of rendering text quickly, so let it do what it is good at. Don't expect to take your favourite LaTeX paper and just drop it into MathJax. It won't work. Another limitation is the time it takes JavaScript to render the mathematics. A complicated page with lots of symbols can take many seconds to be completely viewable, especially on a slow computer, so, whenever possible, keep pages short and not too complicated. Even with these limitations, the range and beauty of LaTeX now displayed by MathJax is impressive. With the newest version, all of the constructions from the amsmath package, as well as all of the amssymbols are available. In addition, it is possible to use automatic line numbering and some referencing features, just as in LaTeX. "

Michael Doob

*
Agora alguns exemplos de utilização de MathJax  para visualização de equações matemáticas escritas em código LaTeX, em páginas HTML, retirados do artigo acima, Wikipedia e de MathJax/demo.
• Equação de Euler$e^{i\pi}+1=0$ com as cinco constantes matemáticas mais importantese, i, π, 0, 1.
• Série do seno \begin{align} \sin x & = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots \\ & = \sum_{n=0}^\infty \frac{(-1)^n x^{2n+1}}{(2n+1)!}, \\ \end{align}
• Fórmula de Euclides $a = m^2 - n^2, b = 2mn, c = m^2 + n^2,$ comm andn primos entre si de paridades opostas.
• Multiplicadores de Lagrange λ1, λ2, . . . , λe o espaço definido por b1, b2, . . . , bM $\sum\limits_{k=1}^M \lambda_k b_k = v$
• De  MathJax/demos $\left[-\frac{\hbar^2}{2 m}\frac{\partial^2}{\partial x^2}+V \right ]\Psi = i \hbar\frac{\partial}{\partial t}\Psi$
• Fracção contínua generalizada ${\genfrac{}{}{}{}{a_1}{b_1}} {\genfrac{}{}{0pt}{}{}{+}} {\genfrac{}{}{}{}{a_2}{b_2}} {\genfrac{}{}{0pt}{}{}{+}} {\genfrac{}{}{}{}{a_3}{b_3}} {\genfrac{}{}{0pt}{}{}{+\dots}} = K_{j=1}^\infty (a_j/b_j)$

30 de Abril de 2010

Azul

Azul

Laranja

Laranja

Verde

Verde

17 de Fevereiro de 2010

def pascoa(x): # script python que define a função pascoa(x)
#            em que x é o ano;
#
#            Baseado no algoritmo de O’Beirne, em 10 passos,
#            para determinar a data do Domingo de Páscoa de um dado ano.
#
#            (calcula o dia e o mês)
#
b = x / 100
c = x - 100 * b
quociente = (5 * b + c) / 19
a = 5 * b + c - 19 * quociente
d = (3 * (b + 25)) / 4
e = 3 * (b + 25) - 4 * d
g = (8 * (b + 11)) / 25
quociente = (19 * a + d - g) / 30
h = 19 * a + d - g - 30 * quociente
m = (a + 11 * h) / 319
j = (60 * (5 - e) + c) / 4
k = 60 * (5 - e) + c - 4 * j
quociente = (2 * j - k - h + m) / 7
l = 2 * j - k - h + m - 7 * quociente
n = (h - m + l + 110) / 30       # n é o mês (valor numérico)
q = h - m + l + 110 - 30 * n
quociente = (q + 5 - n) / 32
p = q + 5 - n                    # p é o dia
if n == 3:
N = 'Março'                     # N é o nome do mês
else:
N = 'Abril'
if quociente != 0:
print 'erro'
else:
print 'Em', x, 'o Domingo de Páscoa é no dia', p, 'de', N

def easter(x): # python script that defines the easter(x) function
#            where x is the year;
#            (created in the IDLE environment).
#
#            Based on the 10 step O’Beirne's algorithm
#            to compute the date of Easter Sunday of a given year.
#
#            (computes the day and the month)
#
b = x / 100
c = x - 100 * b
quotient = (5 * b + c) / 19
a = 5 * b + c - 19 * quotient
d = (3 * (b + 25)) / 4
e = 3 * (b + 25) - 4 * d
g = (8 * (b + 11)) / 25
quotient = (19 * a + d - g) / 30
h = 19 * a + d - g - 30 * quotient
m = (a + 11 * h) / 319
j = (60 * (5 - e) + c) / 4
k = 60 * (5 - e) + c - 4 * j
quotient = (2 * j - k - h + m) / 7
l = 2 * j - k - h + m - 7 * quotient
n = (h - m + l + 110) / 30       # n is the month (numerical value)
q = h - m + l + 110 - 30 * n
quotient = (q + 5 - n) / 32
p = q + 5 - n                    # p is the day
if n == 3:
N = 'March'                     # N is the month name
else:
N = 'April'
if quotient != 0:
print 'error'
else:
print 'In', x, 'the Easter Sunday is on', N, p

08 de Agosto de 2009

 A A2 2 4 3 9

 n n2 n 3 1 1 1 2 4 8 3 9 27 4 16 64

 n n 1 1 2 2

01 de Fevereiro de 2009

Este é um exemplo de texto marcado.

mais sobre mim
pesquisar

Abril 2012
Dom
Seg
Ter
Qua
Qui
Sex
Sab

1
2
3
4
5
7

8
9
10
11
12
13
14

15
16
17
18
19
20
21

22
23
24
25
26
27
28

29
30

arquivos
2012:

1 2 3 4 5 6 7 8 9 10 11 12

2011:

1 2 3 4 5 6 7 8 9 10 11 12

2010:

1 2 3 4 5 6 7 8 9 10 11 12

2009:

1 2 3 4 5 6 7 8 9 10 11 12

favorito
subscrever feeds