ltximg(1)

πŸŽ€ NAME πŸŽ€

okay so bestie, this is ltximg β€” it's from the General Commands Manual (that's section 1, the commands section, iykyk) and it does exactly one iconic thing: it turns LaTeX environments into image files and standalone files. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

ltximg [<options>] [--] <filename>.<tex|ltx>

πŸ¦‹ DESCRIPTION πŸ¦‹

so ltximg automates the process of extracting and converting environments from a LaTeX file into image formats and standalone files, and it does that using ghostscript and poppler-utils. no cap.

it generates one file with only the extracted environments, and another file with all the extracted environments converted to \includegraphics. two files, two moods, both slay.

and by default, the extracted environments are, in this exact order:

  • preview
  • pspicture
  • tikzpicture
  • pgfpicture
  • psgraph
  • postscript
  • PSTexample

periodt. that's the starter pack. 🌸


πŸ’– OPTIONS πŸ’–

first, the ground rules, because the way that these options work is very specific and we respect it:

  • options that accept a value need either a blank space or = between the option and the value. pick your fighter.
  • multiple short options can be bundled together β€” and if the last option in that bundle takes a comma separated list, you need -- at the end. yes really.
  • relative or absolute paths for directories and files is not supported. like, at all. don't try it, bestie. 😭
and if you run it with no [<options>] at all? the extracted environments get converted to pdf image format and saved in the ./images directory, using pdflatex and the preview package for the process. easy default, no thoughts needed. 🫢

⭐ General script options ⭐

  • -h, --help β€” show the command line help and dip out. exit stage left. πŸšͺ
  • -v, --version β€” show the current version and dip out.
  • -V, --verbose β€” verbose printing information. it will tell you things. lots of things. πŸ’¬
  • -l, --log β€” write a .log file with debug information.
  • -t, --tif β€” create .tif files using ghostscript.
  • -b, --bmp β€” create .bmp files using ghostscript.
  • -j, --jpg β€” create .jpg files using ghostscript.
  • -p, --png β€” create .png files using ghostscript.
  • -e, --eps β€” create .eps files using pdftops.
  • -s, --svg β€” create .svg files using pdftocairo.
  • -P, --ppm β€” create .ppm files using pdftoppm.
  • -g, --gray β€” gray scale for images, using ghostscript.
  • -f, --force β€” capture \psset and \tikzset to extract. forceful. πŸ’ͺ
  • -n, --noprew β€” create images files without the preview package.
  • -r integer, --runs=integer β€” set the number of times the compiler will run on the input file for environment extraction. default: 1.
  • -d integer, --dpi=integer β€” dots per inch resolution for images. default: 150.
  • -m integer, --margins=integer β€” set margins in bp for pdfcrop. default: 0.
  • -o filename, --output=filename β€” create output file.
  • --imgdir=dirname β€” set the name of the directory to save images and files in. default: images.
  • --prefix=string β€” set the prefix appended to each generated file. default: fig.
  • --myverb=macroname β€” add \macroname to the verbatim inline search. default: myverb.
  • --clean=doc|pst|tkz|all|off β€” removes specific block text in the output file. default: doc.
  • --zip β€” compress the generated files in .zip format.
  • --tar β€” compress the generated files in .tar.gz format.
  • --srcenv β€” create files with only the code of environments.
  • --subenv β€” create standalone files for environments. main character energy fr fr. πŸ‘‘
  • --shell β€” enable \write18{SHELL COMMAND}.
okay real talk about that last one: --shell turns on \write18{SHELL COMMAND}, which means shell commands can actually run. be normal about it. πŸ™ˆ
  • --latex β€” using latex>dvips>ps2pdf for compiler input and pdflatex for compiler output.
  • --dvips β€” using latex>dvips>ps2pdf for compiler input and latex>dvips>ps2pdf for compiler output.
  • --dvilua β€” using dvilualatex>dvips>ps2pdf for compiler input and lualatex for compiler output.
  • --dvipdf β€” using latex>dvipdfmx for compiler input and latex>dvipdfmx for compiler output.
  • --xetex β€” using xelatex for compiler input and output.
  • --luatex β€” using lualatex for compiler input and output.
  • --arara β€” use arara for compiler input and output.
  • --latexmk β€” using latexmk for compiler output file.
  • --norun β€” run the script, but don't create images files.
  • --nopdf β€” don't create a .pdf image files.
  • --nocrop β€” don't run pdfcrop.
  • --extrenv=env1,env2,... β€” add new environments to extract.
  • --skipenv=env1,env2,... β€” skip some of the default environments to extract.
  • --verbenv=env1,env2,... β€” add new verbatim environments.
  • --writenv=env1,env2,... β€” add new verbatim write environments.
  • --deltenv=env1,env2,... β€” delete environments in the output file.

🌈 EXAMPLE 🌈

ltximg --latex -e -p --subenv -o test-out.ltx test-in.ltx

and here's what that actually gives you, step by step: it creates a ./images directory (if it doesn't exist β€” it won't yell at you, it'll just make it πŸ’–) with all the extracted environments converted to .pdf, .eps, .png and standalone files, plus a file test-in-fig-all.ltx with all extracted environments, and the file test-out.ltx with all environments converted to \includegraphics.

all of that using latex>dvips>ps2pdf and the preview package for test-in.ltx, and pdflatex for test-out.ltx. ate. πŸ’…


🧚 DOCUMENTATION 🧚

for the full documentation, use:

texdoc ltximg

go read it, bestie, it's giving thorough. πŸ“š


πŸ”₯ ISSUES AND REPORTS πŸ”₯

found a bug? tell the repo. they wanna know. 🫢


πŸ’œ AUTHOR πŸ’œ

Pablo GonzΓ‘lez Luengo, pablgonz@yahoo.com.


Copyright 2013-2021 Pablo GonzΓ‘lez, pablgonz@yahoo.com.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

no warranty bestie. none. zero. the lawyers said so. 😭

🌸 SEE ALSO 🌸


and that's the whole page!! this was version 2.1, dated 2021-05-21, living in the General Commands Manual β€” so like, if you ever forget any of this, the manual remembers for you. byeee, go extract some environments πŸ’–βœ¨πŸŽ€πŸ¦‹