kosmikus / lhs2tex

Preprocessor for typesetting Haskell sources with LaTeX
Other
99 stars 28 forks source link

Conflict with beamerarticle #68

Open scmu opened 6 years ago

scmu commented 6 years ago

Some hooks in hscode seems to be causing a conflict with beamerarticle.

Please see the attached files. Issue.zip

If you typeset Issue.lhs with

lhs2TeX Issue.lhs > Issue.tex
pdflatex Issue

You get the following error message:

! Missing number, treated as zero.
<to be read again> 
                   ]
l.332 \end{hscode}
                  \resethooks
? 
! Illegal unit of measure (pt inserted).
<to be read again> 
                   ]
l.332 \end{hscode}
                  \resethooks
? 

And, as you can see in the attached pdf file, the second piece of code is formatted wrongly. It seems that newline are interpreted as something else.

It only happens when the code is in a frame environment, and only with beamerarticle. The "presentation mode" (with \documentclass{beamer}) works fine.

Is there a fix? Thank you!

kosmikus commented 6 years ago

Sorry for the late reply. I vaguely recall having seen this before, but I'll have to dig into how beamerarticle is implemented to see how/if it can be fixed.

scmu commented 6 years ago

Dear Andres,

On 10 Sep 2018, at 8:03 PM, Andres Löh notifications@github.com wrote: Sorry for the late reply. I vaguely recall having seen this before, but I'll have to dig into how beamerarticle is implemented to see how/if it can be fixed.

Thank you! :) It would be helpful if it can be fixed!

sincerely, Shin

kosmikus commented 5 years ago

A simple workaround is to say

\arrayhs

after %include polycode.fmt.

This has some (possibly unwanted) side-effects such as that code blocks cannot contain page breaks, but if that's acceptable for you (or even desirable), then it should be a relatively straight-forward fix.