summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/correctmathalign/doc/correctmathalign.tex
blob: eaa7dcf562a22f9a83fa1a392c127b45df3c79ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
\documentclass{article}

\usepackage{graphicx}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{correctmathalign}

\title{Correction Spacings: eqnarray(*), aligned, alignedat, and gathered}
\author{Yuwsuke Kieda}
\date{2017/04/04 v1.1}

\renewcommand\labelitemi{\textendash}

\begin{document}
\maketitle

\section{Descriptions}

We will realignment some expression environments spacing.
It is a correction in the horizontal spacing of the alignment.

\section{Usage}

\subsection{Preamble}

\begin{verbatim}
\usepackage{amsmath}
\usepackage{correctmathalign}
\end{verbatim}

Remark: amsmath package is optional: if you use aligned, alignedat, or gathered environments.

Remark: The problem with the amsmath package (2016/11/05 2.16a) was solved by the original. See the options \texttt{alignedleftspaceyes}, \texttt{alignedleftspaceno}, and \texttt{alignedleftspaceyesifneg}.
We dealt with versions prior to 2016/03/10 v2.15b.

\subsection{Options}

\begin{itemize}
 \item \verb!latexorg!: original behavior of LaTeX/amsmath package
 \item \verb!fleqn!: corresponds to class file and/or amsmath package's fleqn option
\end{itemize}

\section{File with Original Definitions}

\begin{itemize}
 \item \verb!eqnarray!: latex.ltx
 \item \verb!\start@aligned! and \verb!\gathered!: amsmath.sty (before 2016/03/10 v2.15b)
\end{itemize}

\section{License}

BSD 2-Clause License

\section{Samples}

Cf.\ defaults of \LaTeX{}\ and \texttt{amsmath.sty} before 2016/03/10 v2.15b (Figures~\ref{fig1} and~\ref{fig2}).

\setbox9\hbox{Figure 1: \texttt{eqnarray*} environment}%
\setbox8\hbox{Figure 2: \texttt{aligned} environment}%
\begin{figure}
 \centering
 \begin{minipage}[t]{\wd9}
  \centering
  \includegraphics{eqnarray-org.pdf}
  \caption{\texttt{eqnarray*} environment by \LaTeX{}\ default.}
  \label{fig1}
 \end{minipage}\qquad
 \begin{minipage}[t]{\wd8}
  \centering
  \includegraphics{aligned-org.pdf}
  \caption{\texttt{aligned} environment by \texttt{amsmath.sty} default (before 2016/03/10 v2.15b).}
  \label{fig2}
 \end{minipage}
\end{figure}

\noindent
\begin{center}
 \makeatletter\@wholewidth0pt\makeatother
 \frame{%
 \begin{minipage}{\wd9}
  \[
  \mathrm{I} = \mathrm{H}(x + 1)
  \]
  \begin{eqnarray*}
   \mathrm{I} &=& \mathrm{H}(x)\\
   &=& \mathrm{H}(x + 1)
  \end{eqnarray*}
 \end{minipage}}\qquad
 \frame{%
 \begin{minipage}{\wd8}
  \begin{align*}
   \mathrm{I} & \begin{aligned}[t]
                 &= \mathrm{H}(x)\\
                 &= \mathrm{H}(x + 1)
                \end{aligned}\\
   \mathrm{I} &= \mathrm{H}(x)\\
   &= \mathrm{H}(x + 1)
  \end{align*}
 \end{minipage}}
\end{center}


\subsection{Use \LaTeX{}\ code}

\begin{verbatim}
\[
 \mathrm{I} = \mathrm{H}(x + 1)
\]
\begin{eqnarray*}
 \mathrm{I} &=& \mathrm{H}(x)\\
            &=& \mathrm{H}(x + 1)
\end{eqnarray*}

\begin{align*}
 \mathrm{I} & \begin{aligned}[t]
               &= \mathrm{H}(x)\\
               &= \mathrm{H}(x + 1)
              \end{aligned}\\
 \mathrm{I} &= \mathrm{H}(x)\\
            &= \mathrm{H}(x + 1)
\end{align*}
\end{verbatim}

\end{document}