4

I am looking to create something like:

Example

where I can define a list that is shifted and aligned to the end of some introductory text.

While I could hardcode a solution for specific text, how can I achieve this for variable introductory text and list items?

3
  • I've seen a question like this before... But I can't find it.
    – Alenanno
    Jan 2, 2016 at 17:20
  • Do you want the list to be "attached" to the end of regular text, like a previous paragraph? Or separated text? And what if the text is too long than a single line?
    – Alenanno
    Jan 2, 2016 at 17:34
  • I guess attached to the end. The text being too long won't be a problem in my case, but that is an interesting consideration to make.
    – dgund
    Jan 2, 2016 at 21:50

2 Answers 2

5

You could use the enumitem and calc packages to create a somehow half automatic solution.

\documentclass[12pt,a4paper]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage{calc}

\begin{document}
    \begin{description}[labelwidth=\widthof{Intro text:}+.5em,%
                        leftmargin=\dimexpr\labelwidth+\labelsep\relax]
        \item[Intro text:]
        \begin{itemize}
            \item item 1
            \item item 2
            \item item 3
            \item etc.
        \end{itemize}
    \end{description}
\end{document}

enter image description here

Edit:

Another solution could be this:

\documentclass{article}

\usepackage{scrextend}
\addtokomafont{labelinglabel}{\sffamily\bfseries}

\begin{document}
    \begin{labeling}{Intro text:}
        \item[Intro text:] \begin{itemize}
            \item item 1
            \item item 2
            \item item 3
            \item etc.
        \end{itemize}
    \end{labeling}
\end{document}

But you would also have to specify the longest label.

2

Another solution would be to wrap the list in a minipage. This adds extra spacing, which you can reset with the enumitem package:

\documentclass{article}
\usepackage{enumitem}
\begin{document}
Intro text:
\begin{minipage}[t]{0.8\textwidth}
    \begin{itemize}[leftmargin=*, label={--}]
    \item item 1
    \item item 2
    \item item 3
    \item etc.
    \end{itemize}
\end{minipage}
\end{document}

enter image description here

You must log in to answer this question.

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