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

2018-05-24 Thread jfbu

Le 24/05/2018 à 20:03, jfbu a écrit :

Le 24/05/2018 à 19:39, jfbu a écrit :

Hi Keita


I have applied your patch (with diff of preview.el.in
transferred to preview.el) to my elpa installed 12.1.0

(later I
saw I had 12.1.1 on another computer and that preview.el
had changed a bit. As the elpa comes with .gitignore
which by bad luck for me has /preview.el, my initial
commit did not have the original one which I then
manually modified with your patch ---
I recovered later from the other computer the preview.el
there and re-did my commits)

(b.t.w. I also git cloned the savannah, and
https://git.savannah.gnu.org/cgit/auctex.git has a typo it should be
https://git.savannah.gnu.org/git/auctex.git
)


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

Hi Jean and all,

The proposed method, with slight modification explained below, works for
all the cases I tested.  Thank you again!
For now, I attach the patch for preview-latex part only so that the
reader can concentrate on the relavant changes.


jfbu  writes:



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


AUCTeX always runs TeX commands after changing the current directory to
that of the master file, so forward slash would never appear as an
argument of the command.  The region file is created in the same
directory as the master, thus region compilation should work as well.


I have also added quotes inside the \detokenize.


I tried removing those quotes and let the quotes added around the file
name with space to be put inside /AUCTEXINPUT like this:
pdflatex -foo -bar &prv_ppp_qqq /AUCTEXINPUT{"ppp qqq"} (without escape for 
shell)
, because it's easier to absorb the difference in the way of quoting the
shell arguments between w32 and non-w32 platforms.  Experiments showed
no problems even for files without space, so the attached patch takes
this way.  If this has any shortcomings, please tell me.



My testing so far indicates no problem on Mac OS X 10.9.5



I may have been a bit optimistic

I have problem when adding an equation and asking to generate preview at point



I was intrigued by these changes related to quotes, but it turns out
when I had tried manually on the command line that I was not quoting
correctly.

With your patch on top of 12.1.0 I successfully generate preview for a file
with both spaces and utf-8 characters.

The top of preview generation log displays starts like this;

Running `Preview-LaTeX' on `test my látéx' with ``pdflatex -interaction=nonstopmode \&prv_test_my_la\́te\́x 
"/AUCTEXINPUT{" \"test\ my\ la\́te\́x.tex\" "}"''

(the Mac OS uses a special form of Unicode for filenames with combining
characters)

I did not check the ini file because it is volatile but I think you
indicated how to modify cache-preamble to make it permanent.

Anyway, above file with contents




with this file


\documentclass{article}
\def\foo{E=mc^2}
\def\bar{x^n + y^n = z^n}
\def\foofoo{E=h\nu}
\begin{document}
\(\foo\)
\(\bar\)
\(\foofoo\)
\end{document}



when I add

\[x^3+y^3\]

and then try to generate preview "at point" I get this

```
Running `Preview-LaTeX' on `_region_' with ``pdflatex -interaction=nonstopmode 
\&prv_test_my_la\́te\́x "/AUCTEXINPUT{" _region_.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:
     .
  "test my látéx.tex"
  article.cls    2014/09/29 v1.4h Standard LaTeX document class
   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
     .
(./_region_.tex
No file _region_.aux.
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/preview.sty 
(/usr/local/texlive/2018/texmf-dist/tex/generic/luatex85/luatex85.sty) 
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prtightpage.def) 
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prauctex.def
No auxiliary output files.


(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prauctex.cfg)) 
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prfootnotes.def)
Preview: Fontsize 10pt
Preview: PDFoutput 1
)
! Undefined control sequence.
\GenericError  ...
     #4  \errhelp \@err@ ...
l.8 \message{ !name(test my lá
     téx.tex) !offset(0) }
! Undefined control sequence.
\GenericError  ...
   \let \@err@   ...
l.8 \messa

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

2018-05-24 Thread jfbu

Le 24/05/2018 à 19:39, jfbu a écrit :

Hi Keita


I have applied your patch (with diff of preview.el.in
transferred to preview.el) to my elpa installed 12.1.0

(later I
saw I had 12.1.1 on another computer and that preview.el
had changed a bit. As the elpa comes with .gitignore
which by bad luck for me has /preview.el, my initial
commit did not have the original one which I then
manually modified with your patch ---
I recovered later from the other computer the preview.el
there and re-did my commits)

(b.t.w. I also git cloned the savannah, and
https://git.savannah.gnu.org/cgit/auctex.git has a typo it should be
https://git.savannah.gnu.org/git/auctex.git
)


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

