Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to get the item label to flush with the left margin of the page width within itemize, i.e.:

This is my sentence. Here are my items:

  1. ITEMNAME
    • notice my list definition is indented
  2. ITEMNAME
    • but my item labels are all flush with the left margin and not sticking out of it

Note I am using \item[ITEMNAME] \hfill \\ to create a definition style item with a linebreak between keyword and definition, as demonstrated above. How can I get the desired flush that only affects the item's label?

share|improve this question

migrated from stackoverflow.com May 18 '12 at 11:01

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

up vote 2 down vote accepted

Consider using the enumitem package to perform your list management. Here's an example of what you might be after:

enter image description here

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\usepackage{showframe}% http://ctan.org/pkg/showframe
\begin{document}
\begin{description}
    [align=left,style=nextline,leftmargin=*,labelsep=\parindent,font=\normalfont]
  \item[FIRST ITEM] Note that my list definition is not indented
  \item[SECOND ITEM] This one is also not indented and the description
    is long enough to span two lines.
\end{description}
\end{document}

The optional argument to description performs:

  • align=left: Ensures a left-aligned item label;
  • leftmargin=*: Left margin of description is flush with left margin of text block;
  • style=nextline: Automates the process of using \hfill \\;
  • labelsep=\parindent: The gap between the label and the start of the item is \labelsep, which is set to be the same as the regular paragraph indent.
  • font=\normalfont: This modifies the default bold font of the description item to \normalfont.

If need be, you can also create a new list environment to perform these "optional settings" automatically. For this, see \newlist and \setlist in the enumitem documentation (section 7 Cloning the basic lists, p 10).

showframe was only used to emphasize the text block boundaries within the example.

share|improve this answer
    
Worked like a charm. Thanks. –  user985609 May 22 '12 at 17:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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