0

I have titled and notitled question in my document, also I'm using ifthen package, but in notitled questions, there are numbers in square brackets. How can I get rid of them??

My document:

\documentclass[a4paper,10pt,addpoints]{exam}

\usepackage{ifthen}
\qformat{\textbf{Question \thequestion .
    \ifthenelse{\equal{\thequestion}{\thequestiontitle}}
        {}
        } 
        {~{\small [\thequestiontitle]}}
    \hfill
\textsl{(\thepoints)}}

\renewcommand{\questionshook}{%
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}
\pointname{\ p}

\begin{document}

\begin{questions}

\titledquestion{Title}[5] The first question

\question[3] My question

\end{questions}
\end{document}

enter image description here

4
  • 1
    Move one of the } slightly: ... {} {~{\small [\thequestiontitle]}} } \hfill...
    – Cicada
    Commented Sep 25, 2023 at 7:37
  • Yes, that fix my problem, but I dont want to have bold question title. Commented Sep 25, 2023 at 7:44
  • 1
    Put the } of \textbf{...} where you want the bold to end. Originally you had it in the middle of ifthenelse, pushing what was intended to be the false part outside the ifthenelse. E,g., try ...\thequestion .}...
    – Cicada
    Commented Sep 25, 2023 at 7:52
  • Yes, now it is exactly as I wanted. thank you very much Commented Sep 25, 2023 at 8:08

0

You must log in to answer this question.

Browse other questions tagged .