Hi Jean and all,

The proposed method, with slight modification explained below, works for
all the cases I tested.  Thank you again!
For now, I attach the patch for preview-latex part only so that the
reader can concentrate on the relavant changes.


jfbu  writes:



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


AUCTeX always runs TeX commands after changing the current directory to
that of the master file, so forward slash would never appear as an
argument of the command.  The region file is created in the same
directory as the master, thus region compilation should work as well.


I have also added quotes inside the \detokenize.


I tried removing those quotes and let the quotes added around the file
name with space to be put inside /AUCTEXINPUT like this:
pdflatex -foo -bar &prv_ppp_qqq /AUCTEXINPUT{"ppp qqq"} (without escape for 
shell)
, because it's easier to absorb the difference in the way of quoting the
shell arguments between w32 and non-w32 platforms.  Experiments showed
no problems even for files without space, so the attached patch takes
this way.  If this has any shortcomings, please tell me.



My testing so far indicates no problem on Mac OS X 10.9.5



I may have been a bit optimistic

I have problem when adding an equation and asking to generate preview at point



I was intrigued by these changes related to quotes, but it turns out
when I had tried manually on the command line that I was not quoting
correctly.

With your patch on top of 12.1.0 I successfully generate preview for a file
with both spaces and utf-8 characters.

The top of preview generation log displays starts like this;

Running `Preview-LaTeX' on `test my látéx' with ``pdflatex -interaction=nonstopmode \&prv_test_my_la\́te\́x 
"/AUCTEXINPUT{" \"test\ my\ la\́te\́x.tex\" "}"''

(the Mac OS uses a special form of Unicode for filenames with combining
characters)

I did not check the ini file because it is volatile but I think you
indicated how to modify cache-preamble to make it permanent.

Anyway, above file with contents




with this file


\documentclass{article}
\def\foo{E=mc^2}
\def\bar{x^n + y^n = z^n}
\def\foofoo{E=h\nu}
\begin{document}
\(\foo\)
\(\bar\)
\(\foofoo\)
\end{document}



when I add

\[x^3+y^3\]

and then try to generate preview "at point" I get this

```
Running `Preview-LaTeX' on `_region_' with ``pdflatex -interaction=nonstopmode 
\&prv_test_my_la\́te\́x "/AUCTEXINPUT{" _region_.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:
.
 "test my látéx.tex"
 article.cls2014/09/29 v1.4h Standard LaTeX document class
  size10.clo2014/09/29 v1.4h Standard LaTeX file (size option)
.
(./_region_.tex
No file _region_.aux.
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/preview.sty 
(/usr/local/texlive/2018/texmf-dist/tex/generic/luatex85/luatex85.sty) 
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prtightpage.def) 
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prauctex.def
No auxiliary output files.


(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prauctex.cfg)) 
(/path/to/.emacs.d/elpa/auctex-12.1.0/latex/prfootnotes.def)
Preview: Fontsize 10pt
Preview: PDFoutput 1
)
! Undefined control sequence.
\GenericError  ...
#4  \errhelp \@err@ ...
l.8 \message{ !name(test my lá
téx.tex) !offset(0) }
! Undefined control sequence.
\GenericError  ...
  \let \@err@   ...
