2

Documentation for lhs2tex shows a serif font being used by default as the output from the preprocessor (http://www.andres-loeh.de/lhs2tex/Guide2-1.17.pdf):

desired-font

However, when I run lhs2tex --poly input.lhs > out.tex;pdflatex out.tex, the Haskell source is formatted in a computer-modern font:

output-font

My input file is

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

> main :: IO ()
> main = putStrLn "Hello, world!"

\end{document}
5
  • Computer Modern is a serif font? Well, Computer Modern Roman is a serif font, Computer Modern Sans serif is, ähm, sans-serif font.
    – Johannes_B
    Mar 26 '15 at 17:18
  • sorry - I am probably not referring to the font correctly. I've added screenshots to help describe the current issue Mar 26 '15 at 17:24
  • To be honest, i don't know how that works in detail and i won't read the doc. Try to add \usepackage{tgchorus} to your inputfile and see if there are differences.
    – Johannes_B
    Mar 27 '15 at 20:04
  • thanks. that still gives the same result though. I think the issue is related to the polytable package not being found, although no errors are shown when running pdflatex Mar 28 '15 at 11:06
  • You can make some edit to the question, add some detail, this will make the question appear back on top of the main site. Do it at around 20 pm standard time, most people online.
    – Johannes_B
    Mar 28 '15 at 13:34
2

It seems that alignment in lhs2TeX (which uses the polytable packake) is driven by spaces in the .lhs source file. I was able to set the font using

\usepackage{mathpazo}

and adjusting the input to

> main  ::   IO()
> main  =    putStrLn "Hello, world!"

resolved the alignment issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.