1
%% 19 Feb 2020
\documentclass[12pt,a4paper,UTF8]{report}
%%
%%
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage[flushleft]{paralist}[2013/06/09]
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{currfile}
\renewcommand{\familydefault}{\sfdefault} %% changes font to sans-serif

%% length
\setlength{\parskip}{10pt}
\setlength{\parindent}{0pt}
\newlength{\qspace}
\setlength{\qspace}{20pt}
\newcounter{qnumber}
\setcounter{qnumber}{0}
%%
%%
\newcommand{\fakesubsection}[1]{%
    \addcontentsline{toc}{subsection}{#1}% Add section to ToC
}
%%
%%
\newenvironment{question}%
{\vspace{\qspace}
    \begin{enumerate}[\bfseries Q1\quad][10]%
    \setcounter{enumi}{\value{qnumber}}%
    \item%
    \fakesubsection{\currfilebase-Q\theenumi}% \currfilename VS \jobname
    \label{ques:Q\theenumi}
}{
    \end{enumerate}
    \filbreak
    \stepcounter{qnumber}
}
%%
%%
\begin{document}
%%
%%%%%%%%%%%%%%%%%%%%%%% Q1
\begin{question}
If $\theta+\phi+\psi=\tfrac{1}{2}\pi,$ show that 
\[
\sin^{2}\theta+\sin^{2}\phi+\sin^{2}\psi+2\sin\theta\sin\phi\sin\psi=1.
\]
By taking $\theta=\phi=\tfrac{1}{5}\pi$ in this equation, or otherwise,
show that $\sin\tfrac{1}{10}\pi$ satisfies the equation 
\[
8x^{3}+8x^{2}-1=0.
\]
\end{question}
%%
%%
%%%%%%%%%%%%%%%%%%%%%%% Q2
\begin{question}
\[
8x^{3}+8x^{2}-1=0.
\]
\[
8x^{3}+8x^{2}-1=0.
\]
\[
8x^{3}+8x^{2}-1=0.
\]
\end{question}
%%
%%
%%%%%%%%%%%%%%%%%%%%%%% Q3
\begin{question}
\lipsum[3]
\end{question}
%%
%%
%%%%%%%%%%%%%%%%%%%%%%% Q4
\begin{question}
\[
\sin^{2}\theta+\sin^{2}\phi+\sin^{2}\psi+2\sin\theta\sin\phi\sin\psi=1.
\]
\[
\sin^{2}\theta+\sin^{2}\phi+\sin^{2}\psi+2\sin\theta\sin\phi\sin\psi=1.
\]
\[
\sin^{2}\theta+\sin^{2}\phi+\sin^{2}\psi+2\sin\theta\sin\phi\sin\psi=1.
\]
\end{question}
%%
%%
%%%%%%%%%%%%%%%%%%%%%%% Q5
\begin{question}
\lipsum[9]
\end{question}
%%
%%
\section{prime numbered questions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% So here, how can I reuse these questions?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ref{ques:Q2}
\ref{ques:Q3}
\ref{ques:Q5}

\end{document}

So in the later section, how can I reuse (print) the questions again for example? Nothing have to be changed, just appear again exactly as they did in the original path. Is there a quick way to achieve this by modifiying the question environment?

Thanks.

CasperYC
  • 683
  • Possibly related: https://tex.stackexchange.com/questions/140702/equation-summary and https://tex.stackexchange.com/questions/406984/call-repeat-duplicate-equation-based-on-label – Steven B. Segletes Feb 19 '20 at 12:28
  • @StevenB.Segletes struggling to "retain" multiple boxes and assign them names/labels. I will try to adapt more ... – CasperYC Feb 20 '20 at 05:35
  • If I get some time, I will see if I can put something together along the lines of the cited questions. – Steven B. Segletes Feb 20 '20 at 15:15

0 Answers0