Last active
November 21, 2021 15:57
-
-
Save dginev/13e982e8e98f6ddf19d4804abbd31663 to your computer and use it in GitHub Desktop.
A temporary quickfix for basic breqn.sty use with latexml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- CPERL -*- | |
# /=====================================================================\ # | |
# | breqn.sty | # | |
# | Simple temporary patch for LaTeXML | # | |
# |=====================================================================| # | |
package LaTeXML::Package::Pool; | |
use strict; | |
use warnings; | |
use LaTeXML::Package; | |
#********************************************************************** | |
RequirePackage('amsmath'); | |
Let(T_CS('\begin{dmath}'), '\align'); | |
Let(T_CS('\end{dmath}'), '\endalign'); | |
Let(T_CS('\begin{dmath*}'), '\align*'); | |
Let(T_CS('\end{dmath*}'), '\endalign*'); | |
Let(T_CS('\begin{dgroup}'), '\align'); | |
Let(T_CS('\end{dgroup}'), '\endalign'); | |
Let(T_CS('\begin{dgroup*}'), '\align*'); | |
Let(T_CS('\end{dgroup*}'), '\endalign*'); | |
DefMacro('\condition[]{}', sub { | |
my ($gullet, $delim, $content) = @_; | |
$delim = defined $delim ? ToString($delim) : ", "; | |
return (T_CS('\text'), T_BEGIN, Explode($delim), $content, T_END); | |
}); | |
#********************************************************************** | |
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{breqn} | |
\begin{document} | |
\begin{dmath} | |
f(x)=\frac{1}{x} \condition{for $x\neq 0$} | |
\end{dmath} | |
\begin{dmath*} | |
f(x)=\frac{1}{x} \condition{for $x\neq 0$} | |
\end{dmath*} | |
\begin{dgroup} | |
f(x)=\frac{1}{x} \condition{for $x\neq 0$} | |
\end{dgroup} | |
\begin{dgroup*} | |
f(x)=\frac{1}{x} \condition{for $x\neq 0$} | |
\end{dgroup*} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment