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 creating a set of problems, with the bonus problems starred with an *, but when I use \bonusqformat to customize the mark, it pushes the text onto a new line. Is there any way to prevent this from happening?

MWE

\documentclass{exam}

\bonusqformat{\thequestion *.}
\begin{document}
\begin{questions}
\bonusquestion This is a question.

\end{questions}
\end{document}

MWE

share|improve this question
    
This is the default behavior of exam. The question title (typeset according to \qformat or \bonusqformat) is on a line by itself and the question text is below it. –  egreg Jan 17 '13 at 12:47
    
I understand this is the default behaviour, I'm more looking for a way to overcome it, whilst still having the starred questions. –  Nathanael Farley Jan 17 '13 at 13:22
    
Thanks for pointing that out @egreg, prompted me to look elsewhere for the answer! Posted it below. –  Nathanael Farley Jan 17 '13 at 13:33

1 Answer 1

up vote 4 down vote accepted

Turns out that because of the default behaviour of \bonusqformat (pointed out by egreg), it is easier to achieve this effect by the following code in the preamble:

\newcommand\bonusquestionlabel{\thequestion{}*.}
\makeatletter
\def\question@number{%
  \if@bonus
    \if@bonusqformat
      \makebox[\hsize][s]{\@bonusquestionformat}\hskip-\labelsep
    \else
      \bonusquestionlabel
    \fi
  \else
    \if@qformat
      \makebox[\hsize][s]{\@questionformat}\hskip-\labelsep
    \else
      \questionlabel
    \fi
  \fi
}
\makeatother

This code redefines the question label for bonus questions and makes a new label for them.

Result from the MWE with the extra code in the preamble MWE working!

share|improve this answer

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.