\framed 和 \itemize 带有自定义项目标签

\framed 和 \itemize 带有自定义项目标签

这个问题是 这篇先前的文章尤其是@knut的回答。与该帖子中的情况不同,我为每个项目还设置了自己的自定义标签,即我的代码如下所示:

\begin{framed}
\begin{itemize}
  \item[(BulletLine1)]  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[(BulletLine2)] 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}

结果如下: 带框的物品

我怎样才能将自定义标签也放入盒子里面?

答案1

使用该enumitem包,您可以指定与项目化相关的各种长度,包括如下所示的itemindent

\documentclass{scrartcl} 
\usepackage{framed,enumitem} 
\begin{document}
\begin{framed}
The \textit{two-step} model of XMCD:
\begin{itemize}[itemindent=4em]
  \item[(BulletLine1)]  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[(BulletLine2)] 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}

在此处输入图片描述

或者,这leftmargin可能是您喜欢的方式:

\documentclass{scrartcl} 
\usepackage{framed,enumitem} 
\begin{document}
\begin{framed}
The \textit{two-step} model of XMCD:
\begin{itemize}[leftmargin=6em]
  \item[(BulletLine1)]  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[(BulletLine2)] 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}

在此处输入图片描述

答案2

以下是另外三种解决方案,最后两种可以实现自动编号:

\documentclass{scrartcl}

\usepackage{framed,enumitem}

\begin{document}

\begin{framed}
The \textit{two-step} model of XMCD:
\begin{itemize}[align = left]
  \item[(BulletLine1)] 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[(BulletLine2)] 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}

\begin{framed}
The \textit{two-step} model of XMCD:
\begin{enumerate}[label=(BulletLine\arabic*), align=left, leftmargin=*]
  \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{enumerate}
\end{framed}

\begin{framed}
The \textit{two-step} model of XMCD:
\begin{enumerate}[label=(BulletLine\arabic*), wide=0pt, leftmargin=2em]
  \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{enumerate}
\end{framed}

\end{document} 

在此处输入图片描述

相关内容