# How to change position of marks in a question paper template

I am using {exam} document class for question paper setting. In the generated pdf marks are almost on the right boundary as I take printout. Can I shift it slightly left or at least at right-aligned with the text? MWE is given as:

\documentclass[12pt]{exam}
\usepackage[margin = 2.2cm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}
\begin{document}
\begin{center}
\textbf{Name of Institution}\newline
\textbf{Name of Department}\newline
\textbf{Name of Examination}\newline
\end{center}
\textbf{Course Code:XXX (YYYYYY) }  \hspace{1cm} \textbf{Semester: 4th} \newline
\textbf{Time: 2 Hrs \hspace{3cm}  \hspace{7cm} \ \  Max. Marks: 50}\newline

\begin{questions}
\pointsdroppedatright
\question
\begin{parts}
\part[3] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
\part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\begin{enumerate}[i.]
\item Type question here  XXXXXXX.
\item YYYYYY.
\item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here
\end{enumerate}
\textbf{\droppoints}
\end{parts}
\question
\begin{parts}
\part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
\part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\textbf{\droppoints}
\end{parts}
\end {questions}
\end{document}

• To get correct centering in a center environment you shouldn't use \newline but \\  to terminate lines (I haven't done this in my answer as I focussed only on the placement of the positioning of \droppoints). Sep 29, 2018 at 8:52

a variation of nice Jesse op den Brouw's answer (+1):

• different position of \droppoints
• some off-topic changes of code

\documentclass[12pt]{exam}
\usepackage[showframe,   % in real document remove this option
margin=22mm]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{enumitem}
\setlist[enumerate]{label=\roman*.,after=\vspace{-0.5\baselineskip}}
\makeatletter
\def\droppoints{%
\leavevmode\unskip\nobreak\hfill
}
\makeatother

\begin{document}
\begin{center}\bfseries
Name of Institution\\
Name of Department\\
Name of Examination
\end{center}
\textbf{Course Code:XXX (YYYYYY) }  \hfill\textbf{Semester: 4th}    \\
\textbf{Time: 2 Hrs                 \hfill  Max. Marks: 50}         \\

\begin{questions}
\pointsdroppedatright
\question
\begin{parts}
\part[3] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here
\textbf{\droppoints}
\part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\begin{enumerate}
\item Type question here  XXXXXXX.
\item YYYYYY.
\item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here
\end{enumerate}
\textbf{\droppoints}
\end{parts}
\question
\begin{parts}
\part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here
\textbf{\droppoints}
\part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\textbf{\droppoints}
\end{parts}
\end {questions}


Just a minor improvement over @JesseopdenBrouw's answer (seriously if anyone upvotes this answer, consider upvoting his as well, all the work is done by him, I only included a feasible break point).

The following does jump to the next line and print the points there if in the last line of the question is not enough space (2em plus the space taken by the points). Also I included the \textbf into the definition of \droppoints. In the following MWE one can see the effects of this changes in question 1.a.

\documentclass[12pt]{exam}
\usepackage[margin = 2.2cm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}

\makeatletter
\def\droppoints{%
\leavevmode\unskip\nobreak\hfill\penalty50\hskip2em
\null\nobreak\hfill
\par
}
\makeatother

\begin{document}
\begin{center}
\textbf{Name of Institution}\newline
\textbf{Name of Department}\newline
\textbf{Name of Examination}\newline
\end{center}
\textbf{Course Code:XXX (YYYYYY) }  \hspace{1cm} \textbf{Semester: 4th} \newline
\textbf{Time: 2 Hrs \hspace{3cm}  \hspace{7cm} \ \  Max. Marks: 50}\newline

\begin{questions}
\pointsdroppedatright
\question
\begin{parts}
\part[3] Type question here. Type question here Type question here Type question
here Type question here Type question here Type question here Type question here
Type quest\droppoints
\part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\begin{enumerate}[i.]
\item Type question here  XXXXXXX.
\item YYYYYY.
\item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here
\end{enumerate}
\droppoints
\end{parts}
\question
\begin{parts}
\part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \droppoints
\part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\droppoints
\end{parts}
\end {questions}
\end{document}


Just redefine \droppoints.

\documentclass[12pt]{exam}
\usepackage[margin = 2.2cm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumerate}

\makeatletter
\def\droppoints{%
\leavevmode\unskip\nobreak\hfill
\rlap{\hskip\rightmargin  % Defined by the list environment
}% rlap
\par
}
\makeatother

\begin{document}
\begin{center}
\textbf{Name of Institution}\newline
\textbf{Name of Department}\newline
\textbf{Name of Examination}\newline
\end{center}
\textbf{Course Code:XXX (YYYYYY) }  \hspace{1cm} \textbf{Semester: 4th} \newline
\textbf{Time: 2 Hrs \hspace{3cm}  \hspace{7cm} \ \  Max. Marks: 50}\newline

\begin{questions}
\pointsdroppedatright
\question
\begin{parts}
\part[3] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
\part[7] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\begin{enumerate}[i.]
\item Type question here  XXXXXXX.
\item YYYYYY.
\item Type question here Type question here Type question here Type question here Type question here Type question here Type question here Type question here
\end{enumerate}
\textbf{\droppoints}
\end{parts}
\question
\begin{parts}
\part[5] Type question here. Type question here Type question here Type question here Type question here Type question here Type question here  \textbf{\droppoints}
\part[5] Type part 2 of question here. Type question here Type question here Type question here Type question here Type question here Type question here
\textbf{\droppoints}
\end{parts}
\end {questions}
\end{document}

• Just a tip for the future: It is usually a good idea to include an image of the new output. This way any future visitors (and the OP of the question) can quickly verify that this is what they wanted/were looking for. On Linux you can convert a PDF to an image with pdftocairo or imagemagick's convert. Sep 29, 2018 at 7:34