diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/mhequ/example.tex |
Initial commit
Diffstat (limited to 'macros/latex/contrib/mhequ/example.tex')
-rw-r--r-- | macros/latex/contrib/mhequ/example.tex | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/macros/latex/contrib/mhequ/example.tex b/macros/latex/contrib/mhequ/example.tex new file mode 100644 index 0000000000..c0eca63f65 --- /dev/null +++ b/macros/latex/contrib/mhequ/example.tex @@ -0,0 +1,94 @@ +\documentclass{article} +\usepackage{mhequ} + +\def\eref#1{(\ref{#1})} + +\textwidth 13cm +\textheight 22cm +\oddsidemargin 0.2cm +\topmargin 0.3cm +\pagestyle{empty} + +\begin{document} + +\title{Using the mhequ package} +\author{Martin Hairer} +\date{Version 1.7, \today} +\maketitle +\thispagestyle{empty} + +\label{mySec} +Here is a simple labelled equation: +\begin{equ}[onelab] + \sum_{i=1}^5 X_i^j X^j_i = y^j \;. +\end{equ} +Removing or adding the label does not require a change of environment: +\begin{equ} + \sum_{i=1}^5 X_i^j X^j_i = y^j \;. +\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{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} +using only a very small modification in the syntax. 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} +Let us make a first group: +\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 \texttt{\string\tag} +command +\begin{equ}[mylabel] + x = y\;. \tag{$\star$} +\end{equ} +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 like +\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}, like so +\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 |