至于方法多种多样,但大多数都需要严格的设置才能将一段文字嵌入到一个方框或者一个双线框的框架中,我尝试使用单个命令来达到效果。
但是,如图所示,fancybox 中的“doublebox”命令无法将文字换行到段落中。至于“framed”命令,它并没有提供“双线”框架,而是将段落换行。
是否有其他命令或对当前代码进行轻微修改以将段落扭曲为双线框架(框)?
\documentclass[11pt]{article}
\usepackage{fancybox,framed}
\begin{document}
\doublebox{Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets—has grown from a niche area of microeconomics to a key component of economics.}\\
\begin{framed}
Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets—has grown from a niche area of microeconomics to a key component of economics.
\end{framed}
\end{document}
答案1
\documentclass[11pt]{article}
\usepackage{fancybox,framed}
\begin{document}
\doublebox{%
\begin{minipage}{4in}
Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets—has grown from a niche area of microeconomics to a key component of economics.
\end{minipage}}\\
\begin{framed}
Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets—has grown from a niche area of microeconomics to a key component of economics.
\end{framed}
\end{document}
答案2
这是一个tcolorbox
版本(带有“最小”选项)和一些使用示例
\documentclass[11pt]{article}
\usepackage[most]{tcolorbox}
\newtcolorbox{tcbdoublebox}[1][]{%
enhanced jigsaw,
sharp corners,
colback=white,
borderline={1pt}{-2pt}{black},
fontupper={\setlength{\parindent}{20pt}},
#1
}
\begin{document}
%\doublebox{Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets—has grown from a niche area of microeconomics to a key component of economics.}\\
\begin{tcbdoublebox}
Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets has grown from a niche area of microeconomics to a key component of economics.
\end{tcbdoublebox}
\begin{tcbdoublebox}[drop shadow]
Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets has grown from a niche area of microeconomics to a key component of economics.
\end{tcbdoublebox}
\begin{tcbdoublebox}[title={With a title}]
Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets has grown from a niche area of microeconomics to a key component of economics.
\end{tcbdoublebox}
\begin{tcbdoublebox}[colback={white!40!yellow}]
Over the past twenty years, the study of industrial organization—the analysis of imperfectly competitive markets has grown from a niche area of microeconomics to a key component of economics.
\end{tcbdoublebox}
\end{document}