diff options
Diffstat (limited to 'tex/src/preamble-pgfplots.tex')
| -rw-r--r-- | tex/src/preamble-pgfplots.tex | 155 | 
1 files changed, 121 insertions, 34 deletions
| diff --git a/tex/src/preamble-pgfplots.tex b/tex/src/preamble-pgfplots.tex index 75119d6..6c8ed5b 100644 --- a/tex/src/preamble-pgfplots.tex +++ b/tex/src/preamble-pgfplots.tex @@ -42,20 +42,15 @@  %  %% Copyright (C) 2018-2022 Mohammad Akhlaghi <mohammad@akhlaghi.org>  % -%% This file is part of Maneage (https://maneage.org). +%% This LaTeX file is part of Maneage. Maneage 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 file 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 file is distributed in the hope that it will be useful, but WITHOUT +%% Maneage 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. -% -%% You should have received a copy of the GNU General Public License along -%% with this file.  If not, see <http://www.gnu.org/licenses/>. +%% for more details. See <http://www.gnu.org/licenses/>. @@ -69,7 +64,9 @@  %% slow with detailed plots). 2) You can use the PDFs of the individual  %% plots for other purposes (for example to include in slides) cleanly.  \usepackage{tikz} +\usetikzlibrary{graphs}  \usetikzlibrary{external} +\usetikzlibrary{positioning}  \tikzexternalize  \tikzsetexternalprefix{tikz/} @@ -77,28 +74,17 @@ -%% The '\includetikz' can be used to either build the figures using -%% PGFPlots (when '\makepdf' is defined), or use an existing file (when -%% '\makepdf' isn't defined). When making the PDF, it will set the output -%% figure name to be the same as the 'tex/src/XXXX.tex' file that contains -%% the PGFPlots source of the figure. In this way, when using the PDF, it -%% will also have the same name, thus allowing the figures to easily change -%% their place relative to others: figure ordering won't be a problem. This -%% is a problem by default because if an explicit name isn't set at the -%% start, tikz will make images based on their order in the paper. -% -%% This function takes two arguments: -%%     1) The base-name of the LaTeX file with the 'tikzpicture' -%%        environment. As mentioned above, this will also be the name of -%%        the produced figure. -%%     2) The settings to use with 'includegraphics' when an already-built -%%        file should be used. +%% The following rule will cause the name of the files keeping a figure's +%% external PDF to be set based on the file that the TiKZ commands are +%% from. Without this, TiKZ will use numbers based on the order of +%% figures. These numbers can be hard to manage and they will also depend +%% on order in the final PDF, so it will be very buggy to manage them.  \newcommand{\includetikz}[2]{%    \ifdefined\makepdf%      \tikzsetnextfilename{#1}%      \input{tex/src/#1.tex}%    \else -    \includegraphics[#2]{tex/tikz/#1.pdf} +    \includegraphics[#2]{tex/tikz/#1.eps}    \fi  } @@ -109,12 +95,15 @@  %% Uncomment the following lines for EPS and PS images. Note that you still  %% have to use the 'pdflatex' executable and also add a '[dvips]' option to  %% graphicx. - -%% \tikzset{external/system call={rm -f "\image".eps "\image".ps -%% "\image".dvi; latex \tikzexternalcheckshellescape -halt-on-error -%% -interaction=batchmode -jobname "\image" "\texsource"; -%% dvips -o "\image".ps "\image".dvi; -%% ps2eps "\image.ps"}} +\tikzset{ +  external/system call={ +    rm -f "\image".eps "\image".ps "\image".dvi; +    latex \tikzexternalcheckshellescape -halt-on-error +          -interaction=batchmode -jobname "\image" "\texsource"; +    dvips -o "\image".ps "\image".dvi; +    ps2eps "\image.ps" +  } +} @@ -132,3 +121,101 @@    legend style = {font=\footnotesize},    label style = {font=\footnotesize}    } + + + + + +%% Nodes in demo graphs + +%% sub-Makefiles. +\tikzset{node-makefile/.style={ +  thick, +  rectangle, +  anchor=north, +  minimum height=4.7cm, +  minimum width=2.1cm, +  draw=green!50!black!50, +  fill=black!10!green!12!white}} + +%% Input files (green, sharp-edged boxes). +\tikzset{node-nonterminal/.style={ +  rectangle, +  very thick, +  anchor=north, +  text centered, +  top color=white, +  text width=1.7cm, +  minimum height=4mm, +  draw=green!50!black!50, +  bottom color=green!80!black!50, +  font=\ttfamily}} + +\tikzset{node-terminal/.style={ +  rectangle, +  very thick, +  draw=blue!50, +  text centered, +  top color=white, +  text width=1.7cm, +  minimum height=4mm, +  rounded corners=2mm, +  bottom color=blue!20, +  font=\ttfamily}} + + +%%%%%%%%%%%%%%%%%%% + +\tikzset{node-nonterminal-thin/.style={ +  rectangle, +  thick, +  text centered, +  top color=white, +  text width=2cm, +  minimum size=2mm, +  draw=green!50!black!50, +  bottom color=green!80!black!50, +  font=\ttfamily\scriptsize}} + +\tikzset{node-point/.style={ +  circle, +  black!50, +  inner sep=0pt, +  minimum size=0pt, +  fill=white}} + +\tikzset{ bbox/.style={ +  rectangle, +  minimum width=2.5cm, +  rounded corners=2mm, +  very thick,draw=blue!50, +  top color=white, +  bottom color=blue!20 } } + +\tikzset{ rbox/.style={ +    rectangle, +    dotted, +    minimum width=2.5cm, +    rounded corners=2mm, +    very thick,draw=red!50!black!50, +    top color=white, +    bottom color=red!50!black!20 } } + +\tikzset{ gbox/.style={ +    rectangle, +    minimum width=2.5cm, +    very thick, +    draw=green!50!black!50, +    top color=white, +    bottom color=green!50!black!20 } } + +\tikzset{ dirbox/.style={ +    thick, +    rectangle, +    anchor=north, +    text centered, +    font=\ttfamily, +    minimum width=15cm, +    minimum height=7.5cm, +    draw=brown!50!black!50, +    fill=brown!10!white }} | 
