开发者 |
mdawaffe
sidney automattic |
---|---|
更新时间 | 2015年1月17日 05:17 |
PHP版本: | 3.2 及以上 |
WordPress版本: | 4.1 |
texlive-latex-base
package together with the tetex-math-extra
package. Both are available to most Linux
distributions.dvipng
(provided by the dvipng
package) or both dvips
and convert
(provided by
the dvips
and imagemagick
or graphicsmagick
packages, respectively) must installed as
well. dvipng
is preferred.latex/
in your wp-content/
directory and make it writable by
your webserver (chmod 777 will do the trick, but talk to your host to see what they recommend).This plugin uses the WordPress Shortcode Syntax.
Enter your LaTeX code inside of a [latex]...[/latex]
shortcode.
[latex]e^{\i \pi} + 1 = 0[/latex]
You may alternatively use the following equivalent syntax reminiscent of LaTeX's inline
math mode syntax.
$latex e^{\i \pi} + 1 = 0$
That is, if you would have written $some-code$
in a LaTeX document, just
write $latex some-code$
in your WordPress post.
For the curious, the shortcode syntax is slightly faster for WordPress to process, but the
inline syntax is a little easier for us humans to read. Pick your poison.
Yes. You can set the default text color and background color of the images in the
Plugins -> WP LaTeX admin page.
You can also change the colors on an image by image basis by specifying color
and background
attributes inside the LaTeX shortcode. For example:
[latex color="ff0000" background="00ff00"]e^{\i \pi} + 1 = 0[/latex]
will produce an image with a bright green background and a bright red foreground color.
Colors are specified in RGB with the standard 6 digit hex notation.
The equivalent "inline" syntax uses fg
and bg
parameters after the LaTeX code.
$latex e^{\i \pi} + 1 = 0&bg=00ff00&fg=ff0000$
You can specify a size
attribute in the LaTeX shortcode:
[latex size="4"]e^{\i \pi} + 1 = 0[/latex]
or, equivalently, an s
parameter after the LaTeX inline syntax:
$latex e^{\i \pi} + 1 = 0&s=4$
The size can be any integer from -4 to 4 (0 is the default). These numbers correspond to
the following LaTeX size commands.
size = LaTeX size -4 \tiny -3 \scriptsize -2 \footnotesize -1 \small 0 \normalsize (12pt) 1 \large 2 \Large 3 \LARGE 4 \huge
You can adjust the CSS used for the LaTeX images to suit your theme better. Go to Settings -> WP LaTeX and edit the Custom CSS.
You can't with this plugin. WP LaTeX forces you to stay in math mode. Formatting and styling for your posts should be done with markup and CSS, not LaTeX. If you really want hardcore LaTeX formatting (or any other cool LaTeX features), you should probably just use LaTeX.
Formula does not parse
: Your LaTeX is invalid; there must be a syntax error or
something in your code (WP LaTeX doesn't provide any debugging).Formula Invalid
: Your LaTeX code attempts to use LaTeX commands that this plugin
does not allow for security reasons.You must stay in inline math mode
: Fairly self explanitory, don't you think?
See above.The forumula is too long
: Break your LaTeX up into multiple images. WP LaTeX
limits you to 2000 characters per image.Could not open TEX file for writing
or Could not write to TEX file
: You have
some file permissions problems. See Intallation instructions.wp_safe_redirect()
for added security.<p>
and <br>
from shortcode contents to make multiline LaTeX easier.
Only works in shortcode syntax.tmpnam()
can return an error on some setups when called with a null parameter.
Use /tmp
instead (it should fall back to the system's temp directory). Props Marin Saric.