例如我用下面错误命令示范:
\fbox{The \textit{two-step} model of XMCD:
\begin{itemize}
\item[In the \textit{first step}, circularly polarized X-rays generate photoelectrons
with a spin and/or orbital momentum from a localized atomic inner shell.]
\item[In the \textit{second step}, the 3d shell serves as the detector of the spin or
orbital momentum of the photoelectron. For maximum effect, the photon spin needs to be
aligned with the magnetization direction.]
\end{itemize}
}
会报错或者出现一些奇怪的格式,并没有得到我们想要的。
我们将文字内容先用\parbox
括起来,就行了、
\fbox{\parbox{\textwidth}{The \textit{two-step} model of XMCD:
\begin{itemize}
\item In the \textit{first step}, circularly polarized X-rays generate photoelectrons with a spin and/or orbital momentum from a localized atomic inner shell.
\item In the \textit{second step}, the 3d shell serves as the detector of the spin or orbital momentum of the photoelectron. For maximum effect, the photon spin needs to be aligned with the magnetization direction.
\end{itemize}}}
编译效果如下:
注意不要使用[]
,当然边界应当注意下,可使用这个命令:\dimexpr\linewidth-2\fboxsep-2\fboxrule
\documentclass{scrartcl}
\usepackage{framed}
\begin{document}
\section{With parbox}
\fbox{\parbox{\textwidth}{The \textit{two-step} model of XMCD:
\begin{itemize}
\item In the \textit{first step}, circularly polarized X-rays generate photoelectrons with a spin and/or orbital momentum from a localized atomic inner shell.
\item In the \textit{second step}, the 3d shell serves as the detector of the spin or orbital momentum of the photoelectron. For maximum effect, the photon spin needs to be aligned with the magnetization direction.
\end{itemize}}}
\section{framed}
\begin{framed}
The \textit{two-step} model of XMCD:
\begin{itemize}
\item In the \textit{first step}, circularly polarized X-rays generate photoelectrons with a spin and/or orbital momentum from a localized atomic inner shell.
\item In the \textit{second step}, the 3d shell serves as the detector of the spin or orbital momentum of the photoelectron. For maximum effect, the photon spin needs to be aligned with the magnetization direction.
\end{itemize}
\end{framed}
\end{document}
对于自己的格式的灵活性,我建议多看看tcolorbox,mdframed或者甚至bclogo,从简单的框架一步步编辑自己的箱子。运行 texdoc tcolorbox,texdoc mdframed并mdframed bclogo看到很多选项。下面还有一些例子:
\documentclass{scrartcl}
\usepackage{microtype}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{tcolorbox}
\usepackage[tikz]{bclogo}
\usepackage{lipsum}
\begin{document}
\section{With tcolorbox}
\begin{tcolorbox}[
colframe=blue!25,
colback=blue!10,
coltitle=blue!20!black,
fonttitle=\bfseries,
adjusted title=The {\em two-step} model of XMCD:]
\begin{itemize}
\item In the \textit{first step}, circularly polarized X-rays generate photoelectrons with a spin and/or orbital momentum from a localized atomic inner shell.
\item In the \textit{second step}, the 3d shell serves as the detector of the spin or orbital momentum of the photoelectron. For maximum effect, the photon spin needs to be aligned with the magnetization direction.
\end{itemize}
\end{tcolorbox}
\section{With mdframed}
\begin{mdframed}[
linecolor=black!40,
outerlinewidth=1pt,
roundcorner=.5em,
innertopmargin=1ex,
innerbottommargin=.5\baselineskip,
innerrightmargin=1em,
innerleftmargin=1em,
backgroundcolor=blue!10,
%userdefinedwidth=1\textwidth,
shadow=true,
shadowsize=6,
shadowcolor=black!20,
frametitle={The \textit{two-step} model of XMCD:},
frametitlebackgroundcolor=cyan!40,
frametitlerulewidth=10pt
]
\begin{itemize}
\item In the \textit{first step}, circularly polarized X-rays generate photoelectrons with a spin and/or orbital momentum from a localized atomic inner shell.
\item In the \textit{second step}, the 3d shell serves as the detector of the spin or orbital momentum of the photoelectron. For maximum effect, the photon spin needs to be aligned with the magnetization direction.
\end{itemize}
\end{mdframed}
\section{With bclogo}
\renewcommand\logowidth{16pt}
\begin{bclogo}[
couleur = blue!10,
marge=20,
cadreTitre = true,
arrondi = 0.3,
epBarre=3.5,
logo = \bcnucleaire,
couleurBarre = red!80!blue!60,
ombre=true,
couleurOmbre = blue!20!black!20,
]
{The \textit{two-step} model of XMCD:}
\bigskip
\begin{itemize}
\item In the \textit{first step}, circularly polarized X-rays generate photoelectrons with a spin and/or orbital momentum from a localized atomic inner shell.
\item In the \textit{second step}, the 3d shell serves as the detector of the spin or orbital momentum of the photoelectron. For maximum effect, the photon spin needs to be aligned with the magnetization direction.
\end{itemize}
\end{bclogo}
\end{document}
参考文献:
【1】texexchange 盒子的定制