2

I would like to be able to start an itemize environment after a sentence, on the same line of the sentence, and indent from that point on.

Something like -exactly what I'm doing

-here but the second item should be aligned with the first one.

Edit: This is for a presentation in beamer, I would like to use this to save space on a slide.

Thank you in advance for your answers!

  • 4
    you may want to take a look at: tex.stackexchange.com/questions/147710/… – Nico Boni Sep 24 '14 at 15:11
  • what would you like to happen if the introductory text takes up more than half the line, and the item text is long? also, presumably, if the introductory text goes to more than one line, you want the item list to begin at that point? – barbara beeton Sep 24 '14 at 15:16
  • it's inside one slide of a presentation so it's just a very small paragraph. in general if the item were long enough to start a new line, I would like it to begin aligned with the rest of the item. – claudia Sep 24 '14 at 15:25
  • @dcmst following the link I saw that I could use a minipage, but in that example they always want the same text in front of the list, while I want the possibility of changing it. – claudia Sep 24 '14 at 15:28
  • @claudia, just add an argument so that you can change the text. Also, please note that since it is for a (beamer?) presentation, the solutions involving the enumitem package may misbehave. – Nico Boni Sep 24 '14 at 15:30
2

Here is a definition of an environment that can be used to obtain the look you want.

  \newenvironment{OLitemize}[1][\linewidth]
     {\begin{minipage}[t]{#1}\begin{itemize}}
     {\end{itemize}\end{minipage}
    }

Usage is then:

bla bla bla  \begin{OLitemize} \item test 1 \item test 2 \end{OLitemize}

One remark to this code: I expect you to normally just put small parts of text after each \item. Since I reserve a whole linewidth for the minipage, long texts will hang out on the right side of the page. For this case, one can pass an optional parameter to OLitemize which is the width of the space you want to use. This can be used to fit long texts on your page.

Perhaps one could even improve the definition by calculating how much space is left on the page and then pass this as an argument to the minipage. Unfortunately, my LaTeX-abilities do not allow do this.

  • Welcome to TeX.SX! If you select code and hit Ctrl+K, or click the button marked {}, it will be highlighted as such. – Torbjørn T. Sep 25 '14 at 8:58
  • it doesn't work as I want in beamer, it leaves a line before the itemize begins. I had tried it in an article before and it worked, also inside a theorem environment. – claudia Sep 25 '14 at 9:45

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.