Closed andreasabel closed 10 months ago
Don't the first two FAQ entries address this scenario?
That would be:
The document consists of multiple files. Can lhs2TEX be used? One option is to use %include rather than LATEX commands to include all files in the master file. The other is to process all files that contain code and the master file with lhs2TEX. All files to be processed with lhs2TEX must contain an %include lhs2TeX.fmt (or %include polycode.fmt) statement. From version 1.11 on, including lhs2TeX.sty is no longer necessary.
Yes, but the master file should be pure LATEX. Create a file mylhs2tex.lhs with just one line, namely %include lhs2TeX.fmt. Process that file with lhs2TEX, using the options you also use for the other included files. Call the resulting file mylhs2tex.sty and say \usepackage{mylhs2tex} at the beginning of your master file.
Thanks, got to try this!
Lhs2TeX assumes control over my TeXing [1], as it wants to run on the main file processing all
code
environments (and inline Haskell) in one go. I'd wish one could use it in a more modular way, like running it on somelhs
files which are part of a larger project, and theninput
ting the generatedtex
files into the main file. Latex macros Lhs2TeX depends on could be included e.g. via someusepackage
directive. (Theagda --latex
mode works in this style; it produces LaTeX files but not a preamble.)This feature request might be similar to #47.
[1] For instance, every occurrence of
@
is interpreted by Lhs2TeX, even inarray
format strings. I can of course put parts that Lhs2TeX should not touch in separate files. But I'd like it the other way round, to put the parts that Lhs2TeX should touch in separate files, especially if 90% of my document do not require the services of Lhs2TeX.