LaTexLearner wrote:Cool. It makes way more sense to define a new column type so I don't have to keep typing the same thing over and over again.
Yes. And it's more than saving typing! Because once you defined column types (and macros in general too) you can easily change things globally. For example, you like to change column alignment, or width because of page settings or font change, you can do it at this column definition place instead of all places in the document manually. That's the general advantage of macros.
LaTexLearner wrote:I understand the *purpose* of the code, but I can't make sense of the code itself. This is where I'm at:
- The {L} just names the new column.
- What does the [1] and the first ">"do?
- What is the p{#1} for?
- The "*3" part means three columns with the same properties, right?
Yes, L is the new column type. [1] means we got 1 argument, which is the column width in our case.
p{#1}
is a paragraph-column (that means it can break lines) with a certain width. #1 is the code for the argument 1, which is the width. We made
L
similar to the standard column
p
. I suggest look for
\newcommand
in a
LaTeX tutorial, it's worth learning this command.
LaTexLearner wrote:What did you mean by higher and lower level? And is consistent vertical spacing the only advantage of this higher level?
I mean, TeX is the basis and it's fine and correct. LaTeX builds on it with a lot of macros. They are designed to work well together. Whenever there's a LaTeX command and a TeX command, it's preferable to work with a LaTeX command (in LaTeX) because it's usually extended and consistent with all other LaTeX commands. TeX commands don't know about LaTeX commands. So, if LaTeX designs spacing between math environments, the TeX command doesn't know it. The LaTeX commands is designed with knowing other LaTeX commands. This is a general recommendation: on higher abstraction level, better stay at that level and only step to lower level (TeX, Assembler, machine code

) if really needed.
LaTexLearner wrote:PS I just tried changing $...$ to \[...\]. Will this always centre the math stuff?
For TeX's
$ ... $
the LaTeX code is
\( ... \)
. Note the parentheses. This is
inline math, that is, math formulas within normal text.
For TeX's
$$ ... $$
the LaTeX code is
\[ ... \]
. Here we have square brackets. This is
displayed math, that is, math formulas in their own paragraph, with space before and after it, and centered by default.
Actually those are shortcuts for
\begin{displaymath} ... \end{displaymath}
etc.
LaTexLearner wrote:And also, why is there a backslash before the final square bracket?
That's because they are commands, and commands begin with a backslash. We have exceptions, to reduce typing, such as the $ sign, which is a so called
active character. It has the meaning of a command.
Stefan