How can I explain the concept of "separation of contents and presentation" to a "computer-illiterate" LaTeX user?

So there's this idea of logical structure, so you set up structures like: a quote, a section head, something emphasised, the title of a work, and so on and so forth. And then, rather than decorating your text as you go, with italicisation, emboldening, enlarging, centering, and so on and so forth, you say: this is a quote, this is a section head, etc. etc.

And then, if you want to change the way quotes look globally, you can do it by editing the definition of the structure (nice and easy) and you can guarantee that all of your quotes will look the same, all of your section heads will look the same, and so on and so forth.

So you learn to plan out your document as a series of logical units and then let the machine deal with the legwork of applying the formatting each and every time. This is good for consistency, it saves you a job, but it also helps you think about the role of what you're writing in your document. I think that should resonate quite well with a mathematician.

Now another benefit of this is not necessarily obvious from simple structures, which might require just an italicisation. Is typing \textit{Harry Potter and the Philosopher's Stone} really any harder or more cumbersome than defining a command for book titles such as:

\newcommand{\work}[1]{\textit{#1}}

And then typing \work{Harry Potter and the Philosopher's Stone}?

Probably not. But if you have a complex structure, such as a section head, you can subsume a whole load of formatting into a single definition, which, ideally, will have a name that means something. So, say I'm writing a speech and I want to typeset optional material in italics and in a smaller font, and with indentation on both sides. I can have

\newenvironment{optional}{\begin{quote}\small\em}{\end{quote}}

And then I can use

\begin{optional}
  Which leads me on nicely ...
\end{optional}

And if I have ten of these, not only is the source code nice and clear (I have called the environment optional, so I know what it does), I've also saved myself tapping out:

\begin{quote}\small\em
\end{quote}

Every time, there's no danger of me forgetting to make it small, and if I suddenly decide I want my optional stuff set in sans-serif, rather than italics, I make one change and it applies globally.

A lot of people don't realise that long, cumbersome commands like \textit{} \textsuperscript{} are not necessarily meant to be used long-form every time, but are the building blocks out of which you construct commands that do exactly what you want for the various structures in your document, which may or may not be slightly quicker to type. The commands are given names which make them easy to remember and make it obvious what they do. This is helpful in constructing commands for yourself, but (even with the best of editors) can be a bit of a pain in multiple body parts if you're typing them out every time you want to do a little formatting.


I'm not much of a mathematician, and I feel like this is a fairly tenuous analogy, but I feel it's not so different to a mathematician defining a notation or assigning something a variable.

So, for example, I might say: Let the line from (2, 3) to (3, 6) be denoted l.

And then I can say, let the gradient of l be denoted m.

So I've defined this object l, and then I go on to use l everywhere in my argument, rather than writing out "the line from (2, 3) to (3, 6)" each time.

So I think this is a bit like me defining a command

\newcommand{\nb}[1]{{\Large \textbf{#1}}} %Command not recommended due to ugliness

And then using \nb{...} throughout my document.

How so? Well, I think of it as like giving LaTeX a definition at the start, and then every time it sees \nb{...} it knows that I mean "large and bold". But I just have to use the shorthand \nb{...}, instead of typing out the full definition each time. So instead of typing out {\Large \textbf{}} each time, I just use \nb{...} which I defined at the beginning.

A bit like, instead of writing out "the line from (2, 3) to (3, 6)" every time, I just use l, which I defined a the beginning. And the reader, like LaTeX, knows to substitute the definition I gave, but I save on the amount of typing/writing I have to do.


The title of the question is wrong if one look at the example given in the question. On could discuss semantical markup by comparing \emph with \textit, but not for \emph versus \mathit. This is misusing mathmode to output something that should be written in textmode and will give a wrong output in quite a number of cases. It is like writing l when one want a 1, or O instead of 0.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\begin{description}
\item[Accents] $\mathit{Poincaré}$ vs. \emph{Poincaré}
\item[Punctuation] $\mathit{Noether's}$ vs. \emph{Noether's}
\item[More punctuation] $\mathit{:?!,}$ vs. \emph{:?!,}
\item[Quotes] $\mathit{``Gauss''}$ vs. \emph{``Gauss''}
\item[other text fonts] {\sffamily $\mathit{regular}$ vs. \emph{regular}},
{\bfseries $\mathit{regular}$ vs. \emph{regular}}
\end{description}

\end{document}

enter image description here