How can I have a an environment similar to Strunk's The Elements of Style:
-
1Please be a bit more precise about your needs. Do you want to replicate each and every stylistic aspect (including font family, and font shape and weight) of the screenshot you posted? If not, which stylistic elements are the ones you care about? What have you tried so far?– MicoNov 13, 2014 at 12:10
4 Answers
Here's the environment, actually three:
\documentclass[twocolumn]{article}
\usepackage{mathpazo}
\usepackage{xcolor}
\newsavebox{\strunkbox}
\newenvironment{strunk}
{\begin{lrbox}{\strunkbox}
\begin{minipage}{.8\columnwidth}}
{\end{minipage}\end{lrbox}\begin{center}
\setlength{\fboxrule}{1pt}
\leavevmode\color{red}
\fbox{\usebox{\strunkbox}}
\end{center}}
\newenvironment{swrong}
{\addvspace{2ex}\begin{minipage}[t]{.45\textwidth}\footnotesize}
{\end{minipage}\ignorespacesafterend}
\newenvironment{sright}
{\hfill\begin{minipage}[t]{.45\textwidth}\footnotesize}
{\end{minipage}\par}
\begin{document}
Words that intervene between subject and verb do not affect the number of the verb.
\begin{strunk}
\begin{swrong}
The bittersweet flavor of youth---its trials, its joys,
its youth---are not soon forgotten
\end{swrong}
\begin{sright}
The bittersweet flavor of youth---its trials, its joys,
its youth---is not soon forgotten
\end{sright}
\end{strunk}
A common blunder is the use of a singular verb form in a relative clause
following ``one of\ldots'' or a similar expression when the relative is the
subject.
\begin{strunk}
\begin{swrong}
One of the ablest scientists who has attacked this problem
\end{swrong}
\begin{sright}
One of the ablest scientists who have attacked this problem
\end{sright}
\begin{swrong}
One of those people who is never ready on time
\end{swrong}
\begin{sright}
One of those people who are never ready on time
\end{sright}
\end{strunk}
Use a singular verb form after \emph{each, either, everyone, everybody,
neither, nobody, someone}.
\end{document}
Don't leave blank lines between \end{swrong}
and \begin{sright}
.
-
-
1
-
@WChargin More semantic. Maybe Strunk decided to put on the right the correct construct on purpose.
;-)
Or maybe I should name the subenvironmentscorrect
. Actually I wanted to name themwrong
andright
, but the latter can't be used.– egregNov 13, 2014 at 20:53 -
-
1@blackened Another reason for suggesting my friends not to use LyX, thanks.
;-)
– egregNov 19, 2014 at 21:40
Rather than as an environment, I create \strunk{}{}
for the task. It will not break across page breaks. I have limited \textwidth
here, instead of using columns. The \strunk
macro will occupy 85% of \textwidth
, plus the red border.
\documentclass{article}
\usepackage{xcolor}
\parskip 1ex
\textwidth 3in
\parindent 0in
\fboxrule 3pt
\newcommand\strunk[2]{%
\par{\centering
\color{red}{\fbox{\color{black}\scriptsize
\begin{minipage}[t]{.4\textwidth}
\parskip 1em
\raggedright#1
\end{minipage}
\hspace{.05\textwidth}
\begin{minipage}[t]{.4\textwidth}
\parskip 1em
\raggedright#2
\end{minipage}
}}
\par}
}
\begin{document}
Words that intervene between subject and verb do not affect the number of the verb.
\strunk
{The bittersweet flavor of youth---its trials, its joys, its youth---are not soon
forgotten}
{The bittersweet flavor of youth---its trials, its joys, its youth---is not soon
forgotten}
A common blunder is the use of a singular verb form in a relative clause
following ``one of\ldots'' or a similar expression when the relative is the
subject.
\strunk
{One of the ablest scientists who has attacked this problem
One of those people who is never ready on time}
{One of the ablest scientists who have attacked this problem
One of those people who are never ready on time}
Use a singular verb form after \textit{each, either, everyone, everybody,
neither, nobody, someone}.
\end{document}
-
Thank you very much, Steven. In my question I forgot to mention that the red border was just for emphasis. I am working in LyX, and the first part of your example (first box) works fine when I insert your code as “Tex Code”, but the second one does not work. (I am guessing that a problem with inserting Tex code in LyX.) Nov 13, 2014 at 14:44
Another solution for those (like me) who doesn't manage low level commands like egreg and Steven. It uses tcolorbox
and its possibility of arranging two texts side by side. strunk
is an environment instead of a command
but I hope it doesn't matter.
\documentclass[twocolumn]{article}
\usepackage[most]{tcolorbox}
\usepackage{mathpazo}
\newtcolorbox{strunk}{notitle, colback=white, colframe=red, width=.9\linewidth,
arc=0pt, outer arc=0pt,
sidebyside, lower separated=false, sidebyside align=top, sidebyside gap=4mm,
before={\par\smallskip\pagebreak[0]\parindent=0pt\centering},
after={\par\smallskip},
fontupper=\small, fontlower=\small,
boxsep=0mm,
left=2mm, right=2mm, top=2mm, bottom=2mm,
}
\begin{document}
Words that intervene between subject and verb do not affect the number of the verb.
%
\begin{strunk}
{The bittersweet flavor of youth---its trials, its joys, its youth---are not soon
forgotten}\tcblower
{The bittersweet flavor of youth---its trials, its joys, its youth---is not soon
forgotten}
\end{strunk}
A common blunder is the use of a singular verb form in a relative clause
following ``one of\ldots'' or a similar expression when the relative is the
subject.
\begin{strunk}
{One of the ablest scientists who has attacked this problem\\
One of those people who is never ready on time}\tcblower
{One of the ablest scientists who have attacked this problem\\
One of those people who are never ready on time}
\end{strunk}
Use a singular verb form after \textit{each, either, everyone, everybody,
neither, nobody, someone}.
\end{document}
-
-
Ups! you're right. I didn't notice the indentation. But I neither don't know how to do it.– IgnasiNov 20, 2014 at 7:49
-
@egreg:
parskip
packages does it, but it also suppresses first paragraph indentation.– IgnasiNov 21, 2014 at 20:11 -
Just use
after=
instead ofafter=\par\smallskip
if there should be no new paragraph (i.e. no indention) aftertcolorbox
... Dec 5, 2014 at 14:23 -
@ThomasF.Sturm But without
after=\par
, initialcentering
doesn't work andbegin{center}...\end{center}
introduces undesired vertical space before and after the box.– IgnasiDec 5, 2014 at 18:09
Here's another tcolorbox
alternative in two variants.
The first one builds upon the answer of @Ignasi. I polished it at some spots, especially to answer the indention questions which came up in the comments:
\documentclass[twocolumn]{article}
\usepackage[skins]{tcolorbox}
\usepackage{mathpazo}
\newtcolorbox{strunk}{colback=white,colframe=red,
width=.9\linewidth,
size=fbox,boxrule=2pt,
sharp corners,lower separated=false,
sidebyside,sidebyside align=top,
sidebyside gap=4mm,
before={\begin{center}},
after={\end{center}},
fontupper=\small, fontlower=\small,
}
\begin{document}
Words that intervene between subject and verb do not affect the number of the verb.
%
\begin{strunk}
The bittersweet flavor of youth---its trials, its joys, its youth---are not soon
forgotten.
\tcblower
The bittersweet flavor of youth---its trials, its joys, its youth---is not soon
forgotten.
\end{strunk}
A common blunder is the use of a singular verb form in a relative clause
following ``one of\ldots'' or a similar expression when the relative is the
subject.
\begin{strunk}
One of the ablest scientists who has attacked this problem\bigskip
One of those people who is never ready on time
\tcblower
One of the ablest scientists who have attacked this problem\bigskip
One of those people who are never ready on time
\end{strunk}
Use a singular verb form after \textit{each, either, everyone, everybody,
neither, nobody, someone}.
\end{document}
Since the OP mentioned that the red borders are not really intended to appear in the document, here is a second variant without borders:
\documentclass[twocolumn]{article}
\usepackage[skins]{tcolorbox}
\usepackage{mathpazo}
\newtcolorbox{strunk}{blanker,
width=.9\linewidth,
sharp corners,lower separated=false,
sidebyside,sidebyside align=top,
sidebyside gap=4mm,
before={\begin{center}},
after={\end{center}},
fontupper=\small, fontlower=\small,
}
\begin{document}
Words that intervene between subject and verb do not affect the number of the verb.
%
\begin{strunk}
The bittersweet flavor of youth---its trials, its joys, its youth---are not soon
forgotten.
\tcblower
The bittersweet flavor of youth---its trials, its joys, its youth---is not soon
forgotten.
\end{strunk}
A common blunder is the use of a singular verb form in a relative clause
following ``one of\ldots'' or a similar expression when the relative is the
subject.
\begin{strunk}
One of the ablest scientists who has attacked this problem
\tcblower
One of the ablest scientists who have attacked this problem
\end{strunk}
\begin{strunk}
One of those people who is never ready on time
\tcblower
One of those people who are never ready on time
\end{strunk}
Use a singular verb form after \textit{each, either, everyone, everybody,
neither, nobody, someone}.
\end{document}