From 7118801c6c53b01dfad47da9c5498b08338c336e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 2 May 2018 18:32:35 +0000 Subject: ltximg (12apr18) git-svn-id: svn://tug.org/texlive/trunk@47568 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/support/ltximg/CHANGES | 7 - Master/texmf-dist/doc/support/ltximg/CHANGUES.md | 25 ++ Master/texmf-dist/doc/support/ltximg/README | 51 ---- Master/texmf-dist/doc/support/ltximg/README.md | 112 +++++++ .../texmf-dist/doc/support/ltximg/ltximg-doc.pdf | Bin 346033 -> 190044 bytes .../texmf-dist/doc/support/ltximg/ltximg-doc.tex | 337 --------------------- 6 files changed, 137 insertions(+), 395 deletions(-) delete mode 100644 Master/texmf-dist/doc/support/ltximg/CHANGES create mode 100644 Master/texmf-dist/doc/support/ltximg/CHANGUES.md delete mode 100644 Master/texmf-dist/doc/support/ltximg/README create mode 100644 Master/texmf-dist/doc/support/ltximg/README.md delete mode 100644 Master/texmf-dist/doc/support/ltximg/ltximg-doc.tex (limited to 'Master/texmf-dist/doc/support/ltximg') diff --git a/Master/texmf-dist/doc/support/ltximg/CHANGES b/Master/texmf-dist/doc/support/ltximg/CHANGES deleted file mode 100644 index ea7d3e82c8f..00000000000 --- a/Master/texmf-dist/doc/support/ltximg/CHANGES +++ /dev/null @@ -1,7 +0,0 @@ -#------------------------------ CHANGES -------------------------------# -v1.1 2015-04-21 - Change mogrify to gs for image formats - - Create output file - - Rewrite source code and fix regex - - Add more image format - - Change date to iso format -v1.0 2013-12-01 - First public release diff --git a/Master/texmf-dist/doc/support/ltximg/CHANGUES.md b/Master/texmf-dist/doc/support/ltximg/CHANGUES.md new file mode 100644 index 00000000000..c7ff7ea2fdd --- /dev/null +++ b/Master/texmf-dist/doc/support/ltximg/CHANGUES.md @@ -0,0 +1,25 @@ +## Changues +``` + v1.5. (d) 2018-04-12 - Use GitHub to control version + - Rewrite and optimize most part of code and options + - Changue pdf2svg for pdftocairo + - Complete support for pst-exa packpage + - Clean take and optional + v1.4. (d) 2016-11-29 - Remove and rewrite code for regex and system call + - Append arara compiler, clean and comment code + - Append dvips and dvipdfm for creation images + - Append bmp, tif image format + v1.3. (d) 2016-10-16 - All options its read from cmd line and input file + - Rewrite some part of code (norun, nocrop, clean) + - Suport minted and tcolorbox packpage for verbatim + - Use /tmp dir for work process + - Escape some characters in regex according to v5.2xx + v1.2 (p) 2015-04-22 - Remove unused modules + v1.1 (p) 2015-04-21 - Change mogrify to gs for image formats + - Create output file + - Rewrite source code and fix regex + - Add more image format + - Change date to iso format + v1.0 (p) 2013-12-01 - First public release +``` +Copyright 2013 - 2018 by Pablo González L . diff --git a/Master/texmf-dist/doc/support/ltximg/README b/Master/texmf-dist/doc/support/ltximg/README deleted file mode 100644 index 4a783f5a3bc..00000000000 --- a/Master/texmf-dist/doc/support/ltximg/README +++ /dev/null @@ -1,51 +0,0 @@ -ltximg is a Perl script which isolates all Tikz or -PSTricks related parts of the TeX document into single -pdf file, split and convert in eps/pdf/png/jpg/svg format. - -The advantage of "ltximg" is the ability to discuss the -environments that give problems using the "preview" package -as "verbatim" inline (verb|...|) or beginning with %, and -other environments (LTXexample, Verbatim,etc). - -The images files are saved in a subdirectory images. - -Syntax: perl ltximg.pl file.tex [options] - -ltximg create a copy for TeX source whit all PGF|TiKZ|Pstricks environments - and convert all environments into single images (pdf/png/eps/jpg). - By default search and extract environments using (pdf)LaTeX - and ghostscript (gs). - -Environments suports by LTXimg: - - pspicture tikzpicture pgfpicture forest ganttchart - tikzcd circuitikz dependency other postscript - -Options: - - -h,--help - display this help and exit - -l,--license - display license information and exit - -v,--version - display version (current 1.2) and exit - -d,--dpi= - the dots per inch for images (default 150) - -j,--jpg - create .jpg files (need Ghostscript) - -p,--png - create .png files (need Ghostscript) - -e,--eps - create .eps files (need pdftops) - -s,--svg - create .svg files (need pdf2svg) - -P,--ppm - create .ppm files (need pdftoppm) - -a,--all - create .(pdf,eps,jpg,png) images - -c,--clear - delete all temp and aux files - -o,--output - create a file-out.tex whitout PGF|TiKZ|PST code - -m,--margins= - margins in bp for pdfcrop (default 0) - -np,--nopreview - create images files whitout preview package - -ns,--nosource - delete all source for images files - --miktex - use --enable-write18 for MikTeX users - --xetex - using (Xe)LaTeX for create images - --latex - using LaTeX for create images - --luatex - using (Lua)LaTeX for create images - --nopdf - don't create a PDF image files (default off) - --other= - search other environment (default other) - --ignore= - skip verbatim environment (default ignore) - --imgdir= - the folder for images (default images) - - -Pablo González Luengo, 2015-04-21 diff --git a/Master/texmf-dist/doc/support/ltximg/README.md b/Master/texmf-dist/doc/support/ltximg/README.md new file mode 100644 index 00000000000..2f56e3b6409 --- /dev/null +++ b/Master/texmf-dist/doc/support/ltximg/README.md @@ -0,0 +1,112 @@ +## LTXimg – LaTeX environments to image format + +## Description + +**ltximg** is a perl *script* that automates the process of extracting and converting +environments provided by **tikz**, **pstricks** and other packages from input file +to image formats in individual files using `ghostscript` and `poppler-utils`. Generates a file +with only extracted environments and other with environments converted to `\includegraphics`. + +## Syntax +``` +$ ltximg [] [] [--] . +``` +## Usage +``` +$ ltximg --latex [] +$ ltximg --arara [] +$ ltximg [] +$ ltximg +``` +If used without `[]` and `[]` the extracted environments are converted to `pdf` image format +and saved in the `/images` directory using `pdflatex` and `preview` package. Relative or absolute `paths` for files +and directories is not supported and if the last `[]` take a list separated by commas you need `--` at the end. + +## Default environments extract +``` + pspicture tikzpicture pgfpicture psgraph postscript PSTexample +``` +## Options + +``` + [default] +-h, --help Display command line help and exit [off] +-l, --license Display GPL license and exit [off] +-v, --version Display current version (v1.5) and exit [off] +-t, --tif Create .tif files using ghostscript [gs] +-b, --bmp Create .bmp files using ghostscript [gs] +-j, --jpg Create .jpg files using ghostscript [gs] +-p, --png Create .png files using ghostscript [gs] +-e, --eps Create .eps files using poppler-utils [pdftops] +-s, --svg Create .svg files using poppler-utils [pdftocairo] +-P, --ppm Create .ppm files using poppler-utils [pdftoppm] +-g, --gray Gray scale for images using ghostscript [off] +-f, --force Capture "\psset" and "\tikzset" to extract [off] +-n, --noprew Create images files whitout "preview" package [off] +-d , --dpi + Dots per inch resolution for images [150] +-m , --margin + Set margins for pdfcrop [0] +--imgdir Set name of directory to save images [images] +-o , --output + Create output file [off] +--verbose Verbose printing [off] +--srcenv Create files whit only code environment [off] +--subenv Create files whit preamble and code [off] +--latex Using latex>dvips>ps2pdf for compiler input + and pdflatex for compiler output [off] +--dvips Using latex>dvips>ps2pdf for compiler input + and latex>dvips>ps2pdf for compiler output [off] +--arara Use arara for compiler input and output [off] +--xetex Using xelatex for compiler input and output [off] +--dvipdf Using dvipdfmx for compiler input and output [off] +--luatex Using lualatex for compiler input and output [off] +--prefix Set prefix append to each image file [off] +--norun Run script, but no create images files [off] +--nopdf Don't create a ".pdf" image files [off] +--nocrop Don't run pdfcrop [off] +--verbcmd Set "\cmdname" verbatim command [myverb] +--clean (doc|pst|tkz|all|off) + Removes specific text in output file [doc] +--extrenv Add new environments to extract [empty] +--skipenv Skip environments to extract [empty] +--verbenv Add verbatim environments [empty] +--writenv Add verbatim write environments [empty] +--deltenv Delete environments in output file [empty] +``` +## Example +``` +$ ltximg --latex -e -p --srcenv --imgdir=mypics -o test-out test-in.ltx +``` +``` +$ ltximg --latex -ep --srcenv --imgdir mypics -o test-out test-in.ltx +``` + Create a `/mypics` directory whit all extracted environments converted to + image formats(`.pdf`, `.eps`, `.png`), individual files whit source code (`.tex`) + for all extracted environments, a file `test-out.ltx` whit all environments converted to `\includegraphics` + and file `test-in-fig-all.tex` with only the extracted environments using + `latex>dvips>ps2pdf` and `preview` package for `` and `pdflatex` + for ``. + +## Documentation + For full documentation use: +``` +$ texdoc ltximg +``` + +## Licence +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. + +## Author + +Written by Pablo González L , last update 2018-04-12. + +## Copyright + +Copyright 2013 - 2018 by Pablo González L diff --git a/Master/texmf-dist/doc/support/ltximg/ltximg-doc.pdf b/Master/texmf-dist/doc/support/ltximg/ltximg-doc.pdf index 90856ffefd2..86b856a5ed9 100644 Binary files a/Master/texmf-dist/doc/support/ltximg/ltximg-doc.pdf and b/Master/texmf-dist/doc/support/ltximg/ltximg-doc.pdf differ diff --git a/Master/texmf-dist/doc/support/ltximg/ltximg-doc.tex b/Master/texmf-dist/doc/support/ltximg/ltximg-doc.tex deleted file mode 100644 index cfe90a9d057..00000000000 --- a/Master/texmf-dist/doc/support/ltximg/ltximg-doc.tex +++ /dev/null @@ -1,337 +0,0 @@ -\documentclass[10pt]{article} -\usepackage[T1]{fontenc}% -\usepackage{hologo}% -\usepackage{fetamont}% -\usepackage{libertine}% -\usepackage{booktabs}% -\usepackage{tabularx}% -\usepackage{tcolorbox}% -\tcbuselibrary{documentation}% -\usepackage[margin=1.0in,letterpaper]{geometry}% -\usepackage[scaled=0.9]{inconsolata}% -\usepackage{listings}% -% colors -\definecolor{lightgrey}{rgb}{0.9,0.9,0.9} -\definecolor{darkgreen}{rgb}{0,0.6,0} -\definecolor{darkred}{rgb}{0.6,0,0} -\definecolor{myblue}{RGB}{20,105,176} -\definecolor{darkgreen}{rgb}{0,0.6,0} -% languaje -\lstdefinelanguage{mytex}[LaTeX]{TeX}{ -columns=flexible, -frame=single, -framerule=0pt,% -backgroundcolor=\color{gray!10},% -xleftmargin=\fboxsep,% -xrightmargin=\fboxsep, -alsoletter={\\,*,\&}, -morekeywords={\\AtBeginDocument, - \\RequirePackage, - \\PreviewEnvironment, - \&}, -morekeywords=[2]{pspicture, - verbatim, - table, - other, - tikzpicture, - postscript, - preview, - TRICKS, - POSTRICKS, - TIKZPICTURE, - OTHER, - nopreview}, -morekeywords=[3]{\\begin, - \\pspicture, - \\TRICKS, - \\ENDTRICKS, - \\endpspicture, - \\end}, -literate=*{\{}{{\textcolor{myblue}{\{}}}{1} - {\}}{{\textcolor{myblue}{\}}}}{1} - {[}{{\textcolor{myblue}{[}}}{1} - {]}{{\textcolor{myblue}{]}}}{1}, - } -\lstset{language=mytex} - -\lstdefinestyle{mystyle1}{ - basicstyle=\small\ttfamily, - keywordstyle=\bfseries\color{red}, - keywordstyle=[2]{\color{magenta}}, - keywordstyle=[3]{\color{blue}}, - commentstyle=\color{darkgreen}, - stringstyle=\color{orange}, - identifierstyle=\ttfamily, - showstringspaces=true, - breaklines=true, - tabsize=4, - columns=fullflexible, - keepspaces=true, - } -% style -\lstset{style=mystyle1} -\begin{document} -\title{{\Huge\textffm{LTX}\textffmw{img} \normalsize \Large\textffmw{v1.1}}\\\small\textffm{tikz|pgf|pstricks \\to image format}} -\author{Pablo Gonz\'{a}lez Luengo\\ \small \ttfamily pablgonz at yahoo dot com} -\date{\today} -\maketitle -\begin{abstract} -\noindent - -\textsf{ltximg} is a \textsf{Perl} script that automates the process to extract and convert all PGF|TiKZ|Pstricks environments from input file to image formats (pdf,png,jpg,eps,ppm,svg) and source code for environments in individual files using \textsf{Ghostscript} and other software. By default search and extract environments using \hologo{pdfLaTeX}. -\end{abstract} -\tableofcontents -\section{Required Software} - -For the full operation of the \textsf{ltximg} script you need the following opensource programs -(available for windows and linux). - -\begin{itemize} -\item \textsf{Perl} (version 5.18 or higer). - -\item \textsf{Ghostscript} (version 9.16). - -\item \textsf{pdftops} (optional, for images in \textsf{EPS} format). - -\item \textsf{pdftoppm} (optional, for images in \textsf{PPM} format). - -\item \textsf{pdf2svg} (optional, for images in \textsf{SVG} format). -\end{itemize} -\newpage -\section{Run and options} -the syntax for \textsf{ltximg} script is simple: -\noindent -For \TeX Live users: -\begin{lstlisting} -ltximg file.tex --options -\end{lstlisting} -For Mik\TeX\ users: -\begin{lstlisting} -perl ltximg file.tex --miktex --options -\end{lstlisting} - -\begin{table}[htp] -\caption{Options for \textsf{ltximg}} -\begin{tabularx}{\linewidth}{@{}>{\ttfamily} l>{\ttfamily} l >{\ttfamily}l X @{}}\\\toprule -\emph{short} & \emph{long} & \emph{default} & \emph{description}\\\midrule - -h &--help & & Display help from command line and exit.\\ - -l &--license & & Display license information and exit.\\ - -v &--version & 1.1 & Display version of script and exit.\\ - -d &--dpi= & 150 & The dots per inch for images.\\ - -j &--jpg & & Create \textsf{.jpg} files (need \textsf{Ghostscript}).\\ - -p &--png & & Create \textsf{.png}files (need \textsf{Ghostscript}).\\ - -e &--eps & & Create \textsf{.eps} files (need \textsf{pdftops}).\\ - -s &--svg & & Create \textsf{.svg} files (need \textsf{pdf2svg}).\\ - -P &--ppm & & Create \textsf{.ppm} files (need \textsf{pdftoppm}).\\ - -a &--all & & Create \textsf{.(pdf,eps,jpg,png)} images.\\ - -c &--clear & & Delete all temp and aux files.\\ - -o &--output & & Create a \textsf{file-out.tex} whitout \textsf{PGF|TiKZ|PST} code.\\ - -m &--margins=& 0 & Margins in bp for \textsf{pdfcrop}.\\ - -np &--nopreview & off & Create images files whitout \textsf{preview} package.\\ - -ns &--nosource & off & Delete all source for images files\\ - &--miktex &-shell-escape & Use \textsf{--enable-write18} for \hologo{MiKTeX} users.\\ - &--xetex & off & Using \hologo{XeLaTeX} for create images.\\ - &--latex & off & Using \hologo{LaTeX} for create images.\\ - &--luatex & off & Using \hologo{LuaLaTeX} for create images.\\ - &--nopdf & off & Don't create a PDF image files.\\ - &--other= & other & Search \textsf{other} environment for export.\\ - &--ignore= & ignore& Skip verbatim environment.\\ - &--imgdir= & images & The folder for images.\\ - \bottomrule -\end{tabularx} -\end{table} - - - -\section{How it works} - -The script works in two steps for create image, source code and output file \emph{without PGF/TIKZ/PST} environments. - - -\subsection{Environment Suports} - -\textsf{ltximg} export and convert this environment: - -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{pspicture}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{pspicture*}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{postscript}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{circuitikz}% -{} -\end{docEnvironment} -\end{minipage} - -\vspace{0.5cm} - -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{tikzpicture}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{pgfpicture}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{ganttchart}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{forest}% -{} -\end{docEnvironment} -\end{minipage} -\vspace{0.5cm} - -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{tikzcd}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{circuitikz}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{dependency}% -{} -\end{docEnvironment} -\end{minipage} -\begin{minipage}[c]{0.25\columnwidth} -\begin{docEnvironment}% -{other}% -{} -\end{docEnvironment} -\end{minipage} - - - -\subsection{Comment and ignore} - -The first step \textsf{ltximg } script create a image dir (\textsf{images/}) -and read all input file in memory, processing is as follows, being assumed that our file is \texttt{test.tex}: - -\begin{enumerate} -\item Create a copy file in memory and change problematic environments (verbatim, verbatim\*, lstlisting, - LTXexample, Verbatim, comment, alltt, minted, tcblisting, xcomment and ignore) - -\item Change problematic inline verbatim from varius package (lstlisting,LTXexample, Verbatim, comment, alltt, minted, tcblisting, etc) include line whit \%. -\end{enumerate} - - - -\subsection{Create source and images} -\begin{enumerate} - -\item If script is call whitout \textsf{--nopreview} option (default), adds the following lines to the beginning of the test.tex in memory and save file test-fig.tex in images dir : - -\begin{lstlisting} -\AtBeginDocument{ -\RequirePackage[active,tightpage]{preview} -\renewcommand\PreviewBbAdjust{-60pt -60pt 60pt 60pt}% -\newenvironment{postscript}{}{}% -\PreviewEnvironment{postscript}}% -\end{lstlisting} - -\item If script is call whit \textsf{--nopreview} option, all environment code its put inside the : - -\begin{lstlisting} -\begin{postscript} -... -\end{postscript} -\end{lstlisting} - -and separate in individual files (test-fig-1.tex, test-fig-2.tex, etc) in image dir and join in test-fig.tex. The postscript environment can be used to place any material to be exported if that is not supported or fails the \textsf{--other} option. - - -\item Now, the script call (pdf/lua/xe)latex in \texttt{test-fig.tex} and \textsf{pdfcrop} in -\texttt{test-fig.pdf} and create image files. -\end{enumerate} - -\section{Example} -\begin{lstlisting} -ltximg test.tex -e -p -j -c -o --imgdir=pics -\end{lstlisting} -produce test-out.tex whitout PGF|TiKZ|PST environments and create "pics" dir whit all images (pdf,eps,png,jpg) and source (.tex) for all related parts using \hologo{pdfLaTeX} whit preview package and cleaning all tmp files. - -\noindent -Suport bundling for short options: -\begin{lstlisting} -ltximg test.tex -epjco --imgdir=pics -\end{lstlisting} -\end{document} - - - -LTXimg extract and convert all PGF|TiKZ|Pstricks environments from TeX - source into single images files (pdf/png/eps/jpg/svg) using Ghostscript. - By default search and extract environments using (pdf)LaTeX. - -Environments suports by LTXimg: - - pspicture tikzpicture pgfpicture forest ganttchart - tikzcd circuitikz dependency other postscript - -Options: -\begin{tabularx}{\linewidth}{@{}>{\ttfamily} l>{\ttfamily} l >{\ttfamily}l X @{}}\\\toprule -\emph{short} & \emph{name} & \emph{default} & \emph{description}\\\midrule - -h&--help & &display this help and exit - -l&--license & &- display license information and exit - -v&--version & & - display version (current 1.2) and exit - -d&--dpi= & 150 & - the dots per inch for images - -j&--jpg & &- create .jpg files (need Ghostscript) - -p&--png & &- create .png files (need Ghostscript) - -e&--eps & &- create .eps files (need pdftops) - -s&--svg & &- create .svg files (need pdf2svg) - -P&--ppm & &- create .ppm files (need pdftoppm) - -a&--all & &- create .(pdf,eps,jpg,png) images - -c&--clear & &- delete all temp and aux files - -o&--output & &- create a file-out.tex whitout PGF|TiKZ|PST code - -m&--margins=& &- margins in bp for pdfcrop (default 0) - -np&--nopreview & &- create images files whitout preview package - -ns&--nosource & &- delete all source for images files - &--miktex & &- use --enable-write18 for MikTeX users - &--xetex & &- using (Xe)LaTeX for create images - &--latex & &- using LaTeX for create images - &--luatex & &- using (Lua)LaTeX for create images - &--nopdf & &- don't create a PDF image files (default off) - &--other= & &- search other environment (default other) - &--ignore= & &- skip verbatim environment (default ignore) - &--imgdir= & &- the folder for images (default images) - \bottomrule -\end{tabularx} - - -Example: -* ltximg test.tex -e -p -j -c -o --imgdir=pics -* produce test-out.tex whitout PGF|TiKZ|PST environments and create "pics" -* dir whit all images (pdf,eps,png,jpg) and source (.tex) for all related -* parts using (pdf)LaTeX whit preview package and cleaning all tmp files. -* Suport bundling for short options: ltximg test.tex -epjco --imgdir=pics -END_OF_USAGE -- cgit v1.2.3