Skip to content

Instantly share code, notes, and snippets.

@dginev
Last active July 19, 2023 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dginev/f637ff71ec084babd8db095d7276fe8e to your computer and use it in GitHub Desktop.
Save dginev/f637ff71ec084babd8db095d7276fe8e to your computer and use it in GitHub Desktop.
Named wrapper environment with ltx:block and ltx:inline-block
# -*- mode: Perl -*-
use strict;
use warnings;
use LaTeXML::Package;
DefEnvironment("{namedwrap}{}", "<ltx:inline-block class='#1'>#body</ltx:inline-block>");
DefEnvironment("{namedblock}{}", "<ltx:block class='#1'>#body</ltx:block>");
1;
<article class="ltx_document">
<div id="p1" class="ltx_para">
<div class="ltx_block sample-value">
<p class="ltx_p">Hello World!</p>
</div>
</div>
<div id="p2" class="ltx_para">
<span class="ltx_inline-block sample-value">
<span class="ltx_p">Hello World!</span>
</span>
</div>
</article>
\documentclass{article}
\usepackage{myblocks}
\begin{document}
\begin{namedblock}{sample-value}
Hello World!
\end{namedblock}
\begin{namedwrap}{sample-value}
Hello World!
\end{namedwrap}
\end{document}
@dginev
Copy link
Author

dginev commented Jul 19, 2023

Generated via:

latexmlc test.tex --format=html --whatsout=fragment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment