0

I would like to surround the item text of my customized list with some symbols (say, parentheses or brackets).

Here is a sample text.

\documentclass[12pt,a4paper]{article}
\usepackage{enumitem}
\newlist{ProofEnumDesc}{description}{2}
\setlist[ProofEnumDesc]{style=sameline}
\begin{document}
\begin{ProofEnumDesc}
\item[Case1] balabala
\item[Case2] xxxxx
\end{ProofEnumDesc}
\end{document}

Instead of being like

enter image description here

I want the output document to be

enter image description here

without changing the item text such as \item[Case1] to be \item[(Case1)].

Note that I hope to make this customized list flexible enough since more styles for the label text may be also be added in the future; therefore I tend not to modify the item text manually.

1 Answer 1

1

You have to define a new value to align key with the command \SetLabelAlign. Then you use it in your \setlist. Code:

\documentclass[10pt,a4paper]{article}
\usepackage[inline]{enumitem}

\SetLabelAlign{parenboth}{(#1)\hfil}
\newlist{ProofEnumDesc}{description}{2}
\setlist[ProofEnumDesc]{style=sameline,align=parenboth}

\begin{document}

\begin{ProofEnumDesc}
\item[Case1] Text
\item[Case2] Text
\end{ProofEnumDesc}

\end{document}

enter image description here

2
  • How can I get the document about this? I don't know how to search via texdoc. Commented Dec 15, 2016 at 12:10
  • 1
    @HongxuChen - Try texdoc texdoc to get the documentation to texdoc itself. Usually, you do texdoc <package name>, in this case texdoc enumitem. Commented Dec 15, 2016 at 13:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .