答案1
\parbox
或环境minipage
可用于将垂直材料放入水平框中,如\fbox
或\framebox
:
\documentclass{article}
\begin{document}
\centering
\fbox{%
\parbox{20em}{I certify that the work presented in the dissertation is
my own unless referenced.}%
}
\medskip
\setlength{\fboxsep}{1em}
\fbox{%
\parbox{20em}{I certify that the work presented in the dissertation is
my own unless referenced.}%
}
\end{document}
填充由 dimen 寄存器控制\fboxsep
,框架的线宽由控制\fboxrule
。
答案2
另一个选择是使用tcolorbox
包可轻松为您提供框架,您可以在其中控制左侧、右侧、顶部和底部的单独填充以及许多其他属性。一个小例子:
\documentclass{article}
\usepackage[most]{tcolorbox}
\newtcolorbox{myframe}[1][]{
enhanced,
arc=0pt,
outer arc=0pt,
colback=white,
boxrule=0.8pt,
#1
}
\title{The Title}
\author{The Author}
\begin{document}
\begin{myframe}
I certify that the work presented in the dissertation is my own unless referenced.
\end{myframe}
\begin{myframe}[width=30em]
I certify that the work presented in the dissertation is my own unless referenced.
\end{myframe}
\begin{myframe}[width=30em,top=10pt,bottom=10pt,left=20pt,right=20pt]
I certify that the work presented in the dissertation is my own unless referenced.
\end{myframe}
\begin{myframe}[width=30em,top=20pt,bottom=20pt,left=20pt,right=20pt,arc=10pt,auto outer arc]
I certify that the work presented in the dissertation is my own unless referenced.
\end{myframe}
\end{document}