Text FormattingStarting an 'enumerate' item with a left bracket?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
JasonM
Posts: 3
Joined: Fri Jun 13, 2014 4:48 pm

Starting an 'enumerate' item with a left bracket?

Post by JasonM »

An annoying problem that I cannot figure out:

In an enumerate environment:

Code: Select all

\begin{enumerate}[a.] 
\item Whatever1
\item *[Whatever2]
\item [Whatever3]
\end{enumerate}
The third item (and any item beginning with a left/open bracket) gets shoved to the extreme left of the page. I can work around it by putting the bracket in, say, \textrm{}, but I cannot figure out why it's happening.
Last edited by cgnieder on Tue Jun 17, 2014 12:07 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Starting an 'enumerate' item with a left bracket?

Post by Johannes_B »

All those \items can have an optional argument. As you might already know, those are set within brackets. You already saw that by using braces, you can protect the brakets from being interpreted as the optional argument.
But why is there an optional argument? You can also see, that is messes up the numbering. But it's really useful using a description list. Please see below. You can click on »Open in writelatex« to see the output.

Code: Select all

\documentclass{article}
\usepackage{blindtext}
\usepackage{scrextend}%Just for labeling
\usepackage{showframe}
\begin{document}

\begin{enumerate}%[a.]
\item Whatever1 \blindtext
\item [Whatever2] \blindtext
\item {[Whatever3]} \blindtext
\end{enumerate}
\clearpage
\begin{description}%[a.]
\item empty no headers or footers
\item [plain] no header
\item {[headings]} header and footer
\end{description}
\begin{description}%[a.]
	\item [empty] no headers or footers
\item [plain] no header
\item [headings] header and footer
\end{description}
\begin{labeling}[~--]{headings}
	\item [empty] no headers or footers
\item [plain] no header
\item [headings] header and footer
\end{labeling}
\end{document}

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
JasonM
Posts: 3
Joined: Fri Jun 13, 2014 4:48 pm

Re: Starting an 'enumerate' item with a left bracket?

Post by JasonM »

Thank you so much! I should have thought of that.
Post Reply