Escribir LaTeX En Drupal

Insertamos una imagen y en la URL escribimos:

http://www.codecogs.com/gif.latex?x^2

Obtenemos:  

 

Si escribimos:

http://www.codecogs.com/gif.latex?\displaystyle \int_\Omega f(x)dx

Obtenemos:

Segundo Método

Usando Mathjax.

Para ello, según dice la documentación, tenemos que modificar el fichero:

themes/[current_theme]/page.tpl.php

En Drupal 7 he tenido que hacerlo en:

modules/system/html.tpl.php

Debemos añadir las siguientes líneas de código justo antes de la etiqueta </head>

http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

Si además quiero que use HTML-CSS por defecto para que quede con mejor presentación

type="text/x-mathjax-config">
  MathJax.Hub.Config({
    MMLorHTML: { prefer: { Firefox: "HTML" } }
  });

type="text/javascript"
  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">



Una vez hecho esto, si escribo:

Esto es una integral \(  \int_\Omega f(x)dx \) y esto \(  \displaystyle\int_\Omega f(x)dx \)

\[ \int \ln(x) \;dx = \int 1 \cdot \ln(x) \;dx \ = x \cdot \ln(x) - \int x \cdot \frac{1}{x} \;dx \ = x \cdot \ln(x) - x \]

$$f(x)=\dfrac{x+1}{x-1}$$


Obtengo:

Esto es una integral <span id="MathJax-Element-1-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="∫Ωf(x)dx»>Ωf(x)dx∫Ωf(x)dx y esto <span id="MathJax-Element-2-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="∫Ωf(x)dx»>Ωf(x)dx∫Ωf(x)dx

<span id="MathJax-Element-3-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="∫ln⁡(x)dx=∫1⋅ln⁡(x)dx =x⋅ln⁡(x)−∫x⋅1xdx =x⋅ln⁡(x)−x»>ln(x)dx=1ln(x)dx =xln(x)x1xdx =xln(x)x∫ln⁡(x)dx=∫1⋅ln⁡(x)dx =x⋅ln⁡(x)−∫x⋅1xdx =x⋅ln⁡(x)−x
<span id="MathJax-Element-4-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="f(x)=x+1x−1″>f(x)=x+1x1f(x)=x+1x−1
$$ \begin{align*}
2x^2 + 3(x-1)(x-2) & = 2x^2 + 3(x^2-3x+2)\\
&= 2x^2 + 3x^2 - 9x + 6\\
&= 5x^2 - 9x + 6
\end{align*} $$
<span id="MathJax-Element-5-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="2×2+3(x−1)(x−2)=2×2+3(x2−3x+2)=2×2+3×2−9x+6=5×2−9x+6″>2x2+3(x1)(x2)=2x2+3(x23x+2)=2x2+3x29x+6=5x29x+62×2+3(x−1)(x−2)=2×2+3(x2−3x+2)=2×2+3×2−9x+6=5×2−9x+6
$$
 \frac{1}{\displaystyle 1+
   \frac{1}{\displaystyle 2+
   \frac{1}{\displaystyle 3+x}}} +
 \frac{1}{1+\frac{1}{2+\frac{1}{3+x}}}
$$
<span id="MathJax-Element-6-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="11+12+13+x+11+12+13+x»>11+12+13+x+11+12+13+x11+12+13+x+11+12+13+x

 

$$
F(x,y)=0 ~~\mbox{and}~~
\left| \begin{array}{ccc}
  F''_{xx} & F''_{xy} &  F'_x \\
  F''_{yx} & F''_{yy} &  F'_y \\
  F'_x     & F'_y     & 0
  \end{array}\right| = 0
$$
<span id="MathJax-Element-7-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="F(x,y)=0  and  |Fxx″Fxy″Fx′Fyx″Fyy″Fy′Fx′Fy′0|=0″>F(x,y)=0  and  ∣∣∣∣∣F′′xxF′′yxFxF′′xyF′′yyFyFxFy0∣∣∣∣∣=0F(x,y)=0  and  |Fxx″Fxy″Fx′Fyx″Fyy″Fy′Fx′Fy′0|=0

 

$$
|x| = \left\{ \begin{array}{rl}
 -x &\mbox{ if $x<0$} \\
  x &\mbox{ otherwise}
       \end{array} \right.
$$
<span id="MathJax-Element-8-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="|x|={−x if x&lt;0x otherwise»>|x|={xx if x<0 otherwise|x|={−x if x<0x otherwise

 

Tercer Método

Con DruTeX  

Es un módulo disponible para la versión 6 de Drupal. Necesita que el servidor tenga instalado <span id="MathJax-Element-9-Frame" class="MathJax" style="margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align: baseline; background: transparent; display: inline; font-style: normal; font-weight: normal; line-height: normal; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;" tabindex="0" role="presentation" data-mathml="LATEX»>LATEXLATEX.

También te podría gustar...

Descripción general de privacidad

Este sitio web utiliza cookies para que podamos brindarle la mejor experiencia de usuario posible. La información de las cookies se almacena en su navegador y realiza funciones como reconocerlo cuando regresa a nuestro sitio web y ayudar a nuestro equipo a comprender qué secciones del sitio web le resultan más interesantes y útiles.