texlive[64978] Master/texmf-dist: mhequ (9nov22)

commits+karl at tug.org commits+karl at tug.org
Wed Nov 9 22:08:02 CET 2022


Revision: 64978
          http://tug.org/svn/texlive?view=revision&revision=64978
Author:   karl
Date:     2022-11-09 22:08:02 +0100 (Wed, 09 Nov 2022)
Log Message:
-----------
mhequ (9nov22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/mhequ/README
    trunk/Master/texmf-dist/tex/latex/mhequ/mhequ.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.pdf
    trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/mhequ/example.pdf
    trunk/Master/texmf-dist/doc/latex/mhequ/example.tex

Modified: trunk/Master/texmf-dist/doc/latex/mhequ/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mhequ/README	2022-11-09 21:07:39 UTC (rev 64977)
+++ trunk/Master/texmf-dist/doc/latex/mhequ/README	2022-11-09 21:08:02 UTC (rev 64978)
@@ -1,5 +1,5 @@
 mhequ package by Martin Hairer
-Version 1.71 dated 9 March 2022
+Version 1.72 dated 8 November 2022
 
 This package provides an easy way to typeset multilign / multicolumn 
 equations and to add subequation numbering. See the example and the 

Deleted: trunk/Master/texmf-dist/doc/latex/mhequ/example.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/mhequ/example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mhequ/example.tex	2022-11-09 21:07:39 UTC (rev 64977)
+++ trunk/Master/texmf-dist/doc/latex/mhequ/example.tex	2022-11-09 21:08:02 UTC (rev 64978)
@@ -1,118 +0,0 @@
-\documentclass{article}
-\usepackage{amsmath}
-\usepackage{mhequ}
-
-\def\eref#1{(\ref{#1})}
-
-\textwidth 13cm
-\textheight 22cm
-\oddsidemargin 0.2cm
-\topmargin 0.3cm
-\pagestyle{empty}
-
-\begin{document}
-
-\title{Using the \texttt{mhequ} package}
-\author{Martin Hairer}
-\date{Version 1.71, \today}
-\maketitle
-\thispagestyle{empty}
-
-
-This package provides two environments: \texttt{equ} for single-line equations
-and \texttt{equs} for multi-line equations. They behave similarly to the built-in
-\texttt{equation} and \texttt{amsmath}'s \texttt{align} environments and can essentially
-be used as drop-in replacements. The main difference is that equation numbers are 
-handled differently: equations are numbered if and only if they have a \verb|\label|,
-so there is no need for starred versions. This also applies to individual lines in
-a multiline equation. Also, the \texttt{equs} environment supports blocks of equation
-with more
-
-Since \texttt{mhequ} redefines the \verb|\tag| and \verb|\intertext| commands, it should
-always be loaded \textit{after} the \texttt{amsmath} package. However, these
-two commands should still behave correctly inside the \texttt{amsmath} environments.
-The rest of this document demonstrates the usage of the \texttt{mhequ} package,
-it is easiest to just read the source code of this document to see how it works.
-See also the description given at the start of the file \texttt{mhequ.sty}.
-
-Here is a simple labelled equation:
-\begin{equ}[onelab]
-	e^{i\pi} + 1 = 0 \;.
-\end{equ}
-Removing or adding the label does not require a change of environment:
-\begin{equ}
-	e^{i\pi} + 1 = 0 \;.
-\end{equ}
-However, if the option \texttt{numberall} is set, then every single 
-equation is numbered.
-A simple list of equations can be displayed either with one number
-per equation
-\begin{align}
-	f(x) &= \sin(x) + 1\;, \label{e:equ1}\\
-	h(x) &= f(x) + g(x) -3\;, \label{e:equ3}
-\end{align}
-\begin{equs}
-	f(x) &= \sin(x) + 1\;, \label{e:equ1}\\
-	h(x) &= f(x) + g(x) -3\;, \label{e:equ3}
-\end{equs}
-or with one number for the whole list
-\begin{equs}[e:block]
-	f(x) &= \sin(x) + 1\;, \\
-	h(x) &= f(x) + g(x) -3\;.
-\end{equs}
-Of course, it can also have no number at all:
-\begin{equs}
-	f(x) &= \sin(x) + 1\;, \\
-	h(x) &= f(x) + g(x) -3\;.
-\end{equs}
-The command \verb|\minilab{label_name}| allows us to create a counter for the lines
-in a block of equations.
-\minilab{otherlabel}
-\begin{equs}
-	f(x) &= \sin(x) + 1\;, \label{e:f}\\
-	g(x) &= \cos(x) - x^2 + 4\;,\label{e:g}\\[3mm]
-	h(x) &= f(x) + g(x) -3\;. \label{e:h}
-\end{equs}
-One can refer to the whole block \eref{otherlabel} or to one
-line, like \eref{e:f} for example. 
-It is possible to use any tag one likes with the \verb|\tag{displayed_tag}|
-command
-\begin{equ}[mylabel]
-	 x = y\;, \tag{$\star$}
-\end{equ}
-which in this case was used as \verb|\tag{$\star$}|.
-Such an equation can be referred to as usual: \eref{mylabel}.
-Of course, \texttt{mhequ} can be used in conjunction with the usual \texttt{equation} environment, 
-but \texttt{mhequ} is great, so why would you want to do this? 
-\begin{equation}
- x=y+z
-\end{equation}
-Typesetting several columns of equations is quite easy and doesn't require 10 different environments
-with awkward names:
-\begin{equs}
-	x&=y+z    &\qquad   a&= b+c     &\qquad x&= v \label{laba}\\
-	x&=y+z    &\qquad   a&= b+c     &\qquad x&= u+1\tag{\ref{laba}'}\label{labtag}\\
-	\multicol{4}{\text{(multicol)}}   &\qquad x&=y     \\
-	a&= b     &\multicol{4}{\qquad\text{(multicol)}} \\
-	x&=y+z    &\qquad a^2&= (b-c)^3 +y \\
-\intertext{and also (this is some \texttt{\string\intertext})}
-	x&=y+z    &\qquad   a&= (b+c)^2 - 5 &\qquad \ell&= m\label{labb}
-\end{equs}
-We can even extend the block \eref{otherlabel} much later
-using the \verb|\minilab{label_name}| command:
-\minilab{otherlabel}
-\begin{equs}
-	x&=y+z &\quad x&=y+z  &\quad f(x)&= b\label{e:x1}\\
-	x&=y+z & x&=y+z &\quad g(x)&= b\label{e:x2} \\
-	\multicol{6}{\sin^2 x + \cos^2 x = 1} \label{e:x3}
-\end{equs}
-It is possible to change the type of subnumbering and to use the 
-\texttt{\string\text} command without having to load \texttt{amstext}:
-\setlabtype{Alph}
-\minilab{alab}
-\begin{equs}
-	I_1 &= \int_a^b g(x)\,dx\;,&\quad&\text{(First equation)} \label{e:1}\\
-	I_2 &= \int_a^b g(x^2-1)\,dx\;.&\quad&\text{(Second equation)} \label{e:2}
-\end{equs}
-
-\end{document}
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.pdf	2022-11-09 21:07:39 UTC (rev 64977)
+++ trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.pdf	2022-11-09 21:08:02 UTC (rev 64978)

Property changes on: trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.tex	2022-11-09 21:08:02 UTC (rev 64978)
@@ -0,0 +1,118 @@
+\documentclass{article}
+\usepackage{amsmath}
+\usepackage{mhequ}
+
+\def\eref#1{(\ref{#1})}
+
+\textwidth 13cm
+\textheight 22cm
+\oddsidemargin 0.2cm
+\topmargin 0.3cm
+\pagestyle{empty}
+
+\begin{document}
+
+\title{Using the \texttt{mhequ} package}
+\author{Martin Hairer}
+\date{Version 1.72, 9 November 2022}
+\maketitle
+\thispagestyle{empty}
+
+
+This package provides two environments: \texttt{equ} for single-line equations
+and \texttt{equs} for multi-line equations. They behave similarly to the built-in
+\texttt{equation} and \texttt{amsmath}'s \texttt{align} environments and can essentially
+be used as drop-in replacements. The main difference is that equation numbers are 
+handled differently: equations are numbered if and only if they have a \verb|\label|,
+so there is no need for starred versions. This also applies to individual lines in
+a multiline equation. Also, the \texttt{equs} environment supports blocks of equation
+with more
+
+Since \texttt{mhequ} redefines the \verb|\tag| and \verb|\intertext| commands, it should
+always be loaded \textit{after} the \texttt{amsmath} package. However, these
+two commands should still behave correctly inside the \texttt{amsmath} environments.
+The rest of this document demonstrates the usage of the \texttt{mhequ} package,
+it is easiest to just read the source code of this document to see how it works.
+See also the description given at the start of the file \texttt{mhequ.sty}.
+
+Here is a simple labelled equation:
+\begin{equ}[onelab]
+	e^{i\pi} + 1 = 0 \;.
+\end{equ}
+Removing or adding the label does not require a change of environment:
+\begin{equ}
+	e^{i\pi} + 1 = 0 \;.
+\end{equ}
+However, if the option \texttt{numberall} is set, then every single 
+equation is numbered.
+A simple list of equations can be displayed either with one number
+per equation
+\begin{align}
+	f(x) &= \sin(x) + 1\;, \label{e:equ1}\\
+	h(x) &= f(x) + g(x) -3\;, \label{e:equ3}
+\end{align}
+\begin{equs}
+	f(x) &= \sin(x) + 1\;, \label{e:equ1}\\
+	h(x) &= f(x) + g(x) -3\;, \label{e:equ3}
+\end{equs}
+or with one number for the whole list
+\begin{equs}[e:block]
+	f(x) &= \sin(x) + 1\;, \\
+	h(x) &= f(x) + g(x) -3\;.
+\end{equs}
+Of course, it can also have no number at all:
+\begin{equs}
+	f(x) &= \sin(x) + 1\;, \\
+	h(x) &= f(x) + g(x) -3\;.
+\end{equs}
+The command \verb|\minilab{label_name}| allows us to create a counter for the lines
+in a block of equations.
+\minilab{otherlabel}
+\begin{equs}
+	f(x) &= \sin(x) + 1\;, \label{e:f}\\
+	g(x) &= \cos(x) - x^2 + 4\;,\label{e:g}\\[3mm]
+	h(x) &= f(x) + g(x) -3\;. \label{e:h}
+\end{equs}
+One can refer to the whole block \eref{otherlabel} or to one
+line, like \eref{e:f} for example. 
+It is possible to use any tag one likes with the \verb|\tag{displayed_tag}|
+command
+\begin{equ}[mylabel]
+	 x = y\;, \tag{$\star$}
+\end{equ}
+which in this case was used as \verb|\tag{$\star$}|.
+Such an equation can be referred to as usual: \eref{mylabel}.
+Of course, \texttt{mhequ} can be used in conjunction with the usual \texttt{equation} environment, 
+but \texttt{mhequ} is great, so why would you want to do this? 
+\begin{equation}
+ x=y+z
+\end{equation}
+Typesetting several columns of equations is quite easy and doesn't require 10 different environments
+with awkward names:
+\begin{equs}
+	x&=y+z    &\qquad   a&= b+c     &\qquad x&= v \label{laba}\\
+	x&=y+z    &\qquad   a&= b+c     &\qquad x&= u+1\tag{\ref{laba}'}\label{labtag}\\
+	\multicol{4}{\text{(multicol)}}   &\qquad x&=y     \\
+	a&= b     &\multicol{4}{\qquad\text{(multicol)}} \\
+	x&=y+z    &\qquad a^2&= (b-c)^3 +y \\
+\intertext{and also (this is some \texttt{\string\intertext})}
+	x&=y+z    &\qquad   a&= (b+c)^2 - 5 &\qquad \ell&= m\label{labb}
+\end{equs}
+We can even extend the block \eref{otherlabel} much later
+using the \verb|\minilab{label_name}| command:
+\minilab{otherlabel}
+\begin{equs}
+	x&=y+z &\quad x&=y+z  &\quad f(x)&= b\label{e:x1}\\
+	x&=y+z & x&=y+z &\quad g(x)&= b\label{e:x2} \\
+	\multicol{6}{\sin^2 x + \cos^2 x = 1} \label{e:x3}
+\end{equs}
+It is possible to change the type of subnumbering and to use the 
+\texttt{\string\text} command without having to load \texttt{amstext}:
+\setlabtype{Alph}
+\minilab{alab}
+\begin{equs}
+	I_1 &= \int_a^b g(x)\,dx\;,&\quad&\text{(First equation)} \label{e:1}\\
+	I_2 &= \int_a^b g(x^2-1)\,dx\;.&\quad&\text{(Second equation)} \label{e:2}
+\end{equs}
+
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/mhequ/mhequ-example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/mhequ/mhequ.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mhequ/mhequ.sty	2022-11-09 21:07:39 UTC (rev 64977)
+++ trunk/Master/texmf-dist/tex/latex/mhequ/mhequ.sty	2022-11-09 21:08:02 UTC (rev 64978)
@@ -1,6 +1,6 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-% mhequ.sty v1.71, Copyright 2022 by Martin Hairer
+% mhequ.sty v1.72, Copyright 2022 by Martin Hairer
 %   This package is public domain. You are strongly encouraged to use
 %   it and to distribute it further. If you have some contribution to
 %	it, please let me know!
@@ -84,8 +84,20 @@
 \newif\if at MHtag
 \newif\if at MHleft
 \newif\if at MHflush
+\newif\if at MHglobals
 \@MHnumberallfalse
+\@MHglobalstrue
 
+\def\@MHsaveglobals{%
+\if at MHglobals
+\global\let\MHglobal at label=\label
+\global\let\MHglobal at ref=\ref
+\global\let\MHglobal at multicol=\multicol
+\global\let\MHglobal at notag=\notag
+\global\let\MHglobal at text\text
+\global\let\MHsavecr=\\
+\@MHglobalsfalse\fi
+}
 
 \ProcessOptions
 
@@ -101,7 +113,7 @@
 \def\@MHresetlab{\if at MHnumberall\global\@MHhaslabtrue\else\global\@MHhaslabfalse\fi}
 \@MHresetlab
 
-\def\@MHref#1{\@ifundefined{r@#1}{??}{\@saveref{#1}}}
+\def\@MHref#1{\@ifundefined{r@#1}{??}{\MHglobal at ref{#1}}}
 %%%%% Computes the length of its argument
 \newcount\@MHLength
 \def\computelength#1{\@MHLength=0 \getlength#1\end}
@@ -113,7 +125,7 @@
 		{}\string\setcounter{lab@#1}{0}}%
 	\global\expandafter\let\expandafter\c at MHCurrentCount\csname c at lab@#1\endcsname%
 	\global\@namedef{MHused@#1}{}%
-	\def\@currentlabel{\theequation}\MHsavelabel{#1}%
+	\def\@currentlabel{\theequation}\MHglobal at label{#1}%
 	}
 \def\@uselabel#1{\global\def\@mylabel{#1}
 	\global\expandafter\let\expandafter\c at MHCurrentCount\csname c at lab@#1\endcsname
@@ -153,7 +165,7 @@
 
 \def\@MHwritelabel{\def\@currentlabel{\@MHeqno}%
 	\if at MHleft\kern\displaywidth\kern0.2truecm\else\kern0.2cm\fi%
-	\MHsavelabel{\@MHcurrentlabel}%
+	\MHglobal at label{\@MHcurrentlabel}%
 	\if at MHleft\kern-\displaywidth\kern-0.2truecm\else\kern-0.2cm\fi}
 
 \def\@MHstep{\if at MHtag\else\if at MHuseminilab\stepcounter{MHCurrentCount}%
@@ -166,18 +178,18 @@
 
 \def\@MHnotag{\@MHhaslabfalse}
 
-\def\@saveMHComms{\@restoretag\let\MHsavecr=\\\let\\=\@MHcr\let\@saveref=\ref\let\ref=\@MHref%
-	\let\MHsavelabel=\label\let\label=\@MHlabel\let\@MHsavemult\multicol\let\@MHsavetag\notag\let\notag\@MHnotag%
-	\let\multicol\@MHspan\let\@MHsavetext\text\let\text\hbox\let\@MHsaveequation\theequation\let\theequation\@MHequation}
-\def\@restoreMHComms{\let\\=\MHsavecr\let\label=\MHsavelabel\@MHreset\let\ref=\@saveref%
-	\let\multicol\@MHsavemult\let\notag\@MHsavetag\let\text\@MHsavetext\let\theequation\@MHsaveequation\global\def\@MHequation{\@MHsaveequation}}
+\def\@saveMHComms{\@MHsaveglobals\@restoretag\let\\=\@MHcr\let\ref=\@MHref%
+	\let\label=\@MHlabel\let\notag\@MHnotag%
+	\let\multicol\@MHspan\let\text\hbox}
+\def\@restoreMHComms{\let\\=\MHsavecr\let\label=\MHglobal at label\@MHreset\let\ref=\MHglobal at ref%
+	\let\multicol\MHglobal at multicol\let\notag\MHglobal at notag\let\text\MHglobal at text}
 
 
 
-\def\@minilab#1{\let\MHsavelabel=\label%
+\def\@minilab#1{%
 	\@MHUseLab{#1}\@ifundefined{MHused@#1}%
 	{\@makelabel{#1}}{\@uselabel{#1}}%
-	\let\label=\MHsavelabel\egroup\global\@ignoretrue}
+	\let\label=\MHglobal at label\egroup\global\@ignoretrue}
 \def\minilab{\bgroup\MH at changecodes\@minilab}
 \def\@MHequation{\@MHsaveequation}
 



More information about the tex-live-commits mailing list.