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

OPTIONS_GHC pragma not rendered correctly #75

Open
boris-stepanov opened this issue Sep 18, 2019 · 1 comment
Open

OPTIONS_GHC pragma not rendered correctly #75

boris-stepanov opened this issue Sep 18, 2019 · 1 comment

Comments

@boris-stepanov
Copy link

Hello.

If you declare a pragma with underscore symbol then it will be translated in a code unreadable by pdflatex.

$ lhs2Tex --version
lhs2TeX 1.22, Copyright (C) 1997-2017 Ralf Hinze, Andres Loeh

lhs2TeX comes with ABSOLUTELY NO WARRANTY;
for details type `lhs2TeX --warranty'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `lhs2TeX --copying' for details.
$ cat Main.lhs

\documentclass{article}
%include polycode.fmt
\begin{document}

OK
> {-# LANGUAGE OverloadedStrings #-}

Not OK
> {-# OPTIONS_GHC -Wall #-}

\end{document}
$ lhs2TeX Main.lhs -o Main.tex && pdflatex Main.tex

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./Main.tex
LaTeX2e <2018-12-01>
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/share/texmf-dist/tex/latex/stmaryrd/stmaryrd.sty)
(/usr/share/texmf-dist/tex/latex/polytable/polytable.sty
(/usr/share/texmf-dist/tex/latex/lazylist/lazylist.sty)
(/usr/share/texmf-dist/tex/latex/tools/array.sty))
(/usr/share/texmf-dist/tex/latex/tools/calc.sty) (./Main.aux)
(/usr/share/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/share/texmf-dist/tex/latex/amsfonts/umsb.fd)
(/usr/share/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)
(/usr/share/texmf-dist/tex/latex/base/omscmr.fd)
! Missing $ inserted.
<inserted text> 
                $
l.269 \end{hscode}
                  \resethooks
? q

If you look at generated .tex file, then you'll see such line

\>[3]{}\mbox{\enskip\{-\# OPTIONS_GHC -Wall  \#-\}\enskip}{}\<[E]%

Something is wrong with the underscore.

@asr
Copy link

asr commented Sep 6, 2021

The same issue occurs with

lhs2TeX --version
lhs2TeX 1.24, Copyright (C) 1997-2020 Ralf Hinze, Andres Loeh

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