l.8 \message{ !name(test my lá
  

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

2018-05-24 Thread jfbu

Hi Keita


I have applied your patch (with diff of preview.el.in
transferred to preview.el) to my elpa installed 12.1.0

(later I
saw I had 12.1.1 on another computer and that preview.el
had changed a bit. As the elpa comes with .gitignore
which by bad luck for me has /preview.el, my initial
commit did not have the original one which I then
manually modified with your patch ---
I recovered later from the other computer the preview.el
there and re-did my commits)

(b.t.w. I also git cloned the savannah, and
https://git.savannah.gnu.org/cgit/auctex.git has a typo it should be
https://git.savannah.gnu.org/git/auctex.git
)


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

Hi Jean and all,

The proposed method, with slight modification explained below, works for
all the cases I tested.  Thank you again!
For now, I attach the patch for preview-latex part only so that the
reader can concentrate on the relavant changes.


jfbu  writes:



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


AUCTeX always runs TeX commands after changing the current directory to
that of the master file, so forward slash would never appear as an
argument of the command.  The region file is created in the same
directory as the master, thus region compilation should work as well.


I have also added quotes inside the \detokenize.


I tried removing those quotes and let the quotes added around the file
name with space to be put inside /AUCTEXINPUT like this:
pdflatex -foo -bar &prv_ppp_qqq /AUCTEXINPUT{"ppp qqq"} (without escape for 
shell)
, because it's easier to absorb the difference in the way of quoting the
shell arguments between w32 and non-w32 platforms.  Experiments showed
no problems even for files without space, so the attached patch takes
this way.  If this has any shortcomings, please tell me.



My testing so far indicates no problem on Mac OS X 10.9.5

I was intrigued by these changes related to quotes, but it turns out
when I had tried manually on the command line that I was not quoting
correctly.

With your patch on top of 12.1.0 I successfully generate preview for a file
with both spaces and utf-8 characters.

The top of preview generation log displays starts like this;

Running `Preview-LaTeX' on `test my látéx' with ``pdflatex -interaction=nonstopmode \&prv_test_my_la\́te\́x 
"/AUCTEXINPUT{" \"test\ my\ la\́te\́x.tex\" "}"''

(the Mac OS uses a special form of Unicode for filenames with combining
characters)

I did not check the ini file because it is volatile but I think you
indicated how to modify cache-preamble to make it permanent.

Anyway, above file with contents

\documentclass{article}
\def\foo{E=mc^2}
\def\bar{x^n + y^n = z^n}
\def\foofoo{E=h\nu}
\begin{document}
\(\foo\)
\(\bar\)
\(\foofoo\)
\end{document}

generates correct previews.

It also compiles fine because my TeX-command-list does not have the
 %` and %'.
And the non-\input form correctly escapes the spaces for the shell
so it seems.

A proposito, the above in the pdflatex command (once the format
is done)means \input will be with extra spaces

\input{"test my látéx.tex"}

but fortunately that works fine.

(one can check that by using this

\\def\\AUCTEXINPUT##1{\\catcode`/ 12\\relax\\catcode`\\ 
9\\relax\\message{+++\\detokenize{##1}+++}\\input{\\detokenize{##1}}}%

in preview.el and then check generate-preview compilation log)

LaTeX2e <2018-04-01> patch level 4
CUSTOMISED FORMAT. Preloaded files:
.
 "test my látéx.tex"
 article.cls2014/09/29 v1.4h Standard LaTeX document class
  size10.clo2014/09/29 v1.4h Standard LaTeX file (size option)
.
+++ "test my látéx.tex" +++ (./test my látéx.tex
No file "test my látéx".aux.

Anyway, all seems fine!

Thanks!

Jean-François


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


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

2018-05-24 Thread Ikumi Keita
Hi Jean and all,

The proposed method, with slight modification explained below, works for
all the cases I tested.  Thank you again!
For now, I attach the patch for preview-latex part only so that the
reader can concentrate on the relavant changes.

> jfbu  writes:

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

AUCTeX always runs TeX commands after changing the current directory to
that of the master file, so forward slash would never appear as an
argument of the command.  The region file is created in the same
directory as the master, thus region compilation should work as well.

>> I have also added quotes inside the \detokenize.

I tried removing those quotes and let the quotes added around the file
name with space to be put inside /AUCTEXINPUT like this:
pdflatex -foo -bar &prv_ppp_qqq /AUCTEXINPUT{"ppp qqq"} (without escape for 
shell)
, because it's easier to absorb the difference in the way of quoting the
shell arguments between w32 and non-w32 platforms.  Experiments showed
no problems even for files without space, so the attached patch takes
this way.  If this has any shortcomings, please tell me.

Regards,
Ikumi Keita



preview-diff.gz
Description: diff for preview-latex only
___
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

2018-05-24 Thread jfbu


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) )
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  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/b123
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





___
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

2018-05-24 Thread Ikumi Keita
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:
--
[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  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/b123
> 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

___
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

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] 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] 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 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

2018-05-24 Thread jfbu

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.cls2014/09/29 v1.4h Standard LaTeX document class
   size10.clo2014/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.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
<*> "/AUCTEXINPUT{ppp qqq.tex}
   "



I do not understand that for time being
but let's forget it as we have the \&prv_ppp_qqq.fmt way.

UPDATE: at bottom of this my new proposal seems ok with -fmt
at least at my locale.



! LaTeX Error: 

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

2018-05-24 Thread Ikumi Keita
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:
--- 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:
--
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.cls2014/09/29 v1.4h Standard LaTeX document class
  size10.clo2014/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:
--
[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.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 
<*> "/AUCTEXINPUT{ppp qqq.tex}
  "

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...  
  
<*> "/AUCTEXINPUT{ppp qqq.tex}
  "

! LaTeX Error: File `ppp qqq.tex' not found.

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

Enter file name: 
! Emergency stop.
 
 
<*> "/AUCTEXINPUT{ppp qqq.tex}