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

parenthesis direction in minted #12

Open
bykhov opened this issue Apr 7, 2022 · 4 comments
Open

parenthesis direction in minted #12

bykhov opened this issue Apr 7, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@bykhov
Copy link

bykhov commented Apr 7, 2022

After the recent update, the direction of parenthesis in minted environment is wrong

Minimal example showing the issue

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{minted,color}

\usepackage{polyglossia,bidi}
\setmainlanguage{hebrew}
\setotherlanguage{english}

\setmainfont{Times New Roman}
\setmonofont{Courier New}

\begin{document}
\begin{minted}{python}
x = [x ]
\end{minted}
\end{document}

Expected behavior

x = [x ]

PDF file

min_example.pdf

@Tex-Ahmadi
Copy link

Tex-Ahmadi commented Apr 10, 2022

Hello

There is a problem without bidi package!

There is no problem in writing your file below:

\begin{minted}{python}
x = [x]
\end{minted}

\begin{english}
\begin{minted}{python}
x = [x ]
\end{minted}
\end{english}

%+++++++

The following file has a problem with XeLaTeX(Note the space after x), not problem with LuaLaTeX.

\documentclass[12pt]{article}

\usepackage{polyglossia}
\setmainlanguage{hebrew}
\setotherlanguage{english}
\setmainfont{Times New Roman}
\setmonofont{Times New Roman}

\begin{document}

x=[x]

x=[x ]

\LR{x=[x ]}

\begin{english}
x = [x ]
\end{english}

\end{document}

@bykhov
Copy link
Author

bykhov commented Apr 10, 2022

I was previously using

\setLR
x=[x ]
\setRL

and it worked fine, without an explicit english environment.

@Tex-Ahmadi
Copy link

Tex-Ahmadi commented Apr 10, 2022

not probleam file:

\documentclass[12pt]{article}
\usepackage{minted,color}

\usepackage{bidi}
%\usepackage[RTLdocument]{bidi}

\begin{document}
\begin{minted}{python}
x = [x ]
\end{minted}
\end{document}

%+++
your file bug polyglossia and script hebrew.

solve your file: see page 33 minted.pdf

\usepackage{etoolbox}
\BeforeBeginEnvironment{minted}{\begin{english}}
\AfterEndEnvironment{minted}{\end{english}}

@bykhov
Copy link
Author

bykhov commented Apr 10, 2022

Thanks for the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants