我怎样才能拥有类似于 Strunk 的环境风格的要素:
答案1
这是环境,实际上有三个:
\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}
\end{swrong}
和之间不要留空行\begin{sright}
。
答案2
而不是作为环境,我\strunk{}{}
为任务创建。它不会跨分页符中断。我\textwidth
在这里进行了限制,而不是使用列。\strunk
宏将占据 的 85% \textwidth
,加上红色边框。
\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}
答案3
对于那些(像我一样)无法管理的人来说,另一个解决方案低级命令,如 egreg 和 Steven。它使用tcolorbox
以及将两个文本并排排列的可能性。strunk
是一个环境而不是command
但我希望这没关系。
\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}
答案4
以下是另外tcolorbox
两种替代方案。
第一个是基于@Ignasi的回答。我在一些地方对其进行了润色,尤其是回答了评论中出现的缩进问题:
\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}
由于 OP 提到红色边框实际上并不打算出现在文档中,因此这里是没有边框的第二种变体:
\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}