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

\begin{pmatrix}...\end{pmatrix} not working as expected inside comments #320

Open
subhophy opened this issue Jan 7, 2022 · 2 comments
Open

Comments

@subhophy
Copy link

subhophy commented Jan 7, 2022

Consider the following piece of code.

\documentclass[12pt,twoside,a4paper]{scrartcl}
\usepackage[margin=.8in,footskip=0.25in]{geometry}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{minted} 
\usepackage{xcolor}
\begin{document}

\title{test}
\maketitle
 \pagecolor{gray!10}

\begin{minted}[linenos=true,numberblanklines=false,obeytabs=true,breaklines=true,style=manni
,mathescape=true,framesep=.8cm]{c}

// this is fine $f=g$

// matrix rendering issue $det=ae-bd$ of the matrix $A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$

\end{minted}
\end{document}

The output when rendered using lualatex looks like this

Screen Shot 2022-01-07 at 3 06 31 PM

It looks like the & is not being recognized as a LateX command.

Any way to get around this?

@muzimuzhi
Copy link
Contributor

This might be a pygments issue pygments/pygments#1988, and I gave a proof-of-concept workaround in https://tex.stackexchange.com/a/625741.

@subhophy subhophy changed the title \begin{matrix}...\end{pmatrix} not working as expected inside comments \begin{pmatrix}...\end{pmatrix} not working as expected inside comments Jan 8, 2022
@muzimuzhi
Copy link
Contributor

I gave a proof-of-concept workaround in https://tex.stackexchange.com/a/625741.

The workaround provided in that TeX-SX answer is updated to be (hopefully) more robust.

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

No branches or pull requests

3 participants