0
\documentclass[12pt,a4paper,UTF8, scheme = plain]{ctexrep}
\usepackage{amsmath,enumerate}
\usepackage{geometry}
\usepackage{adjustbox}
\usepackage{booktabs}
\usepackage{fancyhdr}
\usepackage{lastpage}
\fancyhead{}
\fancyfoot[C]{}
\fancyfoot[R]{Page~\thepage~of~\pageref{LastPage}}
\fancyfoot[L]{Department of Mathematics}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\usepackage{pdfpages}
\usepackage{hyperref}
\hypersetup{
    bookmarksopen  = false,
    pdfstartview   = {FitV},         % fits the width of the page to the window
    pdfpagelayout  = TwoPageRight    % UseOutlines, %UseNone-disable bookmark panel
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pdfsuppressptexinfo=-1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{qrcode}
\usepackage{background}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% Cover page  %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\myCover}[5]{%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newgeometry{top=2cm,left=2cm,right=2cm,bottom=2cm}
\NoBgThispage
\pagestyle{empty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[!th]
\begin{minipage}[c]{0.3\textwidth}
    \begin{center}
    \includegraphics[scale=0.35]{example-image}
    \end{center}
\end{minipage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\qquad%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{minipage}{0.65\textwidth}
{
\Large \bfseries
    CAIE 9709 Mathematics   \\[2ex]
    #1                      \\[2ex]  % Paper Name
    Length : #2             \\[2ex]  1 HOUR 30 MINUTES
    Last updated: \today    \\[3ex]
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{minipage}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace*{\fill}
\textbf{\Large Name:}     \rule{6cm}{1pt} \\[3ex]
\textbf{\Large Teacher:}  \Large{#3}      \\[2ex]  %%%%% TeacherName
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace*{\fill}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Score Tables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[!h]
\large
\begin{tabular}{|l|l|r|c|}
\toprule
No.  & Source  & Mark & Score \\
\midrule
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\midrule
Total & & #4 & \\ %%%%%%%%%%%%%%%%% %%%%%% Total Marks 
\bottomrule
\end{tabular}
\end{table}
\vspace*{\fill}
How I can achieve better:
\begin{itemize}
\item
\item
\item
\item
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace*{\fill}
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\myCover%%%%%%%%%%%%%%%%%%%%%%%%%%%
{Paper 4 Mechanics}
{1 HOUR 30 MINUTES}
{Maths Department}
{75}
{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Q1  & \verb=9709_XXX= &  4 &  \\ \hline
Q2  & \verb=9709_XXX= &  6 &  \\ \hline
Q3  & \verb=9709_XXX= &  6 &  \\ \hline
Q4  & \verb=9709_XXX= &  6 &  \\ \hline
Q5  & \verb=9709_XXX= &  9 &  \\ \hline
Q6  & \verb=9709_XXX= &  9 &  \\ \hline 
Q7  & \verb=9709_XXX= & 10 &  \\ \hline 
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
test test test test 


\end{document}

What's this

 ! Missing $ inserted.

about?

I found that it's the \verb=9709_XXX= that caused the problem.... But before I put them into a newcommand, I didn't have to worry about them.

Changing to \path{9709_XXX} served the purpose...for this document.

What should I be aware of this in the future?

CasperYC
  • 683
  • 1
    "you can't use \verb inside any other command's argument (apart from some commands which are specially made to support this, by not really using an argument here)." https://tex.stackexchange.com/questions/24574/how-to-put-verb-command-inside-of-textbf-block/640353#comment48026_24574 – user202729 May 07 '22 at 04:34
  • (not exact duplicate but the content there covers everything you need to know here.) – user202729 May 07 '22 at 04:35
  • 1
    Why not just \texttt{9709\_XXX}? – frabjous May 07 '22 at 04:41
  • @frabjous Thanks. Didn't really occur to me \verb would be a problem as it works fine without the newcommand ... thanks again – CasperYC May 07 '22 at 12:08
  • 1
    You need neither figure nor table: you don't want floats, do you? – egreg May 07 '22 at 12:42
  • Thank. @egreg Looks like a "bad habit" .... – CasperYC May 09 '22 at 00:38

0 Answers0