larskotthoff / gnuplottex

Gnuplot graphs in LaTeX. See http://www.ctan.org/pkg/gnuplottex
3 stars 1 forks source link

Incorrect options for lualatex in example for terminal tikz using tikzexternalize #8

Closed kiryph closed 7 years ago

kiryph commented 7 years ago

https://github.com/larskotthoff/gnuplottex/blob/b12efdb66e5167e5d01efff60e1daf6ad603b327/gnuplottex.dtx#L632-L633

suggests

\tikzset{external/system call={lualatex -shell-escape -halt-on-error
-interaction=batchmode -jobname "\image" "\texsource"}}

However, lualatex uses two hyphens in front of options (in contrast to pdflatex; an inconsistency which could have been avoided). I have checked following versions of lualatex: 0.79.1, 0.80 and 0.95.0 all use two hyphens.

$ lualatex --help
...
  The following regular options are understood:

   --credits                     display credits and exit
   --debug-format                enable format debugging
   --draftmode                   switch on draft mode (generates no output PDF)
   --[no-]file-line-error        disable/enable file:line:error style messages
   --[no-]file-line-error-style  aliases of --[no-]file-line-error
   --fmt=FORMAT                  load the format file FORMAT
   --halt-on-error               stop processing at the first error
   --help                        display help and exit
   --ini                         be iniluatex, for dumping formats
   --interaction=STRING          set interaction mode (STRING=batchmode/nonstopmode/scrollmode/errorstopmode)
   --jobname=STRING              set the job name to STRING
   --kpathsea-debug=NUMBER       set path searching debugging flags according to the bits of NUMBER
   --lua=FILE                    load and execute a lua initialization script
   --[no-]mktex=FMT              disable/enable mktexFMT generation (FMT=tex/tfm)
   --nosocket                    disable the lua socket library
   --output-comment=STRING       use STRING for DVI file comment instead of date (no effect for PDF)
   --output-directory=DIR        use existing DIR as the directory to write files in
   --output-format=FORMAT        use FORMAT for job output; FORMAT is 'dvi' or 'pdf'
   --progname=STRING             set the program name to STRING
   --recorder                    enable filename recorder
   --safer                       disable easily exploitable lua commands
   --[no-]shell-escape           disable/enable system commands
   --shell-restricted            restrict system commands to a list of commands given in texmf.cnf
   --synctex=NUMBER              enable synctex
   --version                     display version and exit

So the example should read

\tikzset{external/system call={lualatex --shell-escape --halt-on-error
--interaction=batchmode -jobname "\image" "\texsource"}}
kiryph commented 7 years ago

I am not sure about this anymore. It seems to be that lualatex accepts both.

UPDATE The error I got was misleading following example works for me

\RequirePackage{luatex85,shellesc}
\documentclass[]{article}
\usepackage{gnuplottex}
\usepackage{tikz}
\usepackage{gnuplot-lua-tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=gnuplottex/] %-- Use the gnuplottex-subfolder. Deactivate
                                     %-- the subfolderoption of gnuplottex to use!
\tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}
\tikzexternalize

\begin{document}
\begin{figure}%
   \centering%
   \tikzsetnextfilename{ThisIsASinus}
   \begin{tikzpicture}
   \begin{gnuplot}[terminal=tikz, terminaloptions=color dashed nopicenvironment]
      set grid xtics mxtics lt 0 ls 0
      set grid ytics mytics lt 0 ls 0
      set key box top left
      plot sin(x) w l t 'Sinus'
   \end{gnuplot}
   \end{tikzpicture}
   \caption{Captiontext.}%
   \label{pic:ThisIsASinus}%
\end{figure}%
\end{document}

with

$ lualatex -shell-escape filename.tex

The issue I encountered is probably the same as #7, so I have missed for the more recent lualatex versions to add \RequirePackage{luatex85,shellesc}.

UPDATE 2 The documentation of Web2c is a little bit more specific about this http://tug.org/texinfohtml/web2c.html#Option-conventions :

use ‘-’ or ‘--’ to start an option name;

And one should note that the popular building tool latexmk follows this convention

All options can be introduced by single or double "-" characters, e.g., "latexmk -help" or "latexmk --help".

larskotthoff commented 7 years ago

Thanks for looking into this. I'm glad it worked out.