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

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


Hello,

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:

-------------------------------------

\documentclass{article}
\usepackage[utf8]{inputenc}

%include polycode.fmt
%options ghci
\begin{document}

Our encrypted message:

\begin{code}
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
rlnlbjv"
\end{code}

Our decryption function:

\begin{code}
decrypt = id
\end{code}

The original message was:

\eval{decrypt cyphertext}

\end{document}

-------------------------------------

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
page.

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!

David

P.S.: I have only found one prior discussion of my question
(http://tex.stackexchange.com/questions/15048/how-to-typeset-a-multiline-text-in-math-environment)
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