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

2018-05-24 Thread jfbu

Hi again (!!!)

better approach using the format with & syntax at bottom


Le 24/05/2018 à 11:52, jfbu a écrit :

Hi Keita

ARRGH filenames with multiple contiguous spaces are a challenge

Because TeX coalesces multiples spaces into a single one.

The ini file can be modified simply but it is more complicated
for the generation of the format itself.

See at bottom of post.

Le 24/05/2018 à 10:46, jfbu a écrit :

Hi Keita

Le 24/05/2018 à 09:24, Ikumi Keita a écrit :

Hi Jean,


Ikumi Keita  writes:

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.


Unfortunately, it seems that the proposed method using /AUCTEXINPUT does
not work with file name with space.  The sample I'm using is a file named
"ppp qqq.tex" with the content:




Yes, I had a bad night tormented about this. But I understand why
and will explain below.




--- ppp qqq.tex --
\documentclass{article}
\begin{document}
Hello, World
\(xyz\)
\end{document}

%%% Local Variables:
%%% TeX-master: t
%%% End:
--

The format file is generated successfully:
--
Running `Preview-LaTeX' on `ppp qqq' with ``pdflatex -ini -interaction=nonstopmode "&pdflatex" prv_ppp_qqq.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{" \"ppp\ qqq.tex\" "}}"''
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (INITEX)
  restricted \write18 enabled.
entering extended mode
(./prv_ppp_qqq.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.

(./ppp qqq.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_ppp_qqq.fmt
  (preloaded format=prv_ppp_qqq 2018.5.24)
7585 strings of total length 123256
58367 memory locations dumped; current usage is 219&56905
4191 multiletter control sequences
\font\nullfont=nullfont
\font\OMX/cmex/m/n/5=cmex10
[...]
\font\OT1/cmss/m/n/10=cmss10
5716 words of font info for 21 preloaded fonts
1141 hyphenation exceptions
Hyphenation trie of length 370691 has 8997 ops out of 35111
   143 for language 83
   110 for language 82
[...]
   181 for language 0
0 words of pdfTeX memory
0 indirect objects
No pages of output.
Transcript written on prv_ppp_qqq.log.

TeX Output finished at Thu May 24 16:09:49
--

However, the next run with the dumped format doesn't make its way:



Because spaces are ignored in the filename, due to \input form (indirectly via 
/AUCTEXINPUT)

I will explain below.


--
Running `Preview-LaTeX' on `ppp qqq' with ``pdflatex -interaction=nonstopmode 
\&prv_ppp_qqq /AUCTEXINPUT{\"ppp\ qqq.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
CUSTOMISED FORMAT. Preloaded files:
 .
   "ppp qqq.tex"
  article.cls    2014/09/29 v1.4h Standard LaTeX document class
   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 .

! LaTeX Error: File `"pppqqq.tex"' not found.

Type X to quit or  to proceed,
or enter new name. (Default extension: tex")

Enter file name:
! Emergency stop.

<*> &prv_ppp_qqq /AUCTEXINPUT{"ppp qqq.tex"}
 ^^M
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.

TeX Output exited as expected with code 1 at Thu May 24 16:11:23
LaTeX: LaTeX found no preview images
--

When I replace \&prv_ppp_qqq with -fmt="prv_ppp_qqq.fmt" from xterm, the
error changes slightly:


That's a bit unexpected (by me).


--
[bash]$ pdflatex -interaction=nonstopmode -fmt="prv_ppp_qqq.fmt" /AUCTEXINPUT{\"ppp\ 
qqq.tex\"}
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded 
format=prv_ppp_qqq.fmt)
  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:
 .
   "ppp qqq.tex"
  article.cls    2014/09/29 v1.4h Standard LaTeX document class
   size10.clo    2014/09/2

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

2018-05-24 Thread jfbu

Hi Keita

ARRGH filenames with multiple contiguous spaces are a challenge

Because TeX coalesces multiples spaces into a single one.

The ini file can be modified simply but it is more complicated
for the generation of the format itself.

See at bottom of post.

Le 24/05/2018 à 10:46, jfbu a écrit :

Hi Keita

Le 24/05/2018 à 09:24, Ikumi Keita a écrit :

Hi Jean,


Ikumi Keita  writes:

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.


Unfortunately, it seems that the proposed method using /AUCTEXINPUT does
not work with file name with space.  The sample I'm using is a file named
"ppp qqq.tex" with the content:




Yes, I had a bad night tormented about this. But I understand why
and will explain below.




--- ppp qqq.tex --
\documentclass{article}
\begin{document}
Hello, World
\(xyz\)
\end{document}

%%% Local Variables:
%%% TeX-master: t
%%% End:
--

The format file is generated successfully:
--
Running `Preview-LaTeX' on `ppp qqq' with ``pdflatex -ini -interaction=nonstopmode "&pdflatex" prv_ppp_qqq.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{" \"ppp\ qqq.tex\" "}}"''
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (INITEX)
  restricted \write18 enabled.
entering extended mode
(./prv_ppp_qqq.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.

(./ppp qqq.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_ppp_qqq.fmt
  (preloaded format=prv_ppp_qqq 2018.5.24)
7585 strings of total length 123256
58367 memory locations dumped; current usage is 219&56905
4191 multiletter control sequences
\font\nullfont=nullfont
\font\OMX/cmex/m/n/5=cmex10
[...]
\font\OT1/cmss/m/n/10=cmss10
5716 words of font info for 21 preloaded fonts
1141 hyphenation exceptions
Hyphenation trie of length 370691 has 8997 ops out of 35111
   143 for language 83
   110 for language 82
[...]
   181 for language 0
0 words of pdfTeX memory
0 indirect objects
No pages of output.
Transcript written on prv_ppp_qqq.log.

TeX Output finished at Thu May 24 16:09:49
--

However, the next run with the dumped format doesn't make its way:



Because spaces are ignored in the filename, due to \input form (indirectly via 
/AUCTEXINPUT)

I will explain below.


--
Running `Preview-LaTeX' on `ppp qqq' with ``pdflatex -interaction=nonstopmode 
\&prv_ppp_qqq /AUCTEXINPUT{\"ppp\ qqq.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
CUSTOMISED FORMAT. Preloaded files:
 .
   "ppp qqq.tex"
  article.cls    2014/09/29 v1.4h Standard LaTeX document class
   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 .

! LaTeX Error: File `"pppqqq.tex"' not found.

Type X to quit or  to proceed,
or enter new name. (Default extension: tex")

Enter file name:
! Emergency stop.

<*> &prv_ppp_qqq /AUCTEXINPUT{"ppp qqq.tex"}
 ^^M
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.

TeX Output exited as expected with code 1 at Thu May 24 16:11:23
LaTeX: LaTeX found no preview images
--

When I replace \&prv_ppp_qqq with -fmt="prv_ppp_qqq.fmt" from xterm, the
error changes slightly:


That's a bit unexpected (by me).


--
[bash]$ pdflatex -interaction=nonstopmode -fmt="prv_ppp_qqq.fmt" /AUCTEXINPUT{\"ppp\ 
qqq.tex\"}
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded 
format=prv_ppp_qqq.fmt)
  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:
 .
   "ppp qqq.tex"
  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.


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

2018-05-24 Thread jfbu

Le 24/05/2018 à 10:46, jfbu a écrit :

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/b123
but as / is not legal in filenames in contexts I know of, I did not even
test this anticipation.


actually the \detokenize will use escapechar setting so
this would give aaa\b123 with a backslash
but anyway I decided / will not possibly be part of a filename...

J.-F.

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


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

2018-05-23 Thread Ikumi Keita
> 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-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel