This post is not really about solving a problem because somehow I solved it, but I feel totally clueless about why. Maybe someone can shed some light.
I’m trying to wrap equations inside <html-class|equation|>
so I can apply CSS styling to equations when exporting to html. I can actually do it manually on the editor, however if I try to define a macro inside the style file to automate it it’s very hard.
For example, this that looks like the most straigthforward way is a dead end because when I hit ENTER
, <hybrid|equation>
will be quietly removed:
Why? No idea. It looks like Texmacs doesn’t like it. Maybe it thinks it’s invalid but doesn’t say why. It remembers me of ed. I would love if it spat some garbage, some error, a clue, an insult, anything but deleting my input.
I have managed to edit the style file using a plain text editor and this actually works:
<assign|equation-web|<\macro|body>
<\html-class|equation>
<\equation>
<arg|body>
</equation>
</html-class>
</macro>>
Inside the style file editor it looks like this little abomination:
Now, if I try to enter the above inside Texmacs it’s possible but an exercise in frustration.
This is again a dead end since hitting ENTER
will delete \equation
as before.
The trick it’s activating html-class
and then we can finally get the macro.
I think it’s insane. I have searched for active/inactive in the documentation and it looks like it just affects the rendering. What the hell is going on here?
As a bonus:
- If I rename the macro from
equation-web
totmhtml-equation
Texmacs crashes. - For some reason there was an old version of a macro when I selected
Edit macro...
from the menu. Where are those stored? Not in my style file, not in the document.