Open patrikja opened 6 years ago
Unfortunately, spec
and code
are treated in completely the same way when in poly mode, and there is no subst spec
directive, so the current behaviour is as intended.
It would be relatively easy to change this, but it would not be an entirely backwards-compatible change. (If someone redefines %subst code
in their document, then if I introduce %subst spec
, any spec-block in their document would be formatted incorrectly. Aliasing of %subst
-directives is currently not supported either.) I'm always extremely cautious of such changes.
The only workaround I can think of is to add more context on the LaTeX side and write something like:
\begin{document}
\spec
\begin{spec}
\end{spec}
\begin{code}
\end{code}
\end{document}
where \spec
is a normal TeX command switching the style of the next code block. You'd then redefine %subst code
to map to an environment that looks whether the \spec
-switch is currently set and does something different depending on that, and also re-sets the switch.
I would like to experiment with some visual difference between spec and code blocks (in my lecture notes for the DSLsofMath course) but it seems like the
%subst spec
directive is not honoured. See minimal example below. Is there an easy fix / workaround?Command line: lhs2TeX --poly q.lhs > q.tex
Expected output:
Actual output: