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 want to align elements in an itemization list such that no item label uses part of the page margin. I am using the paralist package for this. However, the item indentation is not right in all cases:

\documentclass{article}

\usepackage{pxfonts}
\usepackage{paralist}
%\usepackage[alwaysadjust]{paralist}

\begin{document}
\noindent

\section{Complexity classes}

Please note that the following list of complexity classes is not 
only important, but also contains no information about them.

\begin{itemize}
\item[\textbf{PTIME}:] A complexity class
\item[\textbf{NP}:] Yet another complexity class
\item[\textbf{PSPACE}:] Guess what...
\end{itemize}

\section{Questions}

\begin{enumerate}
  \item Where are the other complexity classes?
  \item Perhaps this document does not need them?
\end{enumerate}

\end{document}

How things look like now but should not

The problem seems to be that there is a minimum label width for which the NP label is smaller. Without the pxfonts package, the problem would not occur. Now one could use the "alwaysadjust" option to paralist, but then the file does not compile anymore. Using the "olditem" option to paralist would make the list labels extend into the page margin.

So how to I align the NP element properly?

share|improve this question
2  
Why don't you use a description list for the first list - this works fine. –  Andrew Swann Nov 21 '13 at 13:38
    
Thanks, Andrew - I was unaware of this possibility. –  DCTLib Nov 21 '13 at 14:21
add comment

1 Answer 1

up vote 2 down vote accepted

Using a description list instead works, and also saves you having to explicitly make the label bold:

Sample output

\documentclass{article}

\usepackage{pxfonts}
\usepackage{paralist}

\begin{document}
\noindent

\section{Complexity classes}

Please note that the following list of complexity classes is not 
only important, but also contains no information about them.

\begin{description}
\item[PTIME:] A complexity class
\item[NP:] Yet another complexity class
\item[PSPACE:] Guess what...
\end{description}

\section{Questions}

\begin{enumerate}
  \item Where are the other complexity classes?
  \item Perhaps this document does not need them?
\end{enumerate}

\end{document}
share|improve this answer
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.