在多列列表中局部禁用连字符

在多列列表中局部禁用连字符

如何在以下逐项列表中局部禁用连字?我只想在文档中的特定列表中禁用它。

\documentclass[12pt,letterpaper]{article}

\usepackage{enumitem}
\usepackage{multicol}

\begin{document}

\section*{Section 01}
\begin{multicols}{2}
    \begin{itemize}[noitemsep,nolistsep]
        \item this is a description of item number one in the list. I would like to locally disable hyphenation in the list.
        \item item 2
        \item item 3
        \item item 4
        \item item 5
    \end{itemize}
\end{multicols}
\end{document}

这是输出。

在此处输入图片描述

答案1

\raggedright一种选择是在环境内部使用(按照要求保持本地效果):

\documentclass[12pt,letterpaper]{article}

\usepackage{enumitem}
\usepackage{multicol}

\begin{document}

\section*{Section 01}
\begin{multicols}{2}
    \begin{itemize}[noitemsep,nolistsep]
    \raggedright
        \item this is a description of item number one in the list. I would like to locally disable hyphenation in the list.
        \item item 2
        \item item 3
        \item item 4
        \item item 5
    \end{itemize}
\end{multicols}
\end{document}

在此处输入图片描述

作为芭芭拉·比顿提及她的评论ragged2e,这可能看起来比实际的“太粗糙”了;使用包及其命令可以获得更好的结果\RaggedRight;但是,由于默认情况下 \RaggedRight 允许连字符,因此\RaggedRightRightskip需要重新定义以按要求抑制连字符:

\setlength\RaggedRightRightskip{0pt plus 1fil}

以下示例显示了标准\raggedright\RaggedRight无连字符之间的比较:

\documentclass[12pt,letterpaper]{article}

\usepackage{enumitem}
\usepackage{multicol}
\usepackage{ragged2e}

\setlength\RaggedRightRightskip{0pt plus 1fil}

\begin{document}

\section*{Section 01}
\begin{multicols}{2}
    \begin{itemize}[noitemsep,nolistsep]
    \raggedright
        \item this is a description of item number one in the list. I would like to locally disable hyphenation in the list.
        \item item 2
        \item item 3
        \item item 4
        \item item 5
    \end{itemize}
\end{multicols}
\begin{multicols}{2}
    \begin{itemize}[noitemsep,nolistsep]
    \RaggedRight
        \item this is a description of item number one in the list. I would like to locally disable hyphenation in the list.
        \item item 2
        \item item 3
        \item item 4
        \item item 5
    \end{itemize}
\end{multicols}
\end{document}

在此处输入图片描述

相关内容