LaTeX's fantastic for writing out papers with mathematics and mathematical results in them, but I've never really learned how to use it to type up calculations, as one would write them on a piece of paper, or a blackboard.
TL;DR is there a "paragraph mode" for mathematics?
What I mean by this is, when I write out my calculations, I usually want them in a display style, that is, I want the larger integral and summation signs, and the larger fractions, I want the limits above and below the symbols, that sort of thing, as you would write maths on a blackboard or a piece of homework.
The problem is, if you're writing out calculations, I was always taught to write them like, essentially, individual paragraphs. I was to have them flush with the left margin and I was to leave a line (or at least, some space) between each line of my calculation.
Clearly, consecutive \[ ... \]
s are ill-suited to this and not just because of the centring. Suppose we have line 1, then line 2, and the left hand side of the = sign is different on each line, but then we wish to have an aligned equation, like this:
\[
36V^{2} = A^{2}x^{2} - 2Ax^{4}
\]
\[
V = \frac{1}{6}(A^{2}x^{2} - 2Ax^{4})^{\frac{1}{2}}
\]
\begin{flalign*}
\frac{dV}{dx} &= \frac{2A^{2}x - 8Ax^{3}}{12\sqrt{A^{2}x^{2} -
2Ax^{4}}} \\[12pt]
&= \frac{A^{2}x - 4Ax^{3}}{6\sqrt{A^{2}x^{2} - 2Ax^{4}}}
\end{flalign*}
How are we to ensure consistent spacing between each line?
Traditionally I have used a bit of a hack, with its own imperfections.
\documentclass[fleqn,12pt]{article}
\usepackage[parfill]{parskip}
\usepackage{amsmath}
\setlength{\mathindent}{0pt}
\begin{document}
$\begin{displaystyle}
36V^{2} = A^{2}x^{2} - 2Ax^{4} \\[12pt]
V = \frac{1}{6}(A^{2}x^{2} - 2Ax^{4})^{\frac{1}{2}}
\end{displaystyle}$
\begin{flalign*}
\frac{dV}{dx} &= \frac{2A^{2}x - 8Ax^{3}}{12\sqrt{A^{2}x^{2} -
2Ax^{4}}} \\[12pt]
&= \frac{A^{2}x - 4Ax^{3}}{6\sqrt{A^{2}x^{2} - 2Ax^{4}}}
\end{flalign*}
\end{document}
But I'm not longer confident this is ideal.
What I really want is:
- All lines flush with the left margin
- Perfectly consistent gap between all lines, including between single, independent lines of mathematics, each line in an aligned environment, the last independent single line and the first line of an aligned environment, and text
- Display style
- Ability to switch freely between aligned and unaligned maths and text
For example:
\documentclass[fleqn,12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{amsmath}
\usepackage{amssymb}
\setlength{\mathindent}{0pt}
\begin{document}
Let the volume of the container be denoted~$V$ and let the area be
denoted~$A$.
$\begin{displaystyle}
36V^{2} = A^{2}x^{2} - 2Ax^{4} \\[\parskip]
V = \frac{1}{6}(A^{2}x^{2} - 2Ax^{4})^{\frac{1}{2}}
\end{displaystyle}$
\begin{flalign*}
\frac{dV}{dx} &= \frac{2A^{2}x - 8Ax^{3}}{12\sqrt{A^{2}x^{2} -
2Ax^{4}}} \\[\parskip]
&= \frac{A^{2}x - 4Ax^{3}}{6\sqrt{A^{2}x^{2} - 2Ax^{4}}}
\end{flalign*}
\begin{flalign*}
\frac{dV}{dx} = 0 &\implies A^{2}x = 4Ax^{3} \\[\parskip]
&\implies x = 0 \text{ or } x^{2} = \frac{A}{4} \\[\parskip]
&\implies x = 0,\ \pm\frac{\sqrt{A}}{2}
\end{flalign*}
We discard $x = 0$ and $x = -\sqrt{A}/2$ since the length of the base
of the container can be neither 0 nor negative.
$\therefore$ $V$ is a maximum at $x = \sqrt{A}/2$.
\end{document}
What I'm aiming for is (in so far as possible) precisely this, but with perfectly even spacing between all lines and, if possible, a less ghastly source code. I mean \\[\parskip]
(or, until recently, \\[12pt]
) at the end of almost every line was okay before I read LaTeX: A Document Preparation System but now I feel like I must be doing something wrong!
\begin{displaystyle}
? Where did you find this?$\displaystyle ...$
but environment structures make the source code easier to understand than switches and it allows me to break lines and keep thedisplaystyle
going on and on and on over page breaks if necessary, which is what I want, really, I want a printed page that would look like a student's maths homework, or a professor's blackboard\displaystyle
is obeyed only in the single (sub)formula it's in.\[ ... \]
or something else? I never looked up anything different, because my hack worked, hence now asking the question$\begin{displaystyle} \frac{A}{B} = \frac{C}{D} \\[12pt] \frac{A}{B} = \frac{C}{D} \\[12pt] ... \frac{A}{B} = \frac{C}{D} \end{displaystyle}$
It will span page breaks if you have enough lines!