I would like to set up an environment for multiple choice questions, such that the list of the questions and answers as in figure, and some lines of comments like "End", "Thank you very much", will be typeset at the end of the last page. How can I write that?

Something like this:

\usepackage{amsmath,amsxtra,latexsym, amssymb, amscd}
\usepackage{tikz, pgfplots}

\usepackage[a4paper,tmargin=1.0cm, bmargin=1.5cm, lmargin=1.5cm, rmargin=1.5cm]{geometry}

        mark options={scale=2},
        visualization depends on={y/abs(y)-1 \as \sign},
        scatter/@pre marker code/.code={\scope[rotate=90*\sign,yshift=-2pt]}

\NumberOfVersions{1} % 
\SectionPrefix{\relax }



and I have an exam.sty file


\newcommand{\@Name}{\ }
\newcommand{\@Note}{\ }
\newcommand\@sques{\ }
\newcommand{\@examend}{\ }


\newcommand{\Name}[1]{\renewcommand{\@Name}{\makebox[10cm]{{\bf #1:}\dotfill} }}

\newcommand{\Note}[1]{\renewcommand{\@note}{\makebox[10cm]{{\bf #1:}\dotfill} }}
\newcommand{\numberofquestion}[1]{\renewcommand{\@sques}{ #1}}





and the figure that I need to doenter image description here

  • ... \begin{center} END \\ \textit{Thank you very much}\end{center}\end{document} ?
    – Zarko
    Oct 2, 2018 at 7:59
  • @Zarko No, can not make like that.As your suggested, the title is going to up of the page. Because in our multi-choice questions, I mix all of my questions, after 1 run the number of question is change. Do you have any ideas? Thanks Oct 2, 2018 at 8:12
  • Please provide a MWE because I tried to help and even an empty document gives errors. I think you shouldn't use this documentclass. The error I get is "You have used a \\ or \newline command where LaTeX was not expecting one."
    – koleygr
    Oct 2, 2018 at 8:15
  • @koleygr I added more information, please give me your ideas. Thanks a lot Oct 2, 2018 at 9:45
  • Use in your preamble: \AtEndDocument{\vfill\begin{center}END\\\textit{Thank you very much}\end{center}}.
    – Skillmon
    Oct 2, 2018 at 10:03

1 Answer 1


Minimal example showing that our solutions do work:


  {\vfill\begin{center}END\\\textit{Thank you very much}\end{center}}


Last page of generated document:

enter image description here

  • \vfill seems to be the key to putting something at the bottom of a page
    – Robin
    Oct 2, 2018 at 10:14
  • 2
    +1 for duckuments !
    – Zarko
    Oct 2, 2018 at 10:16
  • 2
    @Robin yes \vfill inserts one vertical fill glue that moves the contents after it to the bottom of the page. There are different kinds of glue in TeX. If you use \vspace{0pt plus 5pt} that is a stretchable glue worth 5pt (the stretch is applied proportionally). Compared to such stretches a \vfil is infinitely larger and compared to that a \vfill is again infinitely larger. In fact TeX has three levels of infinity when it comes to glue: \vspace{0pt plus 1fil}, \vspace{0pt plus 1fill} and \vspace{0pt plus 1filll}.
    – Skillmon
    Oct 2, 2018 at 10:34
  • 1
    @user3727281 that might be hard to do right automatically. I think the easiest solution would be to hook into the shipout routine and check which page is to be output. If the next page will be page number 5 then we'd have to change the dimensions of that page and include the contents "End" and "Thank you very much" in the page footer for that one page. And at the next shipout of that page revert those changes. So to make it more clear: I think a manual solution would be easier here.
    – Skillmon
    Oct 2, 2018 at 12:56
  • 1
    @user3727281, this is no asked in your question. i this also not provide nice Skilmon answer. it is not clear what you like to achieve. probably your question will be closed as unclear what you asking for
    – Zarko
    Oct 2, 2018 at 12:57

You must log in to answer this question.

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