在 mdframe 中逐项列出

在 mdframe 中逐项列出

我想在 mdframed 环境中放置一个对话。

\documentclass{article}

\usepackage{mdframed}

\newenvironment{dwf}
{
    \begin{mdframed}[linewidth=0.5pt,
    linecolor=black,
    roundcorner=0pt,
    frametitlerule=false,
    frametitle={}
    ]
}
{
    \end{mdframed}
}

\begin{document}

See the following dialogue.
\begin{dwf}
    \begin{itemize}
        \item[Teacher A:] How looks this sentence?
        \item[Teacher B:] Oh. Your name is crossed by the frame line.
        \item[Teacher A:] Yours Too.
    \end{itemize}
\end{dwf}

\end{document}

输出

我该怎么办?

附言:我正在使用 XeLaTeX

答案1

您可以加载该enumitem包并使用align=left

\documentclass{article}

\usepackage{mdframed}
\usepackage[shortlabels]{enumitem}    
\newenvironment{dwf}
{
    \begin{mdframed}[linewidth=0.5pt,
    linecolor=black,
    roundcorner=0pt,
    frametitlerule=false,
    frametitle={}
    ]
}
{
    \end{mdframed}
}

\begin{document}

See the following dialogue.
\begin{dwf}
    \begin{itemize}[align=left]
        \item[Teacher A:] How looks this sentence?
        \item[Teacher B:] Oh. Your name is crossed by the frame line.
        \item[Teacher A:] Yours Too.
    \end{itemize}
\end{dwf}

\end{document}

在此处输入图片描述

相关内容