Skip to content

Commit

Permalink
Added dvi support with use latex and dvi and dvi to ps
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasBora committed Mar 19, 2024
1 parent 85b5dd1 commit 2363dc1
Show file tree
Hide file tree
Showing 7 changed files with 3,123 additions and 4 deletions.
11 changes: 11 additions & 0 deletions doc/figures/demo.tikz
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
\begin{tikzpicture}
\begin{pgfonlayer}{nodelayer}
\node [style=Z dot] (0) at (0, 0) {};
\node [style=X dot] (1) at (1, 0) {};
\end{pgfonlayer}
\begin{pgfonlayer}{edgelayer}
\draw [bend left=60] (0) to (1);
\draw [bend right=60] (0) to (1);
\draw (0) to (1);
\end{pgfonlayer}
\end{tikzpicture}
Binary file modified doc/robust-externalize.pdf
Binary file not shown.
24 changes: 21 additions & 3 deletions doc/robust-externalize.tex
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
{\Large\bfseries Cache anything (\tikzname, tikz-cd, python…),\\in a robust, efficient and pure way.}

\vspace{1em}
{Léo Colisson \quad Version 2.9}\\[3mm]
{Léo Colisson \quad Version 2.9+unstable}\\[3mm]
{\href{https://github.com/leo-colisson/robust-externalize}{\texttt{github.com/leo-colisson/robust-externalize}}}
\end{center}

Expand Down Expand Up @@ -3859,10 +3859,24 @@ \subsubsection{\LaTeX{} and \tikzname{}}
\extractkey/robExt/latex/use latexmk\@nil
\extractkey/robExt/latex/use lualatex\@nil
\extractkey/robExt/latex/use xelatex\@nil
\extractkey/robExt/latex/use latex and dvi\@nil
\extractkey/robExt/dvi to ps\@nil
\makeatother%
\pgfmanualbody
Use latexmk/lualatex/xelatex to compile. It is a shortcut for:\\
|set placeholder={__ROBEXT_LATEX_ENGINE__}{yourfavoriteengine}|
The first three styles use latexmk/lualatex/xelatex to compile. It is a shortcut for:\\
|set placeholder={__ROBEXT_LATEX_ENGINE__}{yourfavoriteengine}|\\
|dvi to ps| is called internally in |use latex and dvi|, converts the |.dvi| file into a |.ps| file, and renames it into |.pdf| so that it is automatically included. |use latex and dvi| sets the compiler to |latex|, producing |dvi| files, and call |dvi to ps| to convert them to ps files that can be included. So if your workflow involves dvi, you can call directly:
\begin{codeexample}[code only]
\robExtConfigure{
add to preset={latex}{use latex and dvi},
}
\end{codeexample}
and you can then compile your file as usual with:
\begin{verbatim}
# --shell-escape only needed the first time you compile, see above for alternatives
$ latex --shell-escape yourfile.tex
$ dvips yourfile.dvi
\end{verbatim}
\end{pgfmanualentry}
\begin{pgfmanualentry}
Expand Down Expand Up @@ -4932,6 +4946,10 @@ \section{TODO and known bugs:}
\section{Changelog}
\begin{itemize}
\item v2.10 (not yet released, github master branch):
\begin{itemize}
\item Added |dvi to ps| and |use latex and dvi|
\end{itemize}
\item v2.9 (2024/03/15)
\begin{itemize}
\item Bug that may forbid the package to load has been fixed (you might encounter |ERROR: Missing = inserted for \ifnum|)
Expand Down
42 changes: 42 additions & 0 deletions doc/tikzit.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes,shapes.geometric,shapes.misc}

% this style is applied by default to any tikzpicture included via \tikzfig
\tikzstyle{tikzfig}=[baseline=-0.25em,scale=0.5]

% these are dummy properties used by TikZiT, but ignored by LaTex
\pgfkeys{/tikz/tikzit fill/.initial=0}
\pgfkeys{/tikz/tikzit draw/.initial=0}
\pgfkeys{/tikz/tikzit shape/.initial=0}
\pgfkeys{/tikz/tikzit category/.initial=0}

% standard layers used in .tikz files
\pgfdeclarelayer{edgelayer}
\pgfdeclarelayer{nodelayer}
\pgfsetlayers{background,edgelayer,nodelayer,main}

% style for blank nodes
\tikzstyle{none}=[inner sep=0mm]

% include a .tikz file
\newcommand{\tikzfig}[1]{%
{\tikzstyle{every picture}=[tikzfig]
\IfFileExists{#1.tikz}
{\input{#1.tikz}}
{%
\IfFileExists{./figures/#1.tikz}
{\input{./figures/#1.tikz}}
{\tikz[baseline=-0.5em]{\node[draw=red,font=\color{red},fill=red!10!white] {\textit{#1}};}}%
}}%
}

% the same as \tikzfig, but in a {center} environment
\newcommand{\ctikzfig}[1]{%
\begin{center}\rm
\tikzfig{#1}
\end{center}}

% fix strange self-loops, which are PGF/TikZ default
\tikzstyle{every loop}=[]
Loading

0 comments on commit 2363dc1

Please sign in to comment.