3

In the following MWE I would like to have automatically the labels of items shaped in bold and the colons added instead of being typed.

\documentclass[12pt]{article}
\usepackage{enumitem}

\begin{document}

\begin{itemize}
    \item[ALG :]
          méthode de type ALG-ébrique

    \item[ARI :]
          méthode de type ARI-thmétique

    \item[GÉO :]
          méthode de type GÉO-métrique
\end{itemize}

\end{document}
3

2 Answers 2

7

You could define a new list to do the formatting automatically by changing how \item behaves.

\documentclass[12pt]{article}
\usepackage{enumitem}
\let\olditem\item
\newlist{methods}{itemize}{1}
\setlist[methods]{%
    align=right,
    before=\changeitem,
    font=\bfseries,
    after=\let\item\olditem
}
\newcommand*{\changeitem}{%
    \renewcommand*{\item}[1][]{%
        \olditem[##1 :]
    }%
}
\begin{document}
\begin{methods}
    \item[ALG]
          méthode de type ALG-ébrique
    \item[ARI]
          méthode de type ARI-thmétique
    \item[GÉO]
          méthode de type GÉO-métrique
\end{methods}
\end{document}
1
  • Useful and versatile solution. I like that !
    – projetmbc
    Oct 27, 2020 at 20:25
3

Here is a completely different approach using a tabular:

enter image description here

\documentclass[12pt]{article}
\usepackage{array}

\begin{document}

\begin{tabular}{@{}>{\bfseries}r<{ :}@{~}l}
    ALG & méthode de type ALG-ébrique \\
    ARI & méthode de type ARI-thmétique\\
    GÉO & méthode de type GÉO-métrique\\
\end{tabular}

\renewcommand{\arraystretch}{1.5}
\begin{tabular}{@{}>{\bfseries}r<{ :}@{~}l}
    ALG & méthode de type ALG-ébrique \\
    ARI & méthode de type ARI-thmétique\\
    GÉO & méthode de type GÉO-métrique\\
\end{tabular}

\end{document}
1
  • Easy to use and to transform to an environment.
    – projetmbc
    Oct 27, 2020 at 20:25

You must log in to answer this question.

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