Debian Codegraph @

texmf-dist/doc/latex/freealign/freealign.tex

raw
1 % -*- coding: utf-8 -*-
2 \documentclass[oneside,12pt]{article}
3 \usepackage[a4paper,margin=2cm]{geometry}
4
5 \newcommand*{\myversion}{2024A}
6 \newcommand*{\mydate}{Version \myversion\ (\the\year-\mylpad\month-\mylpad\day)}
7 \newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
8
9 \setlength{\parindent}{0pt}
10 \setlength{\parskip}{4pt plus 1pt minus 1pt}
11
12 \usepackage{freealign}
13 \usepackage{codehigh}
14 \usepackage{hyperref}
15 \hypersetup{
16 colorlinks=true,
17 urlcolor=blue3,
18 linkcolor=green3,
19 }
20
21
22 \begin{document}
23
24 \title{\textsf{\color{green3}FreeAlign: Align math formulas in different lines}}
25 \author{Jianrui Lyu ([email protected])}
26 \date{\mydate}
27 \maketitle
28
29 This package provides several commands for aligning math formulas in different lines.
30 Here is the first example:
31
32 \vskip1em\hrule
33 We have $(a+b)^2 \? = (a+b)(a+b)$ \\
34 \+$= a^2+2ab+b^2$\hfill$\cdots\cdots$2 points
35 \vskip0.6em\hrule\vskip0.5em
36 \begin{codehigh}
37 We have $(a+b)^2 \? = (a+b)(a+b)$ \\
38 \+$= a^2+2ab+b^2$\hfill$\cdots\cdots$2 points
39 \end{codehigh}
40
41 The \verb!\?! command \underline{inside} the first formula saves current horizontal position,
42 and the \verb!\+! command \underline{before} the second formula jumps to previously saved position.
43
44 Here is another example:
45
46 \vskip1em\hrule
47 We have \? $(a+b)^2 = (a+b)(a+b)$ \\
48 \< $= a^2+2ab+b^2$ \hfill$\cdots\cdots$2 points
49 \vskip0.6em\hrule\vskip0.5em
50 \begin{codehigh}
51 We have \? $(a+b)^2 = (a+b)(a+b)$ \\
52 \< $= a^2+2ab+b^2$ \hfill$\cdots\cdots$2 points
53 \end{codehigh}
54
55 The \verb!\?! command \underline{before} the first formula saves current horizontal position,
56 and the \verb!\<! command \underline{before} the second formula jumps to the left
57 of previously saved position by the width of $=$.
58
59 Because this package uses \verb!zref! package to save positions,
60 you need two compilations to get correct results.
61
62 \end{document}