2

I have a list where I want the first bullet to start on the same line as the preceding text. My current example is this. In the image I've marked where I want the bullet to be located:

\documentclass{article}
\usepackage{lipsum}
\setlength{\parindent}{0pt}
\begin{document}
    \textbf{Heading}
    \begin{itemize}
        \item \lipsum[1][2]
        \item \lipsum[1][3]
        \item \lipsum[1][4]
        \item \lipsum[1][5]
    \end{itemize}
\end{document}

enter image description here

This is a similar question to How to start itemize on same line as text?, but none of these solutions work for me, because they either involve creating a new minipage which indents all the bullets, not just the first, or they hardcode the preceding text, which won't work for me.

Anyway, since each \item seems to automatically be placed on a newline, I thought it would be as simple as adding a command to "undo" the newline at the start of the list, e.g.

\usepackage[inline]{enumitem}
\setlist[itemize]{before=\nolinebreak}

I repeated this with before=\unskip but neither worked.

Is there no simple command I can put in before= to prevent this first line break? If not, why is it so complex?

2 Answers 2

3

A trivlist attempt, which simulates the case when a theorem-like environment starts with a list:

\documentclass{article}
\usepackage{lipsum}
\setlength{\parindent}{0pt}

\begin{document}
    \trivlist\item[\textbf{Heading}\hskip-\labelsep]
    \begin{itemize}
        \item \lipsum[1][2]
        \item \lipsum[1][3]
        \item \lipsum[1][4]
        \item \lipsum[1][5]
    \end{itemize}
    \endtrivlist
\end{document}

enter image description here

1
  • I wish there were a way to integrate this into the regular itemize list using enumitem etc
    – Migwell
    Commented Jun 17, 2022 at 8:10
2

Quick and dirty:

\documentclass{article}
\usepackage{lipsum}
\usepackage{enumitem}

\setlength{\parindent}{0pt}
\begin{document}
    \textbf{Heading}
\vspace{-5ex}

\begin{itemize}[leftmargin=2.5cm]
        \item \lipsum[1][2]
        \item \lipsum[1][3]
        \item \lipsum[1][4]
        \item \lipsum[1][5]
    \end{itemize}
\end{document}

Second attempt, only indenting the first item:

\documentclass{article}
\usepackage{lipsum}
\usepackage{enumitem}

\setlength{\parindent}{0pt}
\begin{document}
    \textbf{Heading}
\vspace{-5ex}

\begin{itemize}
 {\setlength\itemindent{1.25cm} \item \lipsum[1][2]}
        \item \lipsum[1][3]
        \item \lipsum[1][4]
        \item \lipsum[1][5]
    \end{itemize}
\end{document}

enter image description here

Third attempt, measure offset automatically:

\documentclass{article}
\usepackage{lipsum}
\usepackage{enumitem}

\setlength{\parindent}{0pt}
\begin{document}
\newlength{\foobar}

\def\myheading{My longer Heading}

    \settowidth{\foobar}{\textbf{\myheading}}
    {\textbf{\myheading}}

\vspace{-5ex}

\begin{itemize}
 {\setlength\itemindent{\foobar} \item \lipsum[1][3]}
        \item \lipsum[1][2]
        \item \lipsum[1][4]
        \item \lipsum[1][5]
    \end{itemize}
\end{document}
4
  • Right, but the issue with that is that it indents all the bullets, which as I mentioned in the question isn't what I want. I would rather just the first one be indented.
    – Migwell
    Commented Jun 17, 2022 at 7:22
  • Yes, I realized that, you were just too quick to comment. See my revised, second example above.
    – Ingmar
    Commented Jun 17, 2022 at 7:26
  • I don't love that I have to manually adjust by the length of the preceding text, but this does work
    – Migwell
    Commented Jun 17, 2022 at 8:10
  • You can always use \settowidth to (semi-) automate things. I am lacking the time to put this all in a proper macro, but to see how it's done, check out my (again) revised code.
    – Ingmar
    Commented Jun 17, 2022 at 8:30

You must log in to answer this question.

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