GeneralWhat control sequence is undefined here?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

What control sequence is undefined here?

Post by Singularity »

When I add \sol{} to the following document, I start to get the error
Undefined control sequence
<argument> \padded@point@block
And the problem is not fixed when I add content to the \sol{<content>}.

The funny thing is, I've used \sol{} in many previous documents without any issues, but I get an error even in the unremarkable MWE below.

What's causing this error and how do I fix it please?

Thanks.

Code: Select all

\documentclass[fleqn,addpoints
,answers
]{exam}
\usepackage{amsfonts,amsmath,amssymb,amsthm,mathtools}
\newcommand{\sol}[1]{\begin{solution} #1 \end{solution}
	\vspace{\stretch{1}}
	\droppoints
}

\begin{document}

\begin{questions}

\question Find the domain, holes all asymptotes (vertical and horizontal) of the function defined in the original document but math mode was removed from here so as to make this document even more minimal and graph it.

\sol{content}

\end{questions}

\end{document}

Recommended reading 2024:

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

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

Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

What control sequence is undefined here?

Post by Singularity »

I found the one single difference between the above nonworking MWE and a working MWE I made: I did not include the "optional" points parameter on the \question command. The following works, but I have no idea why.

Code: Select all

\documentclass[fleqn,addpoints
,answers
]{exam}
\usepackage{amsfonts,amsmath,amssymb,amsthm,mathtools}
\newcommand{\sol}[1]{\begin{solution} #1 \end{solution}
        \vspace{\stretch{1}}
        \droppoints
}

\begin{document}

\begin{questions}

\question[1] Find the domain, holes all asymptotes (vertical and horizontal) of the function defined in the original document but math mode was removed from here so as to make this document even more minimal and graph it.

\sol{content}

\end{questions}

\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

What control sequence is undefined here?

Post by Stefan Kottwitz »

It seems omitting the optional points argument works, but not in the case if it's the ver first question. If the first question would have points, the next one without works fine. Seems like a bug.

Here's a quick fix for now, which goes to your document preamble:

Code: Select all

\makeatletter
\let\padded@point@block\relax
\makeatother
If defines the missing command, but just as a dummy command which does nothing.

Stefan
LaTeX.org admin
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

What control sequence is undefined here?

Post by Singularity »

Code: Select all

\documentclass[fleqn,addpoints
,answers
]{exam}

\makeatletter
\let\padded@point@block\relax
\makeatother

\usepackage{amsfonts,amsmath,amssymb,amsthm,mathtools}
\newcommand{\sol}[1]{\begin{solution} #1 \end{solution}
	\vspace{\stretch{1}}
	\droppoints
}

\begin{document}

\begin{questions}

\question Find the domain, holes all asymptotes (vertical and horizontal) of the function defined in the original document but math mode was removed from here so as to make this document even more minimal and graph it.

\sol{content}

\end{questions}

\end{document}
Post Reply