Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minted and semantic packages conflict #422

Open
romildo opened this issue Nov 10, 2024 · 1 comment
Open

minted and semantic packages conflict #422

romildo opened this issue Nov 10, 2024 · 1 comment

Comments

@romildo
Copy link

romildo commented Nov 10, 2024

When using both minted and semantic packages on my documents, latex does not terminates compilation. The issue appears when using escapeinside.

Example document:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{semantic}
\usepackage{minted}

\begin{document}

\begin{minted}[bgcolor=green!10,escapeinside=!!]{haskell}
foldl (!$\oplus$!) !$e$! [!$x_0$!,!$x_1$!,!\ldots!,!$x_{n-1}$!]
!$\equiv$!
(!\dots!((!$e$! !$\oplus$! !$x_0$!) !$\oplus$! !$x_1$!) !\ldots!) !$\oplus$! !$x_{n-1}$!
\end{minted}

\end{document}
$ pdflatex --shell-escape test2.tex 
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/nixos.org) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./test2.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>

(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class

(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/base/size10.clo))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/base/inputenc.sty)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/base/fontenc.sty)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/semantic/semantic.sty
Semantic Package v2.0(epsilon) [2003/10/28]
CVSId: $Id: semantic.dtx,v 1.11 2003/10/28 13:45:57 turtle Exp $
Loading features: 

(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/semantic/ligature.sty)  math mode ligatures,
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/semantic/infernce.sty)  inference rules,
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/semantic/tdiagram.sty)  T diagrams,
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/semantic/reserved.sty)  reserved words,
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/semantic/shrthand.sty)  short hands,
and general definitions.

) (/home/romildo/texmf/tex/latex/minted/minted.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/catchfile/catchfile.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/infwarerr/infwarerr.sty)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/ltxcmds/ltxcmds.sty)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/etexcmds/etexcmds.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/iftex/iftex.sty)))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/etoolbox/etoolbox.sty)
(/home/romildo/texmf/tex/latex/fvextra/fvextra.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/fancyvrb/fancyvrb.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/graphics/keyval.sty))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/upquote/upquote.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/base/textcomp.sty))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/lineno/lineno.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/kvoptions/kvoptions.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/kvsetkeys/kvsetkeys.sty))))
(/home/romildo/texmf/tex/latex/latex2pydata/latex2pydata.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/pdftexcmds/pdftexcmds.sty))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/pgf/utilities/pgfkeys.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/pgf/utilities/pgfkeys.code.tex
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/generic/pgf/utilities/pgfkeyslibraryfiltered.code.tex)))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/pgfopts/pgfopts.sty)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/tools/shellesc.sty)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/float/float.sty))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/xcolor/xcolor.sty
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/graphics-cfg/color.cfg)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/graphics-def/pdftex.def)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/graphics/mathcolor.ltx))
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/l3backend/l3backend-pdftex.def) (./test2.aux)
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (./_AD0234829205B9033196BA818F7A872B.config.minted)
(./_minted/default.style.minted)
(./_minted/48BB32B9F81EC1DBE04B821D522312F8.highlight.minted
(/nix/store/b4axrxrks1dnfvcflqdrnnybc30zdy4h-texlive-combined-2023-texmfdist/te
x/latex/base/t1cmtt.fd)
@muzimuzhi
Copy link
Contributor

The dash character (-) is the culprit.

Somehow when semantic is loaded, in escaped math in minted env, the active - is defined to expand to itself (still active), thus leads to an infinite loop. It should be defined to the non-active - character. The definition happens in \everymath, added by fvextra.

An fvextra example:

\documentclass{article}
\usepackage{semantic}
\usepackage{minted}

\begin{document}
\renewcommand{\FancyVerbFormatLine}[1]{\tracingall#1\tracingnone}

\begin{Verbatim}[mathescape]
$-$
\end{Verbatim}
\end{document}

Excerpted log lines indicating the infinite loop

~..........-->-
{the character -}

~..........-->-
{the character -}

~..........-->-
{the character -}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants