Menu

#3761 \document definition causes latex failed to build mylatex.fmt

None
closed
5
2021-07-23
2021-03-30
dao
No

The variable imaxima-mylatex is defined in mylatex.ltx.el as follows:

\\def\\document{\\endgroup

This will cause imaxima mode to be failed to build mylatex.fmt because "Extra engroup".

The old version distributed by debian has the same issue. To fix the issue, comment the "\endgroup" as follows :

\\def\\document{%\\endgroup

Discussion

  • Leo Butler

    Leo Butler - 2021-03-30
    • labels: imaxima, latex --> imaxima, latex, mylatex
    • assigned_to: Leo Butler
     
  • Leo Butler

    Leo Butler - 2021-03-30

    Dao, would you attach the complete contents of the imaxima working directory (it should be located in a directory named /tmp/imaximaXXXXXX, where XXXXXX will be filled in by random characters).

    Please see this thread for more information/background.

     
  • dao

    dao - 2021-04-01

    All temp files for building mylatex are attached

    File mylatex.ltx:

    \makeatletter\let\MYLATEXdocument\document
    \let\MYLATEXopenout\openout\def\document{\endgroup
    {\setbox\z@\hbox{\normalfont% normal
    {\ifx\large\@undefined\else\large\fi
    \ifx\footnotesize\@undefined\else\footnotesize\fi}%
    {\bfseries\itshape}% bold and bold italic
    {\itshape}\ttfamily\sffamily}}%
    \let\document\MYLATEXdocument\let\openout\MYLATEXopenout
    \makeatother\everyjob\expandafter{\the\everyjob
    \begingroup\listfiles\expandafter\MYLATEXcustomised\@dofilelist
    \endgroup}\@addtofilelist{.}\catcode`\\=13\relax
    \catcode`\#=12\relax\catcode`\ =9\relax\dump}
    \def\openout#1 {\g@addto@macro\MYLATEXopens{\immediate\openout#1 }}
    \let\MYLATEXopens\@empty\def\MYLATEXbegin{\begin{document}}
    \def\MYLATEXcomment{mylatex}\def\MYLATEXcustomised#1#2#3\typeout#4{%
    \typeout{CUSTOMISED FORMAT. Preloaded files:^^J\@spaces\@spaces.}#3}
    {\catcode`\^^M=\active\catcode`\/=0 %
    /catcode`\\=13 /gdef\{/catcode`/\=0 /catcode`/^^M=13   /catcode`/%=9 ^^M}%
    /long/gdef^^M#1^^M{/def/MYLATEXline{#1}%
    /ifx/MYLATEXline/MYLATEXcomment/let/MYLATEXbegin/relax%
    /let/MYLATEXline/relax/fi/ifx/MYLATEXline/MYLATEXbegin%
    /catcode`/^^M=5/relax/let^^M/par/catcode`/#=6/relax%
    /catcode`/%=14/relax/catcode`/ =10/relax%
    /expandafter/MYLATEXopens/expandafter/MYLATEXbegin%
    /else/expandafter^^M/fi}}\expandafter\input\endinput%
    

    Error msgs in mylatex.log:

    \GRP@box=\box56
    \GRP@wholebox=\box57
    \darraycolsep=\skip61
    \cur@row=\count283
    \cur@col=\count284
    \conditionsep=\skip62
    )
    ! Extra \endgroup.
    \document ->\endgroup 
                          {\setbox \z@ \hbox {\normalfont {\ifx \large \@undefin...
    l.30 \begin{document}
    
    ? 
    ! Emergency stop.
    \document ->\endgroup 
                          {\setbox \z@ \hbox {\normalfont {\ifx \large \@undefin...
    l.30 \begin{document}
    
    End of file on the terminal!
    
     
  • Leo Butler

    Leo Butler - 2021-05-03

    Dao, I looked at mylatex.log more carefully. On line 8, yours has

    L3 programming layer <2021-01-09> xparse <2020-03-03>)
    

    However, on my debian testing system, I see

    L3 programming layer <2021-01-09> xparse <2020-03-03> Begin hook defined)
    

    I believe that the begin hook is the change to texlive that broke mylatex.ltx and that David Carlisle fixed. See commit 7cc8be3f6.

    I believe the most likely cause of this difference is that you have cached format file that texlive is loading (I experienced this myself). It is likely underneath ~/.texliveXXXX where XXXX=2020 or something like that.

    Could you check this, please?

     
  • dao

    dao - 2021-06-02

    Leo, sorry reply late.

    I tried to delete ~/.texlive2020, then killed maxima process and closed imaxima buffer, but this not work.

    I fixed the issue by following patch:

    ```bash
    user@local:~$ diff -Naur /usr/share/emacs/site-lisp/maxima/{imaxima.el.orig,imaxima.el}
    --- /usr/share/emacs/site-lisp/maxima/imaxima.el.orig 2021-06-02 08:07:20.873728250 +0800
    +++ /usr/share/emacs/site-lisp/maxima/imaxima.el 2021-06-02 08:08:35.837726062 +0800
    @@ -471,7 +471,7 @@

    (defconst imaxima-mylatex
    "\makeatletter\let\MYLATEXdocument\document
    -\let\MYLATEXopenout\openout\def\document{\endgroup
    +\let\MYLATEXopenout\openout\def\document{%\endgroup
    {\setbox\z@\hbox{\normalfont% normal
    {\ifx\large\@undefined\else\large\fi
    \ifx\footnotesize\@undefined\else\footnotesize\fi}%
    ```

     
  • Leo Butler

    Leo Butler - 2021-07-23
    • status: open --> closed
    • Group: Includes_proposed_fix --> None
     
  • Leo Butler

    Leo Butler - 2021-07-23

    Ok, Sourceforge lost my last comment that I intended to post before closing the report.

    I see now that you are using the debian-packaged imaxima.el. Unfortunately, debian's maxima-* packages are out of date (5.44.0 vs. the current 5.45.1 release) and one of the bugs fixed in the 5.45.0 release was this one.

    See the comments here, especially the last one where I explain which files need to be downloaded/patched.

     
  • Leo Butler

    Leo Butler - 2021-07-23

    For reference, this bug is also reported at:

    Ubuntu
    Debian
    Debian (?)

     

Log in to post a comment.