abenori / TeX2img

Converte TeX source to images.
Other
59 stars 5 forks source link

TeX2img

(C) Yusuke Terada and Noriyuki Abe http://www.ms.u-tokyo.ac.jp/~abenori/

(日本語のドキュメントは README-ja.md をご覧ください.)

What is TeX2img?

TeX2img generates an image in various file formats from a TeX source code. You can choose the following file formats:

TeX2img was originally developed by Yusuke Terada (until Version 1.2). Recently, Windows version (here) and macOS version has been developed independently.

Requirements

How to install

Download a zip file, like TeX2img_x.y.z.zip, from http://www.ms.u-tokyo.ac.jp/~abenori/soft/index.html#TEX2IMG

Just extract the zip file and double click "TeX2img.exe" in the extracted directory. At the first time, TeX2img will try to get paths of pdflatex.exe, etc. If the paths are not correct, please set them from [Tools(T)] -> [Options...(O)].

TeX2imgc.exe is a wrapper program to execute TeX2img in a command-line.

> TeX2imgc.exe [Options] Input Output [Input Output...]

All properties are inherited from those of TeX2img except preview after compiling (always false).

To generate SVG file, MuPDF is needed. Download the original version from MuPDF or modified (by me) version from http://www.ms.u-tokyo.ac.jp/~abenori/soft/index.html#MUTOOL and put mutool.exe at the same directory as that of TeX2img.exe

Tips

Options

The following are the options for TeX2img.exe or TeX2imgc.exe.

/latex=<VAL>             Set path for latex
/dvidriver=<VAL>         Set path for dvi driver
/gs=<VAL>                Set path for Ghostscript
/oldgs[-]                Ghostscript is before version 9.14
/kanji=<VAL>             Character code (utf8/sjis/jis/euc/no)
/guess-compile[-]        Guess compile
/num=<NUM>               (maximum) number of times for LaTeX
/resolution=<NUM>        Resolution level
/left-margin=<NUM>       Left margin
/top-margin=<NUM>        Top margin
/right-margin=<NUM>      Right margin
/bottom-margin=<NUM>     Bottom margin
/margins=<VAL>           Margins (all / leftright topbottom / left top right bottom)
/unit=<VAL>              Unit of margins ( bp/px )
/keep-page-size[-]       Keep the original page size
/merge-output-files[-]   Make a single file (PDF / TIFF /SVG(Z))
/animation-delay=<VAL>   Delay of animation (sec)
/animation-loop=<VAL>    Loop count of animation (0 =infinity)
/background-color=<VAL>  Background color (ex: FF0000, red, "255 0 0")
/transparent[-]          Transparent
/with-text[-]            Keep original text information (PDF / SVG(Z))
/delete-display-size[-]  Remove <width> and <height> (SVG(Z))
/antialias[-]            Anti-aliasing
/low-resolution[-]       Generate images with low resolution
/ignore-errors[-]        Force conversion by ignoring nonfatal errors
/delete-tmpfiles[-]      Delete temporary files after compiling
/preview[-]              Preview after compiling
/embed-source[-]         Embed the source in output image files
/copy-to-clipboard[-]    Copy generated files to the clipboard
/workingdir=<VAL>        Working folder (tmp/file/current)
/savesettings[-]         Save settings
/quiet[-]                Quiet mode
/timeout=<NUM>           Time out period (seconds)
/batch=<VAL>             Batch mode (stop/nonstop)
/exit                    Save settings and exit
/load-defaults           Load default settings
/help                    Show this message
/version                 Show version information
/language=<VAL>          Language (system/ja/en)

[-] means negation. For example, /guess-compile- means that TeX2img does not guess the compiling.

If you specify several options, TeX2img takes the last one. For example,

tex2imgc /transparent- /transparent a.tex a.png

will generate transparent png file. In particular, because /load-defaults makes all settings default ones, the options before /load-defaults are ignored. The option /load-defaults should be placed at the first.

Reference

Known bugs

Conversions to EMF file has some problems. See Issues in GitHub: https://github.com/abenori/TeX2img/issues/3.

Acknowledgments

License

For TeX2img itself, see license.txt. For the libraries:

For further details, see the website of each library.

History (after version 2.0)