[Haskell-cafe] lhs2TeX: automatic line wrap within code blocks?

david.mihola david.mihola at gmail.com
Wed Apr 4 20:14:16 CEST 2012


I am currently using lhs2TeX for the first time and have encountered a
problem which I am unable to solve myself: Some code lines are too long to
fit into a single line of the output (PDF) file and thus go off the right
edge of the page.

Consider the following example:



%include polycode.fmt
%options ghci

Our encrypted message:

cyphertext = "rlkmlj, zlnift ekblvke pqc elvm if pzlp gblrk, akrlomk zk zle
lfpiriglpke pzlp, if pzk flpojlb rcojmk cs knkfpm, morz qcobe ak pzk rcfeorp
cs nkjriftkpcjiu, bklnkm pzk ljdv ofekj gjkpkfmk cs jlimift jkrjoipm lfe

Our decryption function:

decrypt = id

The original message was:

\eval{decrypt cyphertext}



Converting this to .tex with lhs2TeX and to .pdf with pdflatex produces a
PDF in which both instances of the cyphertext go off the right edge of the

Is there any way to tell lhs2TeX to allow/force line wrap within code blocks
and eval-statements?

Thank you very much for any help!


P.S.: I have only found one prior discussion of my question
but to my understanding no real answer came out of that.

View this message in context: http://haskell.1045720.n5.nabble.com/lhs2TeX-automatic-line-wrap-within-code-blocks-tp5618600p5618600.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list