diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/latex/contrib/hvextern/Changes | 3 | ||||
-rw-r--r-- | macros/latex/contrib/hvextern/doc/hvextern.pdf | bin | 1495836 -> 1504455 bytes | |||
-rw-r--r-- | macros/latex/contrib/hvextern/doc/hvextern.tex | 6 | ||||
-rw-r--r-- | macros/latex/contrib/hvextern/latex/hvextern.sty | 50 | ||||
-rw-r--r-- | macros/luatex/latex/luaplot/luaplot.pdf | bin | 144774 -> 147391 bytes | |||
-rw-r--r-- | macros/luatex/latex/luaplot/luaplot.sty | 42 | ||||
-rw-r--r-- | macros/luatex/latex/luaplot/luaplot.tex | 11 |
7 files changed, 88 insertions, 24 deletions
diff --git a/macros/latex/contrib/hvextern/Changes b/macros/latex/contrib/hvextern/Changes index 2b5f16f44c..c8f56a144b 100644 --- a/macros/latex/contrib/hvextern/Changes +++ b/macros/latex/contrib/hvextern/Changes @@ -1,7 +1,8 @@ hvextern.sty ---------------- +v 0.34 2023-07-05 - fix for missing --shell-escape option v 0.33 2023-01-29 - fixed bug with vertical space before and end of - the example code + the example code v 0.32 2022-06-23 - fixed introduced bug - added checkCode also for pdflatex and xelatex v 0.31 2022-06-20 - added package option checkCode to run the external diff --git a/macros/latex/contrib/hvextern/doc/hvextern.pdf b/macros/latex/contrib/hvextern/doc/hvextern.pdf Binary files differindex 79279aab99..a71482310f 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.pdf +++ b/macros/latex/contrib/hvextern/doc/hvextern.pdf diff --git a/macros/latex/contrib/hvextern/doc/hvextern.tex b/macros/latex/contrib/hvextern/doc/hvextern.tex index 5e40c2b98b..7f3e7fcc86 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.tex +++ b/macros/latex/contrib/hvextern/doc/hvextern.tex @@ -1,4 +1,4 @@ -%% $Id: hvextern.tex 678 2023-01-29 09:59:12Z herbert $ +%% $Id: hvextern.tex 737 2023-07-03 11:28:45Z herbert $ \RequirePackage{pdfmanagement-testphase} \DeclareDocumentMetadata{} \documentclass[ngerman,a4paper,twoside]{article} @@ -1874,8 +1874,8 @@ already exists, there is no need to create it with the next run again and again. if the package option \Loption{checkCode} exists. \item[\Lkeyword{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{aux}, \texttt{log}. It must be a comma seperated list of the extensions of the main file, s.g. \texttt{cleanup=\{aux,log\}}. -\item[\Lkeyword{copyToExampleDir}] name of a directory for the examples, must first be created by the user himself -\item[\Lkeyword{ExamplesDir}] move all examples into a directory +\item[\Lkeyword{moveToExampleDir}] name of a directory for the examples, must first be created by the user himself +\item[\Lkeyword{ExampleDir}] move all examples into a directory \item[\Lkeyset{tclbox=false}] Can be used if there are some negative interactions between package \Lpack{listings} and package \Lpack{tcolorbox}. \item[\Lkeyword{framesep}] Value for \Lcs{fbox} if keyword \texttt{frame} is used. diff --git a/macros/latex/contrib/hvextern/latex/hvextern.sty b/macros/latex/contrib/hvextern/latex/hvextern.sty index 9f90b708a2..e17e0eb284 100644 --- a/macros/latex/contrib/hvextern/latex/hvextern.sty +++ b/macros/latex/contrib/hvextern/latex/hvextern.sty @@ -1,4 +1,4 @@ -%% $Id: hvextern.sty 678 2023-01-29 09:59:12Z herbert $ +%% $Id: hvextern.sty 743 2023-07-05 20:11:10Z herbert $ %% This is file `hvextern.sty', %% %% Copyright (C) 2016-23 @@ -12,8 +12,8 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\def\hvexternFileversion{0.33} -\ProvidesFile{hvextern}[2023/01/29 v\hvexternFileversion: package for running external documents (HV)] +\def\hvexternFileversion{0.34} +\ProvidesFile{hvextern}[2023/07/05 v\hvexternFileversion: package for running external documents (HV)] \newif\ifhv@extern@checkCode \hv@extern@checkCodefalse @@ -43,6 +43,7 @@ \fi \newcounter{hv@extern@runs} +\newcounter{hv@extern@runsAfter} \newcounter{@@@runs} \newcounter{hv@extern@pageCNT} \newsavebox\hv@extern@box @@ -64,6 +65,7 @@ \define@key{hv}{progpath}{\def\hv@extern@progpath{#1}} \define@key{hv}{runsequence}[]{\def\hv@extern@runsequence{#1}} \define@key{hv}{runs}[1]{\setcounter{hv@extern@runs}{#1}} +\define@key{hv}{runsAfter}[1]{\setcounter{hv@extern@runsAfter}{#1}} \define@key{hv}{grfOptions}[]{\def\hv@extern@grfOptions{#1}} \define@key{hv}{lstOptions}[]{\def\hv@extern@lstOptions{#1}} \define@key{hv}{textOptions}[]{\def\hv@extern@textOptions{#1}} @@ -128,6 +130,7 @@ \def\hv@extern@compiler{#1}% \def\hv@extern@compilerNo{-1}% } +\define@boolkey{hv}[hv@extern@]{shellesc}[true]{} \define@key{hv}{aboveskip}[\medskipamount]{\setlength\hv@extern@aboveskip{#1}} \define@key{hv}{belowpreambleskip}[\smallskipamount]{\setlength\hv@extern@belowpreambleskip{#1}} \define@key{hv}{belowbodyskip}[\smallskipamount]{\setlength\hv@extern@belowbodyskip{#1}} @@ -144,6 +147,7 @@ code=false,% show Code crop=false,% erzeugte PDF "croppen" compiler=pdflatex,% zu verwendener Compiler + shellesc=true,% use shell-escape redirect=false,% write output into a file *.txt tcbox=true,% use tcolorbox grfOptions={},% Optionen der einzubindenden Grafik @@ -157,6 +161,7 @@ includegraphic=true,% Grafik einbinden oder User überlassen inline=false,% Grafik nicht in derselben Zeile runs=1,% Anzahl Compiler-Durchläufe + runsAfter=0, % Anzahl Durchläufe nach makeindex runsequence={},% Im Moment nicht aktiv biber=false,% Biber laufen lassen? xindex=false,% xindex laufen lassen? @@ -223,7 +228,7 @@ { \clist_map_inline:nn {#1}{% \hv@ex@typeout{sequencerun: ##1}% - \ShellEscape{\hv@extern@progpath##1\space\hvExternDateiname}% + \ShellEscape{\hv@extern@progpath##1\space\hv@run@options\hvExternDateiname}% } } \ExplSyntaxOff @@ -343,7 +348,7 @@ \def\hv@extern@runTEX#1#2#3#4{% path compiler file extension \hv@ex@typeout{running #1#2 #3#4}% - \ShellEscape{#1tex\space #3#4}% + \ShellEscape{#1tex\space\hv@run@options #3#4}% \hv@ex@typeout{running #1dvips #3}% \ShellEscape{#1dvips\space #3.dvi}% \hv@ex@typeout{running ps2pdf #3.ps}% @@ -361,7 +366,7 @@ % only for the sequence latex->dvips->ps2pdf \def\hv@extern@runLATEX#1#2#3#4{% path-compiler-file-extension \hv@ex@typeout{running #1#2 #3#4}% - \ShellEscape{#1#2\space #3#4}% + \ShellEscape{#1#2\space\hv@run@options #3#4}% \hv@ex@typeout{running #1dvips #3}% \ShellEscape{#1dvips\space #3.dvi}% \hv@ex@typeout{running ps2pdf #3.ps}% @@ -427,6 +432,7 @@ %% \newenvironment{externalDocument}[2][] {% + \ifhv@extern@shellesc\gdef\hv@run@options{ --shell-escape }\else\gdef\hv@run@options{}\fi% \xdef\hvExternDateiname{#2-\arabic{hv@example@counter}}% \gdef\hv@extern@savePara{#1}% \setkeys{hv}{#1}% \begin @@ -470,7 +476,7 @@ \fi \ifhv@extern@force \ifx\hv@extern@runsequence\@empty - \hv@ex@typeout{force=true: running \hv@extern@progpath\hv@extern@compiler~ \hvExternDateiname\hv@extern@ext ...}% + \hv@ex@typeout{force=true: running \hv@extern@progpath\hv@extern@compiler\ \hv@run@options \hvExternDateiname\hv@extern@ext ...}% \setcounter{@@@runs}{\value{hv@extern@runs}}% \loop\ifnum\the@@@runs > 0\relax \ifcase\hv@extern@compilerNo \relax % we have metapost @@ -487,8 +493,8 @@ \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext > \hvExternDateiname.txt}% \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext\space > \hvExternDateiname.txt}% \else - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext}% + \hv@ex@typeout{running \hv@extern@compiler~\hv@run@options~\hvExternDateiname\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hv@run@options\space\hvExternDateiname\hv@extern@ext}% \fi \fi \addtocounter{@@@runs}{-1}% @@ -502,6 +508,32 @@ \ShellEscape{xindex \hv@extern@xindexOptions\space \hvExternDateiname.idx}% NAch xindex nochmal latex \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname}% \fi + \expandafter\ifnum\value{hv@extern@runsAfter} > 0 + \hv@ex@typeout{runsAfter>0: running \hv@extern@progpath\hv@extern@compiler~ \hvExternDateiname\hv@extern@ext ...}% + \setcounter{@@@runs}{\value{hv@extern@runsAfter}}% + \loop\ifnum\the@@@runs > 0\relax + \ifcase\hv@extern@compilerNo \relax % we have metapost + \hv@ex@typeout{running mpost \hvExternDateiname\hv@extern@ext}% + \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \or %1 + \hv@ex@typeout{running tex \hvExternDateiname\hv@extern@ext}% + \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \or %2 + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% + \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \else + \ifhv@extern@redirect + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext > \hvExternDateiname.txt}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext\space > \hvExternDateiname.txt}% + \else + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext}% + \fi + \fi + \addtocounter{@@@runs}{-1}% + \repeat + \hv@ex@typeout{... done}% + \fi \else % runsequence \expandafter\run@hv@extern@sequenceList\expandafter{\hv@extern@runsequence}% \fi diff --git a/macros/luatex/latex/luaplot/luaplot.pdf b/macros/luatex/latex/luaplot/luaplot.pdf Binary files differindex c482c6bab9..2217258723 100644 --- a/macros/luatex/latex/luaplot/luaplot.pdf +++ b/macros/luatex/latex/luaplot/luaplot.pdf diff --git a/macros/luatex/latex/luaplot/luaplot.sty b/macros/luatex/latex/luaplot/luaplot.sty index eb071b568e..f9f5377c90 100644 --- a/macros/luatex/latex/luaplot/luaplot.sty +++ b/macros/luatex/latex/luaplot/luaplot.sty @@ -1,9 +1,9 @@ % luaplot package -% version 1.0 +% version 1.2 % Licensed under LaTeX Project Public License v1.3c or later. The complete license text is available at http://www.latex-project.org/lppl.txt. -%Authors: Chetan Shirore and Dr. Ajit Kumar +%Authors: Chetan Shirore and Ajit Kumar -\ProvidesPackage{luaplot} +\ProvidesPackage{luaplot}[1.2] \RequirePackage{xkeyval} \RequirePackage{luacode} \RequirePackage{tikz} @@ -18,13 +18,37 @@ function checknumber(x) end end -function luapath (f,a,b,n) +function luapath (f,a,b,n,myclr) + local mytbl ={} local s = "" - s = s.."(" .. a .."," .. f(a) ..")" + local finalstr = "" + local y = f(a) + local mycnt = 1 + if y == y and not (y==math.huge or y==-math.huge ) then + s = s.."(" .. a .."," .. f(a) ..")" + end for i = 1, n do - s= s .. "-- (" ..((b - a) / n * i + a) ..",".. checknumber(f((b - a) / n * i + a))..")" + local y = f((b - a) / n * i + a) + if y == y and not (y==math.huge or y==-math.huge ) then + if s~='' then + s= s .. "-- (" ..checknumber(((b - a) / n * i + a)) ..",".. checknumber(y)..")" + else + s= s .. "(" ..checknumber(((b - a) / n * i + a)) ..",".. checknumber(y)..")" + end + mytbl[mycnt] = s + else + if s~='' then + mytbl[mycnt] = s + mycnt = mycnt + 1 + s = '' + end + end + + end + for j=1, #mytbl do + finalstr = finalstr .."gdraw " ..tostring(mytbl[j]).."withcolor " .. myclr..";" end - return "gdraw " ..s + return finalstr end function luatikzpath (f,a,b,n) @@ -74,7 +98,7 @@ color clr; local endcode = [[ endgraph; endfig; -\string\end{mplibcode} +\string\end{mplibcode} ]] local expr={} local countexp = 1 @@ -100,7 +124,7 @@ tex.print(begincode) for k=1, countexp-1 do local clr = colortbl[k] or 'black'; local w = plotstytbl[k] or ''; - mainstr="drawoptions("..w..");"..luapath(expr[k],\mop@one,\mop@two,\mop@five).."withcolor " .. clr..";"..'drawoptions();' + mainstr="drawoptions("..w..");"..luapath(expr[k],\mop@one,\mop@two,\mop@five, clr)..'drawoptions();' tex.print(mainstr) end tex.print(tostring(\mop@ten))% diff --git a/macros/luatex/latex/luaplot/luaplot.tex b/macros/luatex/latex/luaplot/luaplot.tex index cc238260eb..a0defde6b6 100644 --- a/macros/luatex/latex/luaplot/luaplot.tex +++ b/macros/luatex/latex/luaplot/luaplot.tex @@ -107,7 +107,7 @@ clr \begin{lstlisting}[caption={[]}] plotoptions \end{lstlisting} - & Specifies different options for plotting. The input is to be in curly braces. If the expression is a big string and multi-line then it can be enclosed in two square brackets (string in Lua). The different plot options include grids, labels, legends, axes styles, point markings on axes, framing styles etcetera. For all possible options, the MetaPost package \cite{online.metapost} documentation and guide \cite{article.hobby} can be referred. \\ + & Specifies different options for plotting. The input is to be in curly braces. If the expression is a big string and multi-line then it can be enclosed in two square brackets (string in Lua). The different plot options include grids, labels, legends, axes styles, point markings on axes, framing styles etcetera. For all possible options, the MetaPost package documentation \cite{online.metapost} and guide \cite{article.hobby} can be referred. \\ \bottomrule \\ \caption{Optional parameters in the luaplot command} \label{tbl:paraluaplot} @@ -167,7 +167,14 @@ xmin=-10,xmax=10] \end{lstlisting} & \newline \luaplot[ clr={ 'red, blue, green' }, xmin=-10,xmax=10] -{x^3,-x^3,x} \\ +{x^3,-x^3,x} \\ \midrule +\begin{lstlisting}[caption={[]}] +\luaplot[xmin=-5,xmax=5, +clr={'red, blue'}] +{(2*(x^2)-1)/(x^2-1),1/x} +\end{lstlisting} & \newline \luaplot[xmin=-5,xmax=5, +clr={'red, blue'}] +{(2*(x^2)-1)/(x^2-1),1/x} \\ \bottomrule \\ \caption{Plotting graphs with the luaplot command} \label{tbl:luaplotex} |