A while ago I stumbled upon the semantic
package --- its 'math ligatures' feature in particular --- and the whole way in which I write math-code in LaTeX changed.
Instead of
\[
\sem{\sigma}_s^x \quad \defeq \quad
\setbuild
{ \sigma' \subseteq \Sigma }
{ \exists s' \in S: \config{s, \sigma} \longrightarrow \cdots \longrightarrow
\config{s', \sigma'} \land x \in \sigma' }
\]
(already cleaned up with specific-purpose macros) I can now write
\[
[[ \sigma ]]_s^x =def
\setbuild
{ \sigma' <=set \Sigma }
{ .E. s' .in. S: <( s, \sigma )> --> ... --> <( s', \sigma' )> .and. x .in. \sigma' }
\]
and get an identical result (MWE upon request).
Question: I was wondering if there are other packages like that: packages that make your (La)TeX code easier to read. (Perhaps even a replacement for semantic
itself because, truth be told, that package is somewhat old and a bit buggy here and there.)
Edit: Please note, I'm interested in any package meant to enhance source code readability. It doesn't have to be anything like my example.
Several other questions exist concerning code readability, but none of them focus on packages.
tikz-qtree
and the recentforest
use such code parsing techniques. You can check them out for inspiration if you are inclined to write something along those lines.latexindent.plx
could help make source code more readable.<% fig('pendulum','A pendulum looks like this.',{'width'=>'fullpage','sidecaption'=>true,'sidepos'=>'b'}) %>
, which might generate something like\fullpagewidthfig{pendulum}{A pendulum looks like this.}{}{}{1}{}{b}
. The ruby version is more readable because ruby, unlike tex, was designed to be a general-purpose programming language. The options inside the{...}
can have defaults, and I can easily add new options without breaking old code.