Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Jean, thanks a lot, your advice led me to the success! > jfbu writes: > Putting altogether : > 1. We need file prv_testmylátex.ini to be > \ifx\pdfoutput\undefined\else\let\PREVIEWdump\dump\def\dump{% > \edef\next{{\catcode`\ 9 \pdfoutput=\the\pdfoutput\relax\the\everyjob}}% > \everyjob\next\catcode`\ 10 % > \catcode`/ 0 % > \def\AUCTEXINPUT##1{\catcode`/ 12\relax\input{\detokenize{##1}}}% > \let\dump\PREVIEWdump\dump}\fi\input mylatex.ltx \relax% > REMARK: the above hack of \dump is conditional on \pdfoutput being > defined which I think is good anyhow. \pdfoutput is defined for > pdflatex whether dvi or pdf output. > 2. We create the format with this incantation > etex -ini -jobname prv_testmylátex "&pdflatex" > "\input{\detokenize{prv_testmylá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{testmylátex.tex}}" > the following less paranoid version (I don't wrap the name of ini file in > \detokenize) seems to work too > etex -ini -jobname prv_testmylátex "&pdflatex" prv_testmylá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{testmylátex.tex}}" I took this version. I also omitted "-jobname prv_testmylátex" since the original AUCTeX code doesn't have that part. Do you recommend to restore them? > The detokenize at the end is really needed. (Or we could play the other games > with \UseRawInputEncoding) > 3. We then use the format with this incantation > pdflatex -fmt="prv_testmylátex.fmt" /AUCTEXINPUT{testmylátex.tex} I used the form "&prv_testmylátex" instead of -fmt="prv_testmylátex.fmt" following the original AUCTeX code. I expect this is harmless. > It works in my testing in Terminal on Mac OS X (bash shell) > (I tested it with /AUCTEXINPUT{some other file with non-ascii filename} > to check macros defined in the preamble of testmylátex.tex are actually > used, proving the created format was indeed used). Thank you very much for your all valuable works! I'll test this with other cases (TL2017, file names with space, on w32 platform) and propose to commit again. For those interested in, the current tentative patch is attached below. Regards, Ikumi Keita tentative-patch2.gz Description: new approach v2 ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Keita (still top-posting) I have an "in principle" solution, although it will look a bit complicated. First I will explain proof of principle, then concrete implementation. I hope you can incorporate that in AUCTeX. STEP I: generation of format. I will explain first the proof of principle and later how to make in practice. Imagine we can make sure the preamble of our document is like in this file : primárias.tex \documentclass{article} \catcode`/ 0 \def\AUCTEXINPUT#1{\catcode`/ 12\relax\input{\detokenize{#1}}} \begin{document} Hello \end{document} Generate format via this kind of invocation: (bash shell) etex -ini \&pdflatex mylatex.ltx {\\detokenize{testmylátex.tex}} STEP II. Use of format. This will go via this kind of invocation: (bash shell) pdflatex \&mylatex /AUCTEXINPUT{testmylátex.tex} It works in my testing. Now this was proof of principle. How to insert the special code \catcode`/ 0 \def\AUCTEXINPUT#1{\catcode`/ 12\relax\input{\detokenize{#1}}} ? We need it to make it into the format. This is where the kind of hack you reported as already present in AUCTeX can be used. It was \ifx\pdfoutput\undefined\else\let\PREVIEWdump\dump\def\dump{% \edef\next{{\catcode`\ 9 \pdfoutput=\the\pdfoutput\relax\the\everyjob}}\everyjob\next\catcode`\ 10 \let\dump\PREVIEWdump\dump}\fi\input mylatex.ltx \relax I am not sure why this, but anyway the point is that \dump is the last thing executed by \begin{document} when mylatex.ltx is in use to generate a format. So the above hacks \dump. We can hack it too to insert what we want from above. Putting altogether : 1. We need file prv_testmylátex.ini to be \ifx\pdfoutput\undefined\else\let\PREVIEWdump\dump\def\dump{% \edef\next{{\catcode`\ 9 \pdfoutput=\the\pdfoutput\relax\the\everyjob}}% \everyjob\next\catcode`\ 10 % \catcode`/ 0 % \def\AUCTEXINPUT##1{\catcode`/ 12\relax\input{\detokenize{##1}}}% \let\dump\PREVIEWdump\dump}\fi\input mylatex.ltx \relax% REMARK: the above hack of \dump is conditional on \pdfoutput being defined which I think is good anyhow. \pdfoutput is defined for pdflatex whether dvi or pdf output. 2. We create the format with this incantation etex -ini -jobname prv_testmylátex "&pdflatex" "\input{\detokenize{prv_testmylá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{testmylátex.tex}}" the following less paranoid version (I don't wrap the name of ini file in \detokenize) seems to work too etex -ini -jobname prv_testmylátex "&pdflatex" prv_testmylá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{testmylátex.tex}}" The detokenize at the end is really needed. (Or we could play the other games with \UseRawInputEncoding) 3. We then use the format with this incantation pdflatex -fmt="prv_testmylátex.fmt" /AUCTEXINPUT{testmylátex.tex} It works in my testing in Terminal on Mac OS X (bash shell) (I tested it with /AUCTEXINPUT{some other file with non-ascii filename} to check macros defined in the preamble of testmylátex.tex are actually used, proving the created format was indeed used). And by the way, yes you were right about mylatex.ltx \relax, then it uses .tex with no extra setting needed. Best Jean-François Le 23/05/2018 à 21:38, jfbu a écrit : Hi Keita first-off let me apologize for my numerous posts, originating from someone like myself who - does not know preview, - does not know elisp, - does not know auctex, - does not know mylatex.ltx... - ... and is going to top-post I appreciate a lot your detailed explanations, which avoid me plunging into auctex sources. I have now made some experiments which show there is a problem to solve at "mylatex.ltx" level. Consider this source \documentclass{article} \def\foo{foo} \begin{document} Checking format was used: \ttfamily\meaning\foo \end{document} ### Experiment One: 1. save above as testmylatex.tex 2. execute etex -ini \&pdflatex mylatex.ltx testmylatex.tex 3. execute pdftex -fmt=mylatex testmylatex everything should go fine, and then testmylatex.pdf will contain Checking format was used: macro:->foo ### Experiment Two 1. save above file as testmylátex.tex 2a. Try pdflatex testmylátex.tex : it works 2b. Try now: etex -ini \&pdflatex mylatex.ltx testmylátex.tex It fails with ! I can't find file `testmyl'. \global <*> &pdflatex mylatex.ltx testmylá tex.tex (Press Enter to retry, or Control-D to exit) (attention that á especially on Mac OS may be with a combining character so your mileage my vary in the error report) 3a. The format file mylatex.fmt from Experiment one sh
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Le 23/05/2018 à 21:38, jfbu a écrit : Hi Keita first-off let me apologize for my numerous posts, originating from someone like myself who - does not know preview, - does not know elisp, - does not know auctex, - does not know mylatex.ltx... - ... and is going to top-post I appreciate a lot your detailed explanations, which avoid me plunging into auctex sources. I have now made some experiments which show there is a problem to solve at "mylatex.ltx" level. Consider this source \documentclass{article} \def\foo{foo} \begin{document} Checking format was used: \ttfamily\meaning\foo \end{document} ### Experiment One: 1. save above as testmylatex.tex 2. execute etex -ini \&pdflatex mylatex.ltx testmylatex.tex 3. execute pdftex -fmt=mylatex testmylatex everything should go fine, and then testmylatex.pdf will contain Checking format was used: macro:->foo Arrgh, ok this says nothing the idea would have been to execute pdftex -fmt=mylatex testmylatex2 with file testmylatex2.tex with an empty preamble anyway, that's not important for the other things I blatter about Sorry... J.-F. ### Experiment Two 1. save above file as testmylátex.tex 2a. Try pdflatex testmylátex.tex : it works 2b. Try now: etex -ini \&pdflatex mylatex.ltx testmylátex.tex It fails with ! I can't find file `testmyl'. \global <*> &pdflatex mylatex.ltx testmylá tex.tex (Press Enter to retry, or Control-D to exit) (attention that á especially on Mac OS may be with a combining character so your mileage my vary in the error report) 3a. The format file mylatex.fmt from Experiment one should still be there so we try pdflatex -fmt=mylatex testmylátex.tex (recall that pdflatex testmylátex.tex worked out of the box) It fails with ! I can't find file `testmyl'. \unhbox <*> testmylá tex.tex (Press Enter to retry, or Control-D to exit) Now try pdflatex -fmt=mylatex "\input{\detokenize{testmylátex.tex}}" It fails with the kind of error message you reported $ pdflatex -fmt=mylatex "\input{\detokenize{testmylátex.tex}}" This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=mylatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls 2014/09/29 v1.4h Standard LaTeX document class size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> \ input{\detokenize{testmylátex.tex}} ? All of the above problems are with "mylatex.ltx". I think creating a file and using `\input` form might help The doc says %%% If you are on a Mac or using some shell that makes it inconvenient %%% to use a command line such as the above examples then you may %%% make a file `mylatex.tex' with the single line %%% \input mylatex.ltx abc %%% and then pass the file mylatex.tex to your (ini)tex shell to produce %%% the format, ie something equivalent to initex &latex mylatex.tex. and perhaps this can be used to solve our problems. I can't work immediately on this but will later, (or David Carlisle will show up and explain what to do) Best, Jean-François Le 23/05/2018 à 20:12, Ikumi Keita a écrit : Hi Jean, jfbu writes: no bothering at all! Perhaps I should give up this particular case (non-ascii file name + preview-latex preamble cache) and commit the patch which fixes other issues. surely not! Thank you! What would helped me is to see the exact content of an ini file. It is designed to be deleted automatically after the format file dump, so I modified `preview-cache-preamble' temporarily not to delete it. The content thus obtained is: \ifx\pdfoutput\undefined\else\let\PREVIEWdump\dump\def\dump{% \edef\next{{\catcode`\ 9 \pdfoutput=\the\pdfoutput\relax\the\everyjob}}\everyjob\next\catcode`\ 10 \let\dump\PREVIEWdump\dump}\fi\input mylatex.ltx \relax Then it is intriguing that the comment says "mylatex.ltx expects a file name to follow. Bad." and refers to empty file ".tex" but I see mylatex.ltx \relax not mylatex.ltx .tex ?? I don't know well, but the log at the dumping says (/usr/local/texlive/2018/texmf-dist/tex/latex/carlisle/mylatex.ltx) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)) so I think it really reads ".tex". about this ".tex" it was missing from TeXLive for a while due to a LaTeX packaging error but is since fixed https://github.com/latex3/latex2e/issues/30 Yes, I had updated with tlmgr and restored ".tex" already. It might take some time until I can say something about preview's mechanism, as I am not even that familiar to its usage. I hope David can kick in, that would be so much faster. I hope so as well. I anticipate the role of the format is to catch up s
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Keita first-off let me apologize for my numerous posts, originating from someone like myself who - does not know preview, - does not know elisp, - does not know auctex, - does not know mylatex.ltx... - ... and is going to top-post I appreciate a lot your detailed explanations, which avoid me plunging into auctex sources. I have now made some experiments which show there is a problem to solve at "mylatex.ltx" level. Consider this source \documentclass{article} \def\foo{foo} \begin{document} Checking format was used: \ttfamily\meaning\foo \end{document} ### Experiment One: 1. save above as testmylatex.tex 2. execute etex -ini \&pdflatex mylatex.ltx testmylatex.tex 3. execute pdftex -fmt=mylatex testmylatex everything should go fine, and then testmylatex.pdf will contain Checking format was used: macro:->foo ### Experiment Two 1. save above file as testmylátex.tex 2a. Try pdflatex testmylátex.tex : it works 2b. Try now: etex -ini \&pdflatex mylatex.ltx testmylátex.tex It fails with ! I can't find file `testmyl'. \global <*> &pdflatex mylatex.ltx testmylá tex.tex (Press Enter to retry, or Control-D to exit) (attention that á especially on Mac OS may be with a combining character so your mileage my vary in the error report) 3a. The format file mylatex.fmt from Experiment one should still be there so we try pdflatex -fmt=mylatex testmylátex.tex (recall that pdflatex testmylátex.tex worked out of the box) It fails with ! I can't find file `testmyl'. \unhbox <*> testmylá tex.tex (Press Enter to retry, or Control-D to exit) Now try pdflatex -fmt=mylatex "\input{\detokenize{testmylátex.tex}}" It fails with the kind of error message you reported $ pdflatex -fmt=mylatex "\input{\detokenize{testmylátex.tex}}" This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=mylatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls2014/09/29 v1.4h Standard LaTeX document class size10.clo2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> \ input{\detokenize{testmylátex.tex}} ? All of the above problems are with "mylatex.ltx". I think creating a file and using `\input` form might help The doc says %%% If you are on a Mac or using some shell that makes it inconvenient %%% to use a command line such as the above examples then you may %%% make a file `mylatex.tex' with the single line %%% \input mylatex.ltx abc %%% and then pass the file mylatex.tex to your (ini)tex shell to produce %%% the format, ie something equivalent to initex &latex mylatex.tex. and perhaps this can be used to solve our problems. I can't work immediately on this but will later, (or David Carlisle will show up and explain what to do) Best, Jean-François Le 23/05/2018 à 20:12, Ikumi Keita a écrit : Hi Jean, jfbu writes: no bothering at all! Perhaps I should give up this particular case (non-ascii file name + preview-latex preamble cache) and commit the patch which fixes other issues. surely not! Thank you! What would helped me is to see the exact content of an ini file. It is designed to be deleted automatically after the format file dump, so I modified `preview-cache-preamble' temporarily not to delete it. The content thus obtained is: \ifx\pdfoutput\undefined\else\let\PREVIEWdump\dump\def\dump{% \edef\next{{\catcode`\ 9 \pdfoutput=\the\pdfoutput\relax\the\everyjob}}\everyjob\next\catcode`\ 10 \let\dump\PREVIEWdump\dump}\fi\input mylatex.ltx \relax Then it is intriguing that the comment says "mylatex.ltx expects a file name to follow. Bad." and refers to empty file ".tex" but I see mylatex.ltx \relax not mylatex.ltx .tex ?? I don't know well, but the log at the dumping says (/usr/local/texlive/2018/texmf-dist/tex/latex/carlisle/mylatex.ltx) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)) so I think it really reads ".tex". about this ".tex" it was missing from TeXLive for a while due to a LaTeX packaging error but is since fixed https://github.com/latex3/latex2e/issues/30 Yes, I had updated with tlmgr and restored ".tex" already. It might take some time until I can say something about preview's mechanism, as I am not even that familiar to its usage. I hope David can kick in, that would be so much faster. I hope so as well. I anticipate the role of the format is to catch up some common preamble, These two paragraphs are quotes from preview-latex.info: -- 'C-c C-p C-f' 'preview-cache-preamble' Preview/Turn preamble cache on Dump a pregenerated format file. For the rest of the session, this
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Jean, > jfbu writes: > no bothering at all! >> Perhaps I should give up this particular case (non-ascii file name + >> preview-latex preamble cache) and commit the patch which fixes other >> issues. > surely not! Thank you! > What would helped me is to see the exact content of an ini file. It is designed to be deleted automatically after the format file dump, so I modified `preview-cache-preamble' temporarily not to delete it. The content thus obtained is: \ifx\pdfoutput\undefined\else\let\PREVIEWdump\dump\def\dump{% \edef\next{{\catcode`\ 9 \pdfoutput=\the\pdfoutput\relax\the\everyjob}}\everyjob\next\catcode`\ 10 \let\dump\PREVIEWdump\dump}\fi\input mylatex.ltx \relax > Then it is intriguing that the comment says > "mylatex.ltx expects a file name to follow. Bad." > and refers to empty file ".tex" but I see mylatex.ltx \relax not mylatex.ltx > .tex ?? I don't know well, but the log at the dumping says (/usr/local/texlive/2018/texmf-dist/tex/latex/carlisle/mylatex.ltx) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)) so I think it really reads ".tex". > > about this ".tex" it was missing from TeXLive for a while due to a LaTeX > packaging > error but is since fixed > https://github.com/latex3/latex2e/issues/30 > Yes, I had updated with tlmgr and restored ".tex" already. > It might take some time until I can say something about preview's > mechanism, as I am not even that familiar to its usage. I hope > David can kick in, that would be so much faster. I hope so as well. > I anticipate the role of the format is to catch up some common preamble, These two paragraphs are quotes from preview-latex.info: -- 'C-c C-p C-f' 'preview-cache-preamble' Preview/Turn preamble cache on Dump a pregenerated format file. For the rest of the session, this file is used when running on the same master file. Use this if you know your LaTeX takes a long time to start up, the speedup will be most noticeable when generating single or few previews. If you change your preamble, do this again. preview-latex will try to detect the necessity of that automatically when editing changes to the preamble are done from within Emacs, but it will not notice if the preamble effectively changes because some included file or style file is tampered with. -- * Automatically cache preambles Currently preview-latex asks you whether you want to cache the document preamble (everything before '\begin{document}') before it generates previews for a buffer the first time. Caching the preamble will significantly speed up regeneration of previews. The larger your preamble is, the more this will be apparent. Once a preamble is cached, preview-latex will try to keep track of when it is changed, and dump a fresh format in that case. If you experience problems with this, or if you want it to happen without asking you the first time, you can customize the variable 'preview-auto-cache-preamble'. -- I hope these help. > and the file primárias.tex should not be used here. I think the basic idea is to "embed" the particular document's preamble in the format file for efficiency, so I suppose that it is essential to input the document file (primárias.tex here). > And "\input" "\detokenize{primárias.tex}" should be either > "\expandafter\input" "\detokenize{primárias.tex}" > or > "\input" "{\detokenize{primárias.tex}}" OK, I'll change the relavant code accordingly. > PS: I am CCing to auctex-dev but it seems my messages get bounced Sorry, I misspelled the address in my previous message. The right address is "auctex-de...@gnu.org", not "auctex-dev@...". Best regards, Ikumi Keita ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Ah, I understand better some errors reported by Keita : Le 23/05/2018 à 15:39, Ikumi Keita a écrit : (1) Add prv_primárias.ini argument to creat .fmt file. etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" prv_primárias.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{primárias.tex}" -> No error pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" -> error -- This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls2014/09/29 v1.4h Standard LaTeX document class size10.clo2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> &prv_primárias \ input{ \detokenize{ primárias.tex } } ! Emergency stop. <*> ...ias \input{ \detokenize{ primárias.tex } } ! ==> Fatal error occurred, no output PDF file produced! Transcript written on .log. -- It appears that mylatex.ltx is at work here. Here is a copy of its comments % While the preamble is being skipped, the EOL is active % and defined to grab each line and inspect it looking % for \begin{document} or mylatex lines. Now I see also that it makes the backslash \ active. From extra look in latex.ltx EOL (^^M) is looking for an argument delimite by itself ^^M but it never finds here the second ^^M. Also latex.ltx contains various incantations and the \catcode`\ 9 thing is one of them. I need to get a hold of what prv_primárias.ini looks like! So I guess I have to go into auctex el files... Best, Jean-François ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi again Keita Le 23/05/2018 à 15:39, Ikumi Keita a écrit : Hi Jean, [...] The literally same commands succeed here as well on xterm. However, after modifying seemingly to coordinate the actual preview-latex commands, the latter fails. (1) Add prv_primárias.ini argument to creat .fmt file. etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" prv_primárias.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{primárias.tex}" -> No error Any etex -ini must be ended by \dump command. It it is in prv_primárias.ini then what follows will be ignored. I anticipate the role of the format is to catch up some common preamble, andthe file primárias.tex should not be used here. And "\input" "\detokenize{primárias.tex}" should be either "\expandafter\input" "\detokenize{primárias.tex}" or "\input" "{\detokenize{primárias.tex}}" But this is probably not at all relevant to the format thing. PS: I am CCing to auctex-dev but it seems my messages get bounced So this time I tried with replacing the mailing list with the gmane newsgroup Best, Jean-François ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Keita, Le 23/05/2018 à 15:39, Ikumi Keita a écrit : Hi Jean, jfbu writes: It is not easy for me to try out any patch to official AUCTeX (does it have a github repo?) It has savannah git repository: https://git.savannah.gnu.org/cgit/auctex.git Unfortunately, it doesn't on github. I gave it a try with a creating a format like this etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}\dump" (CAVEAT: for reasons explained above I do not look into AUCTeX ELisp files, I just started from things in Keita's message and malaxed until I could execute on commande line) Then I executed manually this line (which I copied from the continuation of your message) pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" and it compiled seemingly successfully $ pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex) The literally same commands succeed here as well on xterm. However, after modifying seemingly to coordinate the actual preview-latex commands, the latter fails. (1) Add prv_primárias.ini argument to creat .fmt file. etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" prv_primárias.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{primárias.tex}" -> No error pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" -> error -- This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls2014/09/29 v1.4h Standard LaTeX document class size10.clo2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> &prv_primárias \ input{ \detokenize{ primárias.tex } } ! Emergency stop. <*> ...ias \input{ \detokenize{ primárias.tex } } ! ==> Fatal error occurred, no output PDF file produced! Transcript written on .log. -- (2) Add \dump furthermore. etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" prv_primárias.ini "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}\dump" "\input" "\detokenize{primárias.tex}" -> No error pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" -> No error, but doesn't do its expected job -- 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 (./primárias.tex (/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29v1.4h StandardLaTeXdocumentclass (/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) ) (\dump is performed only by INITEX) No pages of output. Transcript written on primárias.log. -- I will be busy for today, I'm sorry to have bothered you many times. I deeply appreciate your kindness so far! no bothering at all! Perhaps I should give up this particular case (non-ascii file name + preview-latex preamble cache) and commit the patch which fixes other issues. surely not! What would helped me is to see the exact content of an ini file. From another message of yours I have this -- , which can be obtained by C-c C-p C-f. The init file prv_primárias.ini is prepared by preview-latex by the following elisp code in `preview-cache-preamble': -- ;; mylatex.ltx expects a file name to follow. Bad. `.tex' ;; in the tools bundle is an empty file. (write-region "\\ifx\\pdfoutput\\undefined\\else\ \\let\\PREVIEWdump\\dump\\def\\dump{% \\edef\\next{{\\catcode`\\ 9 \\
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Jean, > jfbu writes: > It is not easy for me to try out any patch to official AUCTeX > (does it have a github repo?) It has savannah git repository: https://git.savannah.gnu.org/cgit/auctex.git Unfortunately, it doesn't on github. > I gave it a try with a creating a format like this > etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" > "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}\dump" > (CAVEAT: for reasons explained above I do not look into AUCTeX ELisp files, > I just started from things in Keita's message and malaxed until I could > execute on commande line) > Then I executed manually this line (which I copied from the continuation of > your message) > pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" > prim\árias.tex "}" "}" > and it compiled seemingly successfully > $ pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" > prim\árias.tex "}" "}" > This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded > format=pdflatex) The literally same commands succeed here as well on xterm. However, after modifying seemingly to coordinate the actual preview-latex commands, the latter fails. (1) Add prv_primárias.ini argument to creat .fmt file. etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" prv_primárias.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{primárias.tex}" -> No error pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" -> error -- This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls2014/09/29 v1.4h Standard LaTeX document class size10.clo2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> &prv_primárias \ input{ \detokenize{ primárias.tex } } ! Emergency stop. <*> ...ias \input{ \detokenize{ primárias.tex } } ! ==> Fatal error occurred, no output PDF file produced! Transcript written on .log. -- (2) Add \dump furthermore. etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" prv_primárias.ini "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}\dump" "\input" "\detokenize{primárias.tex}" -> No error pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" -> No error, but doesn't do its expected job -- 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 (./primárias.tex (/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29v1.4h StandardLaTeXdocumentclass (/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) ) (\dump is performed only by INITEX) No pages of output. Transcript written on primárias.log. -- > I will be busy for today, I'm sorry to have bothered you many times. I deeply appreciate your kindness so far! Perhaps I should give up this particular case (non-ascii file name + preview-latex preamble cache) and commit the patch which fixes other issues. Best regards, Ikumi Keita ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Ikumi I had not read your initial message closely enough. Le 23/05/2018 à 13:34, Ikumi Keita a écrit : > Thank you very much, Jean, > >> jfbu writes: >>> >>> On emacs invoked on UTF-8 locale, when I open the test file and type C-c >>> C-p C-d, answering with y to "Cache preamble?", pdflatex succeeds to >>> dump prv_primárias.fmt. However, the run of pdflatex to generate actual >>> image which follows that dump fails with TeXLive 2018 like this: >>> -- >>> Running `Preview-LaTeX' on `primárias' with ``pdflatex >>> -interaction=nonstopmode \&prv_prim\árias prim\árias.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 `prim'. >>> >>> \unhbox >>> <*> &prv_primárias primá >>> rias.tex >>> (Press Enter to retry, or Control-D to exit) >>> Please type another input file name >>> ! Emergency stop. >>> >>> \unhbox >>> <*> &prv_primárias primá >>> rias.tex >>> ! ==> Fatal error occurred, no output PDF file produced! >>> Transcript written on texput.log. >>> >>> TeX Output exited as expected with code 1 at Wed May 23 18:36:15 >>> LaTeX: LaTeX found no preview images >>> -- > >> Can you please configure AUCTeX to issue this instead (I hope my mailer does >> not add linebreaks) > >> pdflatex -file-line-error >> "\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{prim\árias.tex}} > >> indeed LaTeX's \input checks if there is an opening brace, if not it uses >> TeX's form of \input and the \detokenize is no good. Alternative > >> pdflatex -file-line-error >> "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" >> "\expandafter\input" \\detokenize{prim\árias.tex} > >> Hope it helps, > > Unfortunately, it didn't work. What happened is that I did something like C-cC-pC-d at my locale, there was an error, I recovered (no idea how) the command line invocation which had failed and ended up with the slight modification above (which later I modified again in my numerous follow-ups) which works at my locale on commande line. But it has nothing to do with using a custom format, so here we see I had not read your message at all but only copied pasted the MWE. Besides I am not using dev repo of AUCTeX but stock installation (updated some weeks ago if I recall well). My TeX-command-list diverged long time ago from official one and this may interfere too. It is not easy for me to try out any patch to official AUCTeX (does it have a github repo?) I gave it a try with a creating a format like this etex -ini -interaction=nonstopmode -jobname prv_prim\árias "&pdflatex" "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}\dump" (CAVEAT: for reasons explained above I do not look into AUCTeX ELisp files, I just started from things in Keita's message and malaxed until I could execute on commande line) Then I executed manually this line (which I copied from the continuation of your message) pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" and it compiled seemingly successfully $ pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}" 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 (./primárias.tex (/path/to/texlive/2018/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/path/to/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) No file primárias.aux. (/path/to/texlive/2018/texmf-dist/tex/latex/preview/preview.sty (/path/to/texlive/2018/texmf-dist/tex/generic/luatex85/luatex85.sty ) (/path/to/texlive/2018/texmf-dist/tex/latex/preview/prtightpage.def ) (/path/to/texlive/2018/texmf-dist/tex/latex/preview/prauctex.def No auxiliary output files. (/path/to/texlive/2018/texmf-dist/tex/latex/preview/prauctex.cfg)) (/path/to/texlive/2018/texmf-dist/tex/latex/preview/prfootnotes.def ) Preview: Fontsize 10pt Preview: PDFoutput 1 ) ! Preview: Snippet 1 started. <-><-> l.5 \( abc\) Preview: Tightpage -32891 -32891 32891 32891 ! Preview: Snippet 1 ended.(455111+0x911285). <-><-> l.5 \(abc\) [1{/path/to/texlive/2018/t
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
> jfbu writes: > If filename is containing # or ~ it must have them like \string# and \string~ > in the above > (I made a brief test with file primárias~.tex and the above with > \input{primárias\string~.tex} worked on command line) Thanks, I think we don't have to care about "#" and "~" in the file name on the command line. The code in AUCTeX has not taken care of those characters on the command line long since, and such file names has not been processed right even before TL 2018. I don't know why `TeX-quote-filename' pays special attention to "#" and "~" whereas no special treatment is done on "#" and "~" in the file name on the command line and doubt the necessity of such treatment, but I tried to keep compatibility with the current code since I was not 100% sure. Regards, Ikumi Keita ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Thank you very much, Jean, > jfbu writes: >> >> On emacs invoked on UTF-8 locale, when I open the test file and type C-c >> C-p C-d, answering with y to "Cache preamble?", pdflatex succeeds to >> dump prv_primárias.fmt. However, the run of pdflatex to generate actual >> image which follows that dump fails with TeXLive 2018 like this: >> -- >> Running `Preview-LaTeX' on `primárias' with ``pdflatex >> -interaction=nonstopmode \&prv_prim\árias prim\árias.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 `prim'. >> >> \unhbox >> <*> &prv_primárias primá >> rias.tex >> (Press Enter to retry, or Control-D to exit) >> Please type another input file name >> ! Emergency stop. >> >> \unhbox >> <*> &prv_primárias primá >> rias.tex >> ! ==> Fatal error occurred, no output PDF file produced! >> Transcript written on texput.log. >> >> TeX Output exited as expected with code 1 at Wed May 23 18:36:15 >> LaTeX: LaTeX found no preview images >> -- > Can you please configure AUCTeX to issue this instead (I hope my mailer does > not add linebreaks) > pdflatex -file-line-error > "\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{prim\árias.tex}} > indeed LaTeX's \input checks if there is an opening brace, if not it uses > TeX's form of \input and the \detokenize is no good. Alternative > pdflatex -file-line-error > "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" > "\expandafter\input" \\detokenize{prim\árias.tex} > Hope it helps, Unfortunately, it didn't work. -- Running `Preview-LaTeX' on `primárias' with ``pdflatex -interaction=nonstopmode \&prv_prim\árias "\input{" "\detokenize{" prim\árias.tex "}" "}"'' This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls2014/09/29 v1.4h Standard LaTeX document class size10.clo2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> &prv_primárias \ input{ \detokenize{ primárias.tex } } ! Emergency stop. <*> ...ias \input{ \detokenize{ primárias.tex } } ! ==> Fatal error occurred, no output PDF file produced! Transcript written on .log. TeX Output exited as expected with code 1 at Wed May 23 20:06:31 LaTeX: LaTeX found no preview images -- Unlike the case preamble cache is disabled, the current case does not use the complex stuff of "\nonstopmode\nofiles\PassOptionsToPackage{...}{preview}\AtBeginDocument{...}" at the pdflatex run generating the actual image. It runs in a simple form: pdflatex -interaction=nonstopmode &prv_primárias FILENAME The complex stuff has been used already when dumping the customized format prv_primárias.fmt and, I guess, embedded in that format file. The output when preview-latex dumps the customized format is: -- Running `Preview-LaTeX' on `primárias' with ``pdflatex -ini -interaction=nonstopmode "&pdflatex" prv_prim\árias.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{" prim\árias.tex "}"'' This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (INITEX) restricted \write18 enabled. entering extended mode (./prv_primárias.ini LaTeX2e <2018-04-01> patch level 4 (/usr/local/texlive/2018/texmf-dist/tex/latex/carlisle/mylatex.ltx) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)) No auxiliary output files. (./primárias.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)) ) Beginning to dump on file prv_primárias.fmt (preloaded format=prv_primárias 2018.5.23) 7584 strings of total length 123267 58322 memory locations dumped; c
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
You can replace \begingroup by { and \endgroup by } pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "{\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{primárias.tex}}\expandafter}\x" and to be compatible with non-etex as I see an \ifx\undefined test is used also before, so let's do same pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "{\ifx\UseRawInputEncoding\undefined\else\UseRawInputEncoding\fi\edef\x{\noexpand\input{primárias.tex}}\expandafter}\x" If filename is containing # or ~ it must have them like \string# and \string~ in the above (I made a brief test with file primárias~.tex and the above with \input{primárias\string~.tex} worked on command line) Sorry for not having posted this initially Jean-François ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Le 23/05/2018 à 12:46, jfbu a écrit : Le 23/05/2018 à 12:33, jfbu a écrit : Hi Keita Can you please configure AUCTeX to issue this instead (I hope my mailer does not add linebreaks) pdflatex -file-line-error "\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{prim\árias.tex}} indeed LaTeX's \input checks if there is an opening brace, if not it uses TeX's form of \input and the \detokenize is no good. Alternative pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "\expandafter\input" \\detokenize{prim\árias.tex} The alternative (as you mentioned earlier \detokenize doesn't play well with \string# or with naked #, in the style of my previous post jfbu writes: Perhaps you can use this mouthful pdflatex -file-line-error -interaction=nonstopmode "\begingroup\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{\string#éàè\string~\string#.tex}}\expandafter\endgroup\x" would be pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "\begingroup\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{primárias.tex}}\expandafter\endgroup\x" You can replace \begingroup by { and \endgroup by } pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "{\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{primárias.tex}}\expandafter}\x" Jean-François where the filename if containing # or ~ must have them escaped as \string# and \string~ I don't know what is proper quoting on Windows, but here on bash the á withing ".." must not be shell-escaped. The above works at my locale. It is the most powerful method because it can handle filenames with # and ~. Best Jean-François ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Le 23/05/2018 à 12:33, jfbu a écrit : Hi Keita Can you please configure AUCTeX to issue this instead (I hope my mailer does not add linebreaks) pdflatex -file-line-error "\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{prim\árias.tex}} indeed LaTeX's \input checks if there is an opening brace, if not it uses TeX's form of \input and the \detokenize is no good. Alternative pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "\expandafter\input" \\detokenize{prim\árias.tex} The alternative (as you mentioned earlier \detokenize doesn't play well with \string# or with naked #, in the style of my previous post jfbu writes: Perhaps you can use this mouthful pdflatex -file-line-error -interaction=nonstopmode "\begingroup\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{\string#éàè\string~\string#.tex}}\expandafter\endgroup\x" would be pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "\begingroup\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{primárias.tex}}\expandafter\endgroup\x" where the filename if containing # or ~ must have them escaped as \string# and \string~ I don't know what is proper quoting on Windows, but here on bash the á withing ".." must not be shell-escaped. The above works at my locale. It is the most powerful method because it can handle filenames with # and ~. Best Jean-François ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Keita Le 23/05/2018 à 12:03, Ikumi Keita a écrit : Hi Jean and all, I could sort out most of the problem by a new approach attached with this message, but am having difficulty with enabling preamble cache on preview-latex when the document has non-ascii file name. Could you help me get out of this trouble if possible? I'm using a test file primárias.tex (mimicking example of https://tex.stackexchange.com/questions/429869/emacs-auctex-tl-2018-problems-with-non-ascii-characters-in-the-file-name) with a math formula to test preview-latex functionality: \documentclass{article} \begin{document} \(abc\) \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: On emacs invoked on UTF-8 locale, when I open the test file and type C-c C-p C-d, answering with y to "Cache preamble?", pdflatex succeeds to dump prv_primárias.fmt. However, the run of pdflatex to generate actual image which follows that dump fails with TeXLive 2018 like this: -- Running `Preview-LaTeX' on `primárias' with ``pdflatex -interaction=nonstopmode \&prv_prim\árias prim\árias.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 `prim'. \unhbox <*> &prv_primárias primá rias.tex (Press Enter to retry, or Control-D to exit) Please type another input file name ! Emergency stop. \unhbox <*> &prv_primárias primá rias.tex ! ==> Fatal error occurred, no output PDF file produced! Transcript written on texput.log. TeX Output exited as expected with code 1 at Wed May 23 18:36:15 LaTeX: LaTeX found no preview images -- It doesn't help to change the command to pdflatex \&prv_prim\árias \\input \\detokenize\{prim\árias.tex} on xterm. Pdflatex says: -- This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls2014/09/29 v1.4h Standard LaTeX document class size10.clo2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> &prv_primárias \ input \detokenize{primárias.tex} ! Emergency stop. <*> ...imárias \input \detokenize{primárias.tex} ! ==> Fatal error occurred, no output PDF file produced! Transcript written on .log. -- With TL2017, preview-latex works as expected even with my new patch. Jean, do you have any idea, such as "magic spell" in the message below you wrote previously? I have vague impression that \UseRawInputEncoding can solve this problem, but I have no experience of TeX programming and could not arrage the given TeX codes so that prv_primárias.fmt accepts the file name primárias.tex. Can you please configure AUCTeX to issue this instead (I hope my mailer does not add linebreaks) pdflatex -file-line-error "\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{prim\árias.tex}} indeed LaTeX's \input checks if there is an opening brace, if not it uses TeX's form of \input and the \detokenize is no good. Alternative pdflatex -file-line-error "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "\expandafter\input" \\detokenize{prim\árias.tex} Hope it helps, Best Jean-François jfbu writes: Perhaps you can use this mouthful pdflatex -file-line-error -interaction=nonstopmode "\begingroup\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{\string#éàè\string~\string#.tex}}\expandafter\endgroup\x" It works to compile file with name #éàè~#.tex, the file containing itself UTF-8 characters in its contents and is not doing \usepackage[utf8]{inputenc} to check it does work nevertheless in PDF output (it would not if action of \UseRawInputEncoding wasn't scoped) Sincerly, Ikumi Keita ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mai
Re: [AUCTeX] files with non-ascii characters and LaTeX as in TeXLive 2018
Hi Jean and all, I could sort out most of the problem by a new approach attached with this message, but am having difficulty with enabling preamble cache on preview-latex when the document has non-ascii file name. Could you help me get out of this trouble if possible? I'm using a test file primárias.tex (mimicking example of https://tex.stackexchange.com/questions/429869/emacs-auctex-tl-2018-problems-with-non-ascii-characters-in-the-file-name) with a math formula to test preview-latex functionality: \documentclass{article} \begin{document} \(abc\) \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: On emacs invoked on UTF-8 locale, when I open the test file and type C-c C-p C-d, answering with y to "Cache preamble?", pdflatex succeeds to dump prv_primárias.fmt. However, the run of pdflatex to generate actual image which follows that dump fails with TeXLive 2018 like this: -- Running `Preview-LaTeX' on `primárias' with ``pdflatex -interaction=nonstopmode \&prv_prim\árias prim\árias.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 `prim'. \unhbox <*> &prv_primárias primá rias.tex (Press Enter to retry, or Control-D to exit) Please type another input file name ! Emergency stop. \unhbox <*> &prv_primárias primá rias.tex ! ==> Fatal error occurred, no output PDF file produced! Transcript written on texput.log. TeX Output exited as expected with code 1 at Wed May 23 18:36:15 LaTeX: LaTeX found no preview images -- It doesn't help to change the command to pdflatex \&prv_prim\árias \\input \\detokenize\{prim\árias.tex} on xterm. Pdflatex says: -- This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex LaTeX2e <2018-04-01> patch level 4 CUSTOMISED FORMAT. Preloaded files: . article.cls2014/09/29 v1.4h Standard LaTeX document class size10.clo2014/09/29 v1.4h Standard LaTeX file (size option) . ) Runaway argument? ! File ended while scanning use of ^^M. \par <*> &prv_primárias \ input \detokenize{primárias.tex} ! Emergency stop. <*> ...imárias \input \detokenize{primárias.tex} ! ==> Fatal error occurred, no output PDF file produced! Transcript written on .log. -- With TL2017, preview-latex works as expected even with my new patch. Jean, do you have any idea, such as "magic spell" in the message below you wrote previously? I have vague impression that \UseRawInputEncoding can solve this problem, but I have no experience of TeX programming and could not arrage the given TeX codes so that prv_primárias.fmt accepts the file name primárias.tex. > jfbu writes: > Perhaps you can use this mouthful > pdflatex -file-line-error -interaction=nonstopmode > "\begingroup\ifdefined\UseRawInputEncoding\UseRawInputEncoding\fi\edef\x{\noexpand\input{\string#éàè\string~\string#.tex}}\expandafter\endgroup\x" > It works to compile file with name #éàè~#.tex, the file containing itself > UTF-8 characters in its contents and is not doing \usepackage[utf8]{inputenc} > to check it does work nevertheless in PDF output (it would not if action of > \UseRawInputEncoding wasn't scoped) Sincerly, Ikumi Keita tentative-patch.gz Description: new approach ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex