Why does \narrower not work in LaTeX as in plain TeX?
The difference is in the definition of \smallskip
(and the same for \medskip
and \bigskip
). Plain TeX defines
\def\smallskip{\vskip\smallskipamount}
while LaTeX does
\def\smallskip{\vspace\smallskipamount}
Now, \vskip
is a TeX primitive which ends the current paragraph when issued in (unrestricted) horizontal mode. On the other end, \vspace
is a LaTeX macro which expands on \vskip
when in vertical mode, and in \vadjust
otherwise. The paragraph in your first example is therefore not ended before the group is closed.
The fact that \narrower
is defined in LaTeX is incidental and should not be relied upon. It stems from the fact that the original LaTeX format was based on a slightly modified version of plain.tex
in order to ease transition from plain TeX documents to LaTeX ones.
campa has already explained the reason why \smallskip
works differently in LaTeX than in plain TeX. But the real solution is to define your own environment using LaTeX features such as \addvspace
, so two consecutive environments will not add twice the space and you don't need to manually add or remove \smallskip
in case.
\documentclass{article}
\newenvironment{latexnarrower}
{\par\addvspace{\smallskipamount}\narrower\noindent\ignorespaces}
{\par\addvspace{\smallskipamount}}
\begin{document}
This is a normal paragraph.
{\smallskip\narrower\noindent
This should be a narrower paragraph.
It was created using plain \TeX's ``narrower'' feature as described in the \TeX book.
but corrected for \LaTeX{} usage. And you see that it is indeed narrower, because
we added \verb|\par| at the end.\par\smallskip
}
{\smallskip\narrower\noindent
This should be a narrower paragraph.
It was created using plain \TeX's ``narrower'' feature as described in the \TeX book.
but corrected for \LaTeX{} usage. And you see that it is indeed narrower, because
we added \verb|\par| at the end.\par\smallskip
}
This is a normal paragraph, long enough to wrap across lines. Let's just make it
long enough. Perhaps this does the job.
\begin{latexnarrower}
This is a narrower paragraph.
It was created using a proper \LaTeX{} environment. Which is surely a better
way to do the job.
\end{latexnarrower}
\begin{latexnarrower}
This is a narrower paragraph.
It was created using a proper \LaTeX{} environment. Which is surely a better
way to do the job.
\end{latexnarrower}
This is a normal paragraph, long enough to wrap across lines. Let's just make it
long enough. Perhaps this does the job.
\end{document}
Can you spot the difference?
Even better you can use a list
so you can use other LaTeX features.
\documentclass{article}
\newenvironment{latexnarrower}
{\list{}{\topsep=\smallskipamount\leftmargin=\parindent\rightmargin=\parindent}\item}
{\endlist}
\begin{document}
This is a normal paragraph.
{\smallskip\narrower\noindent
This should be a narrower paragraph.
It was created using plain \TeX's ``narrower'' feature as described in the \TeX book.
but corrected for \LaTeX{} usage. And you see that it is indeed narrower, because
we added \verb|\par| at the end.\par\smallskip
}
{\smallskip\narrower\noindent
This should be a narrower paragraph.
It was created using plain \TeX's ``narrower'' feature as described in the \TeX book.
but corrected for \LaTeX{} usage. And you see that it is indeed narrower, because
we added \verb|\par| at the end.\par\smallskip
}
This is a normal paragraph, long enough to wrap across lines. Let's just make it
long enough. Perhaps this does the job.
\begin{latexnarrower}
This is a narrower paragraph.
It was created using a proper \LaTeX{} environment. Which is surely a better
way to do the job.
\end{latexnarrower}
\begin{latexnarrower}
This is a narrower paragraph.
It was created using a proper \LaTeX{} environment. Which is surely a better
way to do the job.
\end{latexnarrower}
This is a normal paragraph, long enough to wrap across lines. Let's just make it
long enough. Perhaps this does the job.
\begin{latexnarrower}
This is a narrower paragraph.
It was created using a proper \LaTeX{} environment. Which is surely a better
way to do the job.
\end{latexnarrower}
This is a normal paragraph, long enough to wrap across lines. Let's just make it
long enough. You see it has no indentation, because there was no blank line
between \verb|\end{latexnarrower}| and the following text.
\end{document}