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}
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}
| improve this answer | |
  • Useful and versatile solution. I like that ! – projetmbc Oct 27 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}
| improve this answer | |
  • Easy to use and to transform to an environment. – projetmbc Oct 27 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.