[latexrefman] Terminal input/output and Command line

Hefferon, Jim S. jhefferon at smcvt.edu
Thu Jun 28 00:36:29 CEST 2018


> It's not possible to put commands after a bare input filename. It's all
covered by the first-line-with-backslash case.

Yes, it doesn't make sense.  But this at least to me seems to say that.

ftpmaint at millstone:~$ pdflatex --help
Usage: pdftex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
   or: pdftex [OPTION]... \FIRST-LINE
   or: pdftex [OPTION]... &FMT ARGS
  Run pdfTeX on TEXNAME, usually creating TEXNAME.pdf.
  Any remaining COMMANDS are processed as pdfTeX input, after TEXNAME is read.
    (more)

> I'm not sure if we (want to) go into any interactive use, since it's so infrequent.

I want to cover the case of changing some switch on the command line:

  pdflatex "\def\evennumberedanswers{1}\input book.tex"

> I think the default shell-restricted behavior (for TL and, I hope, for MiKTeX?) should be mentioned.

Yes, I mentioned it under the shell-escape option.   Here is what I said; asl always suggestions welcome:

"Sometimes you want to run external system commands from inside a LaTeX file. For instance the package sagetex allows you to have the mathematics software system Sage do calculations or draw graphs and then incorporate that output in your document. For this TeX provides the \write18 command.

But with this functionality enabled, security issues could happen if you compiled a LaTeX file from the Internet. By default \write18 is disabled. (More precisely, by default TeX Live, MacTeX, and MikTeX allow the execution of a limited number of TeX-related programs, which they distribute.)

If you call \write18{ls -l} with the option no-shell-escape then you do not get an error, but the log file says ‘runsystem(ls -l)...disabled’."

Jim

----------
According to a 1983 investigation by Canadian Broadcasting Corporation producer Brian Vallee, the lemming scenes were faked. The lemmings supposedly committing mass suicide by leaping into the ocean were actually thrown off a cliff by the Disney filmmakers. --http://www.adfg.alaska.gov/index.cfm?adfg=wildlifenews.view_article&articles_id=56

________________________________________
From: Karl Berry <karl at freefriends.org>
Sent: Wednesday, June 27, 2018 5:34:19 PM
To: Hefferon, Jim S.
Cc: latexrefman at tug.org
Subject: Re: [latexrefman] Terminal input/output and Command line

    For Command line I gave a synopsis of the calling syntax (commands after
    the filename?).

It's not possible to put commands after a bare input filename. It's all
covered by the first-line-with-backslash case.

That is, either
  pdflatex foo
or
  pdflatex '\input foo \commands'

The command line is treated as if it were typed in response to the
initial ** prompt. I'm not sure if we (want to) go into any interactive
use, since it's so infrequent.

The \input does not have to be first. It's just a TeX input stream if it
starts with \. For example:
  pdflatex '\nonstopmode\input foo'
I habitually use this, since I generally don't want interaction, and I
was doing this long before the -interaction option existed. I guess
nowadays using -interaction is clearer.

On another front, I think it would be better not to repeat the different
cmdlines for the "latex" engine. Instead, give them once and then say a
cleaned-up version of "pdflatex program could also be latex (dvi
output), xelatex (xetex engine, pdf output), lualatex (luatex engine,
pdf output), dvilualatex (luatex engine, dvi output)".

Also, I'm not sure about giving these two separately:
  pdflatex @var{option} ... @var{latex-filename} @var{commands}
  pdflatex @var{option} ... @var{latex-filename}.tex @var{commands}
Might be clearer to say the filename is extended with .tex if needed,
since it's really the same thing, giving a filename. (How I wish Knuth
  had not done those default extension extendings.)

Finally, I think the default shell-restricted behavior (for TL and, I
hope, for MiKTeX?) should be mentioned. --thanks, karl.



More information about the latexrefman mailing list