I'm looking for some way to annotate proofs line by line, as in the following:
statement = statement by theorem blah
= manipulated statement by this property
< something else by definition
etc (note, the equals and the "by"s should be aligned). Are tables the best way to do this, or is there an environment for this? If tables are the solution, I would love it if people could post some snippets of how to do this in a clean-looking way.
--
decitrig
Math & Science ⇒ line-by-line annotation for proofs?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
line-by-line annotation for proofs?
If the text represents math expressions, use the align environment from amsmath. However, be a bit more specific on what you want to do.
There's a reply that still awaits your reaction [1]. It is a matter of politeness to give feedback on provided solutions.
[1] View topic: Specify shorter author name for in-text citations?
Best regards
Thorsten
There's a reply that still awaits your reaction [1]. It is a matter of politeness to give feedback on provided solutions.
[1] View topic: Specify shorter author name for in-text citations?
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
line-by-line annotation for proofs?
Hi,
another option could be the alignat environment provided by amsmath:
another option could be the alignat environment provided by amsmath:
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat}{2}
A\cup(B\cap C) &= (A\cup B)\cap (A\cup C) &\quad &\text{by distributive law.}\\
&= (B\cup A)\cap (C\cup A) &&\text{by commutative law.}\\
&= (B\cap C)\cup A &&\text{by distributive law.}\\
\end{alignat}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
line-by-line annotation for proofs?
localghost wrote:If the text represents math expressions, use the align environment from amsmath. However, be a bit more specific on what you want to do.
There's a reply that still awaits your reaction [1]. It is a matter of politeness to give feedback on provided solutions.
[1] View topic: Specify shorter author name for in-text citations?
Best regards
Thorsten
OT indeed there is. Apologies, it slipped my mind. Fixing now.
line-by-line annotation for proofs?
That worked very well - stupid of me not to see that in the docs.
I did the following:localghost wrote:If the text represents math expressions, use the align environment from amsmath. However, be a bit more specific on what you want to do
Code: Select all
% how very contrived this example is
\begin{align}
x^n &= x\cdot x^{n-1} & \mbox{by algebra}
\end{align}
line-by-line annotation for proofs?
Using a double && for the last one should left-align it for you (just as gmedina is doing for alignat):
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
x^n &= x\cdot x^{n-1} && \mbox{by algebra} \\
x^n + 1 &= x\cdot x^{n-1} + 1 && \mbox{by more algebra} \\
x^n + 1 - n &= x\cdot x^{n-1} + 1 - n && \mbox{by even more algebra}
\end{align}
\end{document}