如何使用特定样式来格式化文档的每一页?

如何使用特定样式来格式化文档的每一页?

我想创建一个模板,如这里图片所示。模板应该是这样的,我的 LaTeX 文档中的每一页都具有相同的页面样式;即,页边距应显示在每一页上,并且每页都应由一条线分隔并分成两个相等的部分,以便上半部分用于设置问题,下半部分用于回答问题。右下角的框将包含答案摘要;可以是多项选择题或需要简短回答的答案。我是 LaTeX 新手,因此无法理解这一点。任何帮助都将不胜感激!!!在此处输入图片描述

答案1

基于以下建议这个答案

在此处输入图片描述

\documentclass{article}
\usepackage{tikzpagenodes}
\usetikzlibrary{positioning}
\usepackage{lipsum}
%from https://tex.stackexchange.com/a/193605/121799
\newcommand{\FancyPage}[4][]{
\begin{tikzpicture}[overlay,remember picture]
  \node[anchor=north west,text
  width={\textwidth-2*\pgfkeysvalueof{/pgf/inner xsep}}] at 
  (current page text area.north west) (topnode-\thepage)
   {
     \vbox to 0.486\textheight{#2\vfill}
  };
  \node[below=0pt of topnode-\thepage,text width={\textwidth-2*\pgfkeysvalueof{/pgf/inner xsep}},
  yshift=\the\pgflinewidth](bottomnode-\thepage){
     \vbox to 0.486\textheight{#3\vfill}
  };
  \node[anchor=south east,text
  width=0.3\textwidth,xshift=\the\pgflinewidth,
  yshift=3\pgflinewidth] (rightnode-\thepage) at 
  (current page text area.south east) {
     \vbox to 0.3\textheight{#4\vfill}
  };
  \draw (current page text area.south west) rectangle
  (current page text area.north east);
  \draw (current page text area.west) --  (current page text area.east);
  \draw (current page text area.south -| rightnode-\thepage.west) 
  |-   (current page text area.east |- rightnode-\thepage.north);
\end{tikzpicture}
}
\begin{document}
\FancyPage{\begin{center}
     Questions
     \end{center}
     \begin{enumerate}
     \item \dots
     \item \dots
     \end{enumerate}
}{
\begin{flushleft}
     Working area
     \end{flushleft}
     \dots
}{
Answers:
     \begin{enumerate}
     \item \dots
     \item \dots
     \end{enumerate}}
\clearpage   
\FancyPage{\begin{center}
     Questions
     \end{center}
     \begin{enumerate}
     \item Another question
     \item \dots
     \end{enumerate}
}{
\begin{flushleft}
     Working area
     \end{flushleft}
     \dots more stuff
}{
Answers:
     \begin{enumerate}
     \item \dots
     \item \dots
     \end{enumerate}}
\end{document}

该答案附带一个宏\FancyPage{<top content>}{<bottom content>}{<right content>},它可以创建类似于您的屏幕截图的页面。

相关内容