如何自动添加垂直空格?

如何自动添加垂直空格?

我正在准备一份问卷。我希望每页显示两个问题。我用 \vspace {6cm} 调整第一个问题和第二个问题之间的间隙,第二个问题结束后,我用 \newpage 命令切换到新页面,并继续这样的页面。有没有有效的方法可以做到这一点? 在此处输入图片描述

    \documentclass[14pt]{extbook}
    \usepackage[turkish]{babel}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{graphicx}
%\usepackage{tcolorbox}
\usepackage{framed}
\usepackage{tikz}
\usepackage{float}
\usepackage{makeidx}
\usepackage{color}
\usepackage{multirow}

\usepackage{fullpage}

\usepackage{newfile}
\usepackage{amsmath}
\usepackage{xifthen}
\usepackage{enumitem}
\usepackage{multicol}
\usepackage{lipsum}

%\setlength{\parindent}{0pt}

\newoutputstream{solutions}
\openoutputfile{\jobname.solutions}{solutions}
\newcounter{exblock}
\newcounter{exquestion}
\newcounter{exsubquestion}
\newlist{questionlist}{enumerate}{1}
\newlist{solutionlist}{enumerate}{1}
\newlist{subquestionlist}{enumerate*}{1}
\newlist{subsolutionlist}{enumerate*}{1}
\setlist[questionlist,solutionlist]{label=\arabic*.}
\setlist[subquestionlist,subsolutionlist]{label=(\alph*),itemjoin={},before=~}
\newcommand{\exheader}{%
    \ifthenelse{\value{exblock}>0}{\addtostream{solutions}{\noexpand\end{solutionlist}}}{}%
    \refstepcounter{exblock}%
    \setcounter{exquestion}{0}%
    \section{Exercises}%
    \label{ex.\arabic{exblock}}%
    \addtostream{solutions}{\noexpand\paragraph{Exercise \noexpand\ref{ex.\arabic{exblock}}, sayfa \noexpand\pageref{ex.\arabic{exblock}}}}%
    \addtostream{solutions}{\noexpand\begin{solutionlist}}%
}
\newcommand{\printsolutions}{%
    \ifthenelse{\value{exblock}>0}{\addtostream{solutions}{\noexpand\end{solutionlist}}}{}%
    \closeoutputstream{solutions}%
    \input{\jobname.solutions}%
}
\newenvironment{exercises}[1][]{%
    \begin{questionlist}[start=\value{exquestion}+1, #1]%
}{%
    \end{questionlist}%
}
\newenvironment{exercisescol}[2][]{%
    \begin{multicols}{#2}%
    \begin{questionlist}[start=\value{exquestion}+1, #1]%
}{%
    \end{questionlist}%
    \end{multicols}%
}
\newcommand{\question}[2]{%
    \refstepcounter{exquestion}%
    \label{ex.\arabic{exblock}.\arabic{exquestion}}%
    \item #1%
    \addtostream{solutions}{\noexpand\item[\noexpand\ref{ex.\arabic{exblock}.\arabic{exquestion}}.] #2}%
}
\newenvironment{subquestions}[1][]{%
    \refstepcounter{exquestion}%
    \label{ex.\arabic{exblock}.\arabic{exquestion}}%
    \setcounter{exsubquestion}{0}%
    \addtostream{solutions}{\noexpand\item[\noexpand\ref{ex.\arabic{exblock}.\arabic{exquestion}}.]\noexpand\begin{subsolutionlist}}%
    \item #1%
    \begin{subquestionlist}%
}{%
    \end{subquestionlist}%
    \addtostream{solutions}{\noexpand\end{subsolutionlist}}
}
\newcommand{\subquestion}[2]{%
    \refstepcounter{exsubquestion}%
    \item #1%
    \addtostream{solutions}{\noexpand\item #2}%
}


\setlist*[questionlist]{font=\bfseries}
\setlist*[solutionlist]{noitemsep,font=\bfseries}
\setlist*[subquestionlist]{font=\bfseries}
\setlist*[subsolutionlist]{noitemsep,font=\bfseries,itemjoin={\\},before={}}

%------------------------------------------------------------------------%
%-----------------------End of Exercises -----------------------------%


\begin{document}


\exheader
\begin{exercises}
\question{First Question}{First Answer}

\vspace{6cm}

\question{Second Question}{Second Answer}

\newpage

\question{Third Question}{Third Answer}

\vspace{6cm}

\question{Fourth Question}{Fourth Answer}

\newpage






    \end{exercises}
    
    \chapter{Answers}
    \printsolutions
    
    
    
    \end{document}

答案1

我在问题定义中添加了\ifthenelse{\isodd{\value{exquestion}}}{\vspace{6cm}}{\newpage}before \addtostream{solutions}...,也在子问题定义中添加了\ifthenelse{\isodd{\value{exquestion}}}{\vspace{6cm}}{\newpage}before \addtostream{solutions}。而且成功了!

相关内容