# Tag Info

26

A variation on egreg's answer to Working with margins \documentclass{article} \usepackage{enumitem} \usepackage{environ} \newlength\widest \makeatletter \NewEnviron{ldescription}{% \vbox{% \global\setlength\widest{0pt}% \def\item[##1]{% \settowidth\@tempdima{\textbf{##1}}% \ifdim\@tempdima>\widest\global\setlength\widest{\@tempdima}...

26

You don't need the before key; just revert to \normalfont for the label and apply \itshape; by using [description] as optional argument to \setlist only this environment will be affected. For the bullet, you can easily do it by slightly abusing the font key: \documentclass[12pt,a4paper]{article} \usepackage{enumitem} \begin{document} \setlist[description]{...

22

This approach automatically orders the items by year or any other number, by using an external list on an .csv file. \documentclass{article} \usepackage{filecontents} % To create an external .csv file \begin{filecontents}{\jobname.csv} Order, Text 1912, Something good happened. 1923, Something bad happened. 1901, Something terrible happened. \end{...

21

You can use the itemization function (https://www.sharelatex.com/learn/Lists) \begin{itemize} \item one. \item two. \item three. \end{itemize} And the output:

15

Just use \mbox, as said, or add a first empty item (\item[]) in the itemize environment. The vertical spacing is better in the second case, in my opinion. documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \begin{document} \begin{description} \item[foo bar foo bar] \begin{itemize} \item[] ...

15

Updated version After the edit with the question, I propose a different approach here not using a list to place the labels but reducing the width for the tcolorbox and using an optional argument (it could easily be turned into mandatory) and the overlay key to place the label at a fixed vertical position; since the label is placed inside a node of fixed ...

14

Just to add to @Werner's excellent answer: If you have very long labels in a description environment, sometimes it actually looks nicest to have the text wrap underneath the start of the labels, like so: \documentclass{article} \usepackage{enumitem}% http://ctan.org/pkg/enumitem \begin{document} \begin{description}[style=unboxed,leftmargin=0cm] \item[A)] ...

14

You can modify the indention with \setbeamersize{description width=0.57cm}, just play around to whatever value you need. \documentclass[14pt,handout]{beamer} \setbeamersize{description width=0.57cm} \begin{document} \begin{frame}\frametitle{} \begin{description} \item[FooBarBazZot] - foo bar \\ baz zot \end{description} \end{frame} \end{document}

12

You could make use of the glossaries package as shown in the following example: \documentclass{article} \usepackage[automake, nonumberlist]{glossaries} \newglossaryentry{1912}{name={1912}, description={Something good happened}} \newglossaryentry{1923}{name={1923}, description={Something bad happened}} \newglossaryentry{1901}{name={1901}, description={...

11


10

I propose this, with the help of the framed package, slightly tweaking the leftbar environment. If you don't want grey lines, it's easy to remove the colour. Using xparse, I define a \course command, with $3$ mandatory arguments. A star version adds a left bar that can beak across pages: \documentclass{article} \usepackage{lipsum} \usepackage{framed, xcolor,...

10

If you prefer the solution to be as close to your syntax as possible: \documentclass{article} \usepackage{expl3} \usepackage{xparse} \usepackage{enumitem} \usepackage{xcolor} \begin{document} \ExplSyntaxOn \seq_new:N \l_item_seq \DeclareDocumentCommand{\oitem}{om}{ \IfValueTF{#1} {\int_set:Nn \l_tmpa_int {#1}} {\int_set:Nn \l_tmpa_int {0}} \...

8

The parameter labelsep gives the distance between the label and the following text. \documentclass{article} \usepackage{showframe} \usepackage{enumitem} \usepackage{lipsum} \pagestyle{empty} \begin{document} \begin{description}[labelsep=1em] \item[first matter] \lipsum[1] \item[some other matter] \lipsum[1] \end{description} \end{document} Note how I use ...

8

If i did understand you correctly, the labeling environment provided by the KOMA-script package does the job you want: \documentclass[12pt,a4paper]{article} \usepackage{scrextend} \usepackage{blindtext} \setkomafont{labelinglabel}{\bfseries} \usepackage{showframe} \begin{document} \begin{labeling}{A long long label}%Giving the longest label for alignment ...

8

As beamer does not like the package enumitem, you will have to define your own "description item". % arara: pdflatex \documentclass[handout]{beamer} \defbeamertemplate{description item}{align left}{\insertdescriptionitem\hfill} \begin{document} \begin{frame} \frametitle{Analyse: Ziele laut Pflichtenheft} \setbeamertemplate{description ...

8

In his answer, egreg has explained the problems with your current definition and a way to ammend it. However, I'd suggest you to use the nextline style for desciption offered by the enumitem package: \documentclass{book} \usepackage{enumitem} \setlist[description]{style=nextline} \begin{...

8

Just adding to Christian's answer: to use the unit macros inside the \si{unit} command defined by siunitx such as \metre and \kilo\watt used in his MWE, one should add the command \glssetnoexpandfield{unit} before setting any entries. It is better explained in This Answer.

8

Here are two ways: \documentclass{article} \usepackage{enumitem} \usepackage{calc} \begin{document} \begin{description}[labelwidth =\widthof{\bfseries9999}, leftmargin = !] \item[1987]Something really exciting happened in that year, but I’m not sure exactly what. \item[1990]Bar \end{description} \bigskip \begin{enumerate}[wide = 0pt, widest = {\...

7

Here's a way with environ: \documentclass{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{xstring} \usepackage{blindtext} \usepackage{environ} %%%% \makeatletter \NewEnviron{Hinweis}{% \setbox0=\vbox{% \def\hinw@list{} \let\item\hinw@tempitem \BODY\expandafter}% \expandafter\def\expandafter\hinw@list\expandafter{\...

7

If you're happy with a new command, here is something I am using now (inspired by the previous answer): \newcommand*{\lstitem}[1]{ \setbox0\hbox{\lstinline{#1}} \item[\usebox0] % \item[\hbox{\lstinline{#1}}] \hfill \\ } \begin{description} \lstitem{sleep} Waits some time \end{description} I don't know, why the uncommented part does not work. ...

7

It would be possible to make the list environment aware of the image depth, but it is easier to use wrapfig I show two variants, carrying the indent into the following paragraph, or moving the following paragraph down, \documentclass{article} \usepackage{mwe,wrapfig} \makeatletter \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth \else\Gin@nat@...

7

Adding \leavevmode also has the desired effect and looks reasonably clean. \documentclass{article} \begin{document} \begin{description} \item[Animals:]\leavevmode \begin{itemize} \item Dog \item Cat \item Fish \end{itemize} \item[Colors:]\leavevmode \begin{itemize} \item Red \item Green \item Blue \end{itemize} \end{description} \end{...

7

\documentclass{article} \usepackage{enumitem,xcolor} \usepackage{showframe} \begin{document} \begin{description}[font=\color{black},before=\color{blue},nosep] \raggedleft %% put this here \item[Item:] some text some text some text \item[Another item:] some text \item[Very long item:] some text some text \item[Short item:] ...

7

Hide the depth of the parbox: \documentclass{beamer} \usetheme{Madrid} \mode<handout>{ \usecolortheme{seahorse} \usecolortheme{rose} } \useinnertheme{circles} \usefonttheme[mathonly]{serif} \begin{document} \begin{frame}\frametitle{Course Logistics (cont'd)} \begin{description} \item [\smash{\parbox[t]{1.8cm}{Late\\assignments}} ] \begin{itemize}...

7

Always use the \begin \end syntax, some environments might work using the underlying commands but most will not. It also helps editors to offer syntax highlighting and context sensitive file operations acting on whole environments. For example here \documentclass{article} \usepackage[utf8]{inputenc} \begin{document} zzzz \quote This is my quote \...

6

The enumitem package provides easy control over list formatting and length manipulation. Here's a quick comparison from using your description and an automated enumerate: \documentclass{article} \usepackage{enumitem}% http://ctan.org/pkg/enumitem \begin{document} \begin{description} \item[A)] Data are facts, events or transactions and so on which have been ...

6

You could also just do \begin{enumerate} \item[] \item A1. \item A2. \item A3. \end{enumerate} instead of the above. Works equally well (and looks better in my opinion).

6

It seems that the description environment will only typeset the label under certain conditions (see comments) so I've used \mbox{} to convince it to do typeset the label without actually typesetting description text itself: \documentclass{beamer} \newcommand<>{\reveal}[1]{\mbox{}\visible#2{#1}} \begin{document} \begin{frame} \begin{description} ...

Only top voted, non community-wiki answers of a minimum length are eligible