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 getting this very strange error in Latex using enumerate. My code is as follows:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[margin=.75 in]{geometry}
\usepackage{enumerate}

\begin{document}
\fbox{
\parbox{6.66 in}{
{\bf MATH 342 \hfill Name}

\emph{Problem Set \# 9 \hfill 25 January 2013}}}
\vspace{.1 in}

\begin {enumerate}[{\bf \ \ \ \ Page 71:}]
    \item \ \ \
    \begin{enumerate}
        \item[37.]
        \begin{enumerate}
            \item[d.] 
        \end{enumerate}
        \item[80.]
    \end{enumerate}
\end{enumerate}


\begin {enumerate}[{\bf \ \ \ \ Page 118:}]
    \item \ \ \
    \begin{enumerate}
        \item[26.]
        \item[27.]
        \item[65.] 
    \end{enumerate}
\end{enumerate}


\begin {enumerate}[{\bf \ \ \ \ Page 138:}]
    \item \ \ \
    \begin{enumerate}
        \item[3.]
        \item[10.]
        \item[42.]
    \end{enumerate}
\end{enumerate}


\end{document}

This outputs everything as expected except "Page 118" is "P1ge 118" and "Page 138" is "P1ge 138"

I am using TeXworks with MikTex if this makes any difference.

Anybody know whats going on/how to fix it?

Thanks

share|improve this question

migrated from stackoverflow.com Jan 24 '13 at 15:35

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

2  
Welcome to TeX.sx! Your post was migrated here from another Stack Exchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. In the specific, this is not the best way to lay out this type of text; however, writing {Page} should solve the issue. –  egreg Jan 24 '13 at 15:42
1  

2 Answers 2

up vote 5 down vote accepted

I suggest to use the enumitem package. This way you don't have to "eye compute" spacings:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[margin=.75in]{geometry}
\usepackage{calc}
\usepackage{enumitem}

%%% \referpage is used for the label; in order to get a good alignment,
%%% the page number sticks out to the right
\DeclareRobustCommand{\referpage}[1]{\textbf{Page \makebox[0pt][l]{#1:}}}

\begin{document}
\noindent\fbox{% The heading box is computed more accurately
\parbox{\textwidth-2\fboxsep-2\fboxrule}{
  {\bfseries MATH 342 \hfill Name}

  \emph{Problem Set \# 9 \hfill 25 January 2013}}%
}

\vspace{.1 in}

\begin{enumerate}[leftmargin=*,label=\referpage{71}]
    \item \mbox{}
    \begin{enumerate}
        \item[37.]
        \begin{enumerate}
            \item[d.] 
        \end{enumerate}
        \item[80.]
    \end{enumerate}
\end{enumerate}

\begin{enumerate}[leftmargin=*,label=\referpage{118}]
    \item \mbox{}
    \begin{enumerate}
        \item[26.]
        \item[27.]
        \item[65.] 
    \end{enumerate}
\end{enumerate}

\begin{enumerate}[leftmargin=*,label=\referpage{138}]
    \item \mbox{}
    \begin{enumerate}
        \item[3.]
        \item[10.]
        \item[42.]
    \end{enumerate}
\end{enumerate}


\end{document}

enter image description here

share|improve this answer

From the documentation of enumerate:

An occurence of one of the tokens A a I i or 1 produces the value of the counter printed with (respectively) \Alph \alph \Roman \roman or \arabic. These letters may be surrounded by any strings involving any other TEX expressions, however the tokens A a I i 1 must be inside a { } group if they are not to be taken as special.

So surrounding the a with {} should fix your issue:

\begin {enumerate}[{\bf \ \ \ \ {Page} 71:}]
share|improve this answer
    
Thank you. This does fix the issue. The only reason I am putting egreg's answer as the solution is because in addition to providing a solution they also corrected other errors I was having. –  user2006233 Jan 24 '13 at 18:41

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.