[OS X TeX] strange behaviour of dvipdfmx and xdvipdfmx in Emacs

Bruno Voisin bvoisin at icloud.com
Fri Jun 9 04:47:43 EDT 2017


> Le 9 juin 2017 à 02:52, 军其 胡 <junqihu at me.com> a écrit :
> 
> I'm a faithful user of MacTeX/TeX Live+Emacs+AucTeX. One week ago, I worked with MacTeX 2016, Emacs 25.1, AucTex 11.90. Everything is fine. Since MacTeX 2017 is released, I updated it to the latest version. However,  something wrong happened with dvipdfmx and xdvipdfmx in Emacs while similar procedure is ok under bash shell.  Let me explain it with some LaTeX codes:


> e.g.1 ---- sam1.tex
> [...]
> Now open iTerm.app and execute 
> [...]
> $ latex sam1.tex
> $ dvipdfmx sam1.dvi
> [...]
> PDF file is produced.

> If I open sam1.tex in Emacs, and click 'LaTeX' and 'Dvipdfmx' buttons sequentially on command menu, the following errors is reported:
> [...]
> [1Unable to read environment locale:exit now.
>  
> dvipdfmx:warning: Filtering file via command [...] failed.


> e.g.2 --- sam2.tex
> [...]
> PDF file is also generated properly under iTerm.app.

> If I use 'XeLaTeX' button on Emacs command menu to produce the corresponding PDF,  xdvipdfmx is failed and Emacs complains that
> [...]
> [1] (./sam2.aux)Unable to read environment locale:exit now.
> 
> xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object.


Trying here with your sam2.tex and a rose.eps file, everything works fine with XeLaTeX on TeXShop.

The problem seems to happen when Emacs asks dvipdfmx to process the generated DVI file in the first example, and the (invisibly) generated XDV file in the second example, yielding each time

> Unable to read environment locale:exit now.

On StackExchange, at

https://tex.stackexchange.com/questions/373306/how-to-verify-that-auctex-works-with-latest-2017-texlive-actually-mactex

one answer says

> You should update AUCTeX to the latest ELPA version available, 11.90.2, it has a fix for TeX Live 2017.

See also

https://tex.stackexchange.com/questions/368408/auctex-says-latex-problems-after-1-page

the same user (giordano) provides more detail

> AUCTeX parses the output buffer in order to report errors and warnings, and if there is none of them, it looks for a line like
> 
> LaTeX2e <date>
> 
> However, since April 2017, the date format of LaTeX has been changed from yyyy/mm/ddto yyyy-mm-dd and your version of AUCTeX can't find the line
> 
> LaTeX2e <2017-04-15>
> 
> This has been already fixed upstream, you only need to update your AUCTeX package. The fix is present in the latest ELPA version (11.90.2), which is by far the best and simplest way to install (and then update) the package.


Could this be connected?

Bruno Voisin




More information about the MacOSX-TeX mailing list