项目作者: mneri

项目描述 :
Create PNG Images from LaTeX Formulas
高级语言: Shell
项目地址: git://github.com/mneri/pnglatex.git
创建时间: 2015-11-16T22:47:45Z
项目社区:https://github.com/mneri/pnglatex

开源协议:GNU General Public License v3.0

下载


pnglatex

pnglatex is a small script that turns
LaTeX
formulas into png images.

  1. $ pnglatex -f "E=mc^2"

E=mc^2

Installation

Download or clone the repository, then type

  1. # chmod +x pnglatex
  2. # cp pnglatex /usr/bin/pnglatex

Dependencies

pnglatex depends on dvipng, imagemagick, latex and optipng packages.

Tips

You can pipe into pnglatex:

  1. $ cat formula.tex | pnglatex

You can generate and open your image with a one-liner:

  1. $ pnglatex -f "E=mc^2" | xargs eog

Omitting -f option will start interactive mode.

  1. $ pnglatex
  2. E=mc^2
  3. <Ctrl-D>

Logs can give you a good idea of what went wrong.

  1. $ pnglatex -f "E=mc^2" -l out.log

Options

  • -b <color> Set the background color
  • -B <color> Set the border color
  • -d <dpi> Set the output resolution to the specified dpi
  • -e <environment> Set the environment for the formula (i.e. displaymath or eqnarray)
  • -f <formula> The
    LaTeX formula
  • -F <color> Set the foreground color
  • -h Print the help message
  • -H <file> Insert the content of the specified file in the preamble
  • -l <file> Log file
  • -m <margin> Set the margin
  • -o <file> Specify the output file name
  • -O Optimize the image
  • -p <packages> A colon separated list of
    LaTeX package names
  • -P <padding> Set the padding
  • -s <size> Set the font size
  • -S Don’t print image file name
  • -v Show version

Defaults

You can set default options by creating a properties file named .pnglatex in your home directory. The
following is an example content:

  1. BACKGROUND=White
  2. BORDER=
  3. DPI=180
  4. ENVIRONMENT=displaymath
  5. FOREGROUND=Black
  6. HEADER=
  7. MARGIN=
  8. OPTIMIZE=1
  9. PACKAGES=amsmath:amssymb
  10. PADDING=3
  11. SIZE=11

Command line provided options override the default options in the ~/.pnglatex
file.

cliptex Plugin

cliptex is a small script that creates
LaTeX
formulas using the system clipboard.

  1. $ cliptex

The above command uses the content of the system clipboard to generate a
LaTeX
formula. The clipboard is then replaced by the
generated image.

Tips

Bind the script to the Ctrl + Alt + C key
combination. Write your formula directly in the GMail editor, select it and
strike the key combination. Then, press Ctrl + V to
replace the formula with the generated image.

cliptex uses the default options set in the ~/.pnglatex file.

Installation

Download or clone the repository, then type

  1. # chmod +x cliptex
  2. # cp cliptex /usr/bin/cliptex

Dependencies

cliptex depends on pnglatex, wl-clipboard and xclip.

Options

  • -h Print this help message.
  • -s <session> Force a session (wayland or x11).
  • -S Don’t show system notifications.
  • -v Show version.