Thanks for responding! etex, pdftex and pdflatex all seem to take the jobname argument, which may be what's wanted. Alternatively, you could consider mentioning briefly in the documentation that -o simply moves the output file.
On Thu, Nov 9, 2023 at 1:44 PM Gavin Smith <[email protected]> wrote: > > Caution: External email. > > > On Wed, Nov 08, 2023 at 03:07:04PM -0500, Jonathan Dushoff wrote: > > When I specify an alternative pdf target on the command line, the > > argument is respected, but the console reports that it is not. See > > below. This can cause serious confusion in complicated work flows, and > > is presumably easy to fix. > > It's not completely straighforward. texi2pdf calls pdftex, which outputs > the file in the default location. texi2pdf then moves the file to the > output location. > > It's possible to output a message about moving the file: > > diff --git a/util/texi2dvi b/util/texi2dvi > index e33d8eea44..47b7a7da68 100755 > --- a/util/texi2dvi > +++ b/util/texi2dvi > @@ -595,7 +595,7 @@ move_to_dest () > > if test "$mtd_sourcedir/$mtd_sourcebase" != "$mtd_destdir/$mtd_destbase" > then > - verbose "Moving $file to $mtd_destfile" > + echo "Moving $file to $mtd_destfile" > rm -f "$mtd_destfile" > mv "$file" "$mtd_destfile" > fi > > Then for something like "texi2pdf info-stnd.texi -o foobar.pdf", the > output finishes: > > Output written on info-stnd.pdf (45 pages, 305876 bytes). > Transcript written on info-stnd.log. > Moving info-stnd.pdf to /home/g/src/texinfo/GIT/doc/foobar.pdf > > You can see the absolute path being used. > > However, this also leads to extra messages being printed with --tidy > The output of "texi2pdf info-stnd.texi --tidy" finishes: > > Output written on info-stnd.pdf (45 pages, 305876 bytes). > Transcript written on info-stnd.log. > Moving info-stnd.pdf to /home/g/src/texinfo/GIT/doc/info-stnd.pdf > > So I'd propose a slightly more complicated change: > > diff --git a/util/texi2dvi b/util/texi2dvi > index e33d8eea44..f486ecffc7 100755 > --- a/util/texi2dvi > +++ b/util/texi2dvi > @@ -595,7 +595,10 @@ move_to_dest () > > if test "$mtd_sourcedir/$mtd_sourcebase" != "$mtd_destdir/$mtd_destbase" > then > - verbose "Moving $file to $mtd_destfile" > + case $oname in > + '') verbose "Moving $file to $mtd_destfile" ;; > + *) echo "Moving $file to $mtd_destfile" ;; > + esac > rm -f "$mtd_destfile" > mv "$file" "$mtd_destfile" > fi > > > - unconditionally outputing the "Moving" message only for the -o flag. > > The main question is if is sensible to use the absolute file name even > if one was not given to -o. I think it would be fine to. > > I cannot see any option that could be given to etex or pdftex to > change the output file, and even if one existed there is a good chance > it wouldn't work on some versions of TeX. > > > > > I will mention also that the .log file is put in the default place > > (not matching the pdf file location). This might or might not be seen > > as an infelicity. > > Again, it's done by TeX, and we can't do anything about it, other than > perhaps moving the log file afterwards, but this isn't worth the trouble > (and other auxiliary output files like indices, *.toc and *.aux will > also have the default names). -- Jonathan Dushoff (https://tinyurl.com/jd-pronouns) McMaster University Department of Biology https://mac-theobio.github.io/ https://twitter.com/jd_mathbio http://jd-mathbio.blogspot.com/
