auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 201


From: jfbu
Subject: Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Date: Thu, 24 May 2018 12:51:13 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:52.0) Gecko/20100101 Thunderbird/52.8.0


Hi Keita,



Le 24/05/2018 à 12:44, Ikumi Keita a écrit :
Hi Jean,

Thanks a lot again, the proposed method works on the command line!  I'll
implement it in the actual preview-latex code.

By the way, if I remember correctly, filenames with multiple contiguous
spaces are not supported by TeX, aren't they?  Standard pdflatex just
fails for such file names:


ah you are right it was never supported by AUCTeX anyhow.

But it is possible to make it work (I used this kind of tricks in my Preview 
adventures)

$ pdflatex  -file-line-error   -interaction=nonstopmode "\relax{\catcode32 12 
\edef\x{\noexpand\input{\detokenize{\"test      spaces.tex\"}}}\expandafter}\x"
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded 
format=pdflatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2018-04-01> patch level 4
(./test      spaces.tex
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo))
(./test      spaces.aux) [1{/usr/local/texlive/2018/texmf-var/fonts/map/pdftex/
updmap/pdftex.map}] (./test      spaces.aux) )</usr/local/texlive/2018/texmf-di
st/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/local/texlive/2018/texmf-dis
t/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2018/texmf-dist/
fonts/type1/public/amsfonts/cm/cmr7.pfb>
Output written on "test      spaces.pdf" (1 page, 23299 bytes).
Transcript written on "test      spaces.log".

Thus it is only a problem of getting the filename correctly to pdflatex.

I admit this is somewhat extreme. I have never tried until today. It shows that
the only problem is to bypass TeX tokenization of contiguous spaces as only one,
but once this is done the pdflatex binary has no issues.

(one may fear problems with makeindex bibtex etc... never tested, in fact
I recall some time ago I was surprised to discover pdftex supported filename
with a single space to start with, but now I am sort in a frenzy ...)

Thus it is reasonable to not insist that Preview supports filenames with
multiple contiguous spaces, as already AUCTeX has no a priori support for
such filenames.

But in principle it is possible to add it as above.

Best,

Jean-François


----------------------------------------------------------------------
[bash]$ cp ppp\ qqq.tex aaa\ \ bbb.tex
[bash]$ pdflatex aaa\ \ bbb.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded 
format=pdflatex)
  restricted \write18 enabled.
entering extended mode
! I can't find file `"aaa bbb.tex"'.
<*> "aaa  bbb.tex"
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
----------------------------------------------------------------------
So I suppose that it is not necessary for preview-latex to support such
file names.

jfbu <address@hidden> writes:
In short, in presence of the /AUCTEXINPUT hack, the original space hack
simply ceases functioning because the space catcode is reset to "ignore"
too soon (at \everyjob)

How to fix this ?

With this new version of ini file

\ifx\pdfoutput\undefined\else\let\PREVIEWdump\dump\def\dump{%
\edef\next{{\pdfoutput=\the\pdfoutput\relax\the\everyjob}}%
\everyjob\next\catcode`\ 10 %
\catcode`/ 0 %
\def\AUCTEXINPUT##1{\catcode`/ 12\relax\catcode`\ 
9\relax\input{\detokenize{"##1"}}}%
\let\dump\PREVIEWdump\dump}\fi\input mylatex.ltx \relax%


Notice that when ##1 (i.e. the filename) will be grabbed) the / is of
catcode 0, so ##1 is tokenized accordingly. Which in principle could
perhaps cause an issue \detokenize{aaa/b23} would give aaa/b<space>123
but as / is not legal in filenames in contexts I know of, I did not even
test this anticipation.

I have also added quotes inside the \detokenize.

I tested with a file with filename "test mylátex.tex"

I. Generation of format

etex -ini "&pdflatex" prv_test_mylátex.ini 
"\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}"
 "\input{\detokenize{\"test mylátex.tex\"}}"

where file prv_test_mylátex.ini contains the above contents (from 
\ifx\pdfoutput to \relax%)
and attention to the added quotes inside the \detokenize argument.

II. Usage of format

pdflatex -fmt="prv_test_mylátex.fmt" /AUCTEXINPUT{test mylátex.tex}

Could you try this out ?

Best

Jean-François

Best regards,
Ikumi Keita






reply via email to

[Prev in Thread] Current Thread [Next in Thread]