1

When I add a question label it goes beyond the left margin.

Here a minimal code :

\documentclass[11pt,a4paper]{exam}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,showframe]{geometry}
\usepackage{setspace}
\usepackage{fancybox}

\renewcommand{\thequestion}{\bf\arabic{question}}
\renewcommand{\questionlabel}{\bf\llap{Q}\thequestion.}


\begin{document}

\begin{questions}
    \question This is the first question
    \question This is the second question
    \question Another question
\end{questions}

\end{document}

and here the given result enter image description here

How I can solve this issue ?

2

1 Answer 1

1

With the help of

\renewcommand{\questionlabel}{\bfseries Q}thequestion.}

you get:

enter image description here

Complete MWE:

\documentclass[11pt,a4paper]{exam}
%\usepackage[utf8]{inputenc} not needed since default with recent installation
\usepackage[T1]{fontenc} %in order to prevent " OT1 encoding should not be used for French" warning.
\usepackage[french]{babel}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,showframe]{geometry}
\usepackage{setspace}
\usepackage{fancybox}

\renewcommand{\thequestion}{\bfseries\arabic{question}}
\renewcommand{\questionlabel}{\bfseries Q\thequestion.}


\begin{document}

\begin{questions}
    \question This is the first question
    \question This is the second question
    \question Another question
\end{questions}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .