答案1
就我个人而言,我会编写一些程序来优雅地解决这个问题。
- 我将首先创建一个命令来创建标题:
\newcommand{我的_fancy_header}{...}
- 然后我将创建一个命令来创建页脚:
\newcommand{我的_fancy_footer}{...}
- 最后,自定义环境使用所有这些并扩展
tcolorbox
:
\newenvironment{我的_fancy_environment}{\我的_fancy_header\begin{tcolorbox}}{\end{tcolorbox}\我的_fancy_footer}
答案2
可以尝试这样的方法:
\usepackage[left=1.5cm,right=1.5cm,
top=1.5cm,bottom=2cm,bindingoffset=0cm]{geometry}
答案3
可以结合环境tcbraster
内部incgraph
来获得根据内容调整大小的独立页面。
\documentclass{article}
\usepackage{incgraph}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\tcbset{
headbox/.style={
sharp corners, notitle, colback=white, colframe=blue!50!green,
colupper=blue!50!green, halign=center, top=3mm, bottom=3mm},
footbox/.style={
sharp corners, notitle, colback=white, colframe=blue!50!green,
colupper=blue!50!green, halign=center},
textbox/.style={
notitle, colback=white, colframe=blue}
}
\begin{document}
\begin{inctext}[paper=graphics]
\begin{tcbitemize}[raster columns=1]
\tcbitem[headbox] The information of Exam on header
\tcbitem[textbox] \lipsum[1]
\tcbitem[footbox] The school's name
\end{tcbitemize}
\end{inctext}
\begin{inctext}[paper=graphics]
\begin{tcbitemize}[raster columns=1]
\tcbitem[headbox] The information of Exam on header
\tcbitem[textbox] A short question
\tcbitem[footbox] The school's name
\end{tcbitemize}
\end{inctext}
\begin{inctext}[paper=graphics]
\begin{tcbitemize}[raster columns=1]
\tcbitem[headbox] The information of Exam on header
\tcbitem[textbox] \lipsum[1-5]
\tcbitem[footbox] The school's name
\end{tcbitemize}
\end{inctext}
\end{document}
答案4
抱歉,我有完整的答案,但我不知道如何将其放入你的编辑器中。
\documentclass[two pages,12pt]{article}
\usepackage{lastpage}
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{color}
\usepackage{fancyhdr} % For headers and footers
\usepackage{geometry}
\geometry{a4paper,total={210mm,297mm},left=20mm,right=20mm,top=30mm,bottom=30mm}
\usepackage[most]{tcolorbox}
\tcbset{colback=white}
\pagestyle{fancy}
\chead{\fbox{\parbox{\dimexpr\linewidth-7pt}{\centering \bf Examen name and type header}}}
\lhead{} % Left header
\rhead{} % Right header
\lfoot{} % Left footer
\cfoot{\fbox{\parbox{\dimexpr\linewidth-7pt}{\bf School footer \hfill Page n.: \thepage\ of \pageref{LastPage}}}}
\rfoot{} % Right footer
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
%\renewcommand*\rmdefault{ppl} %Set font
\begin{document}
\thispagestyle{fancy}
\begin{tcolorbox}[enhanced, title style={left color=black, right color=white}, title=\bf Short Question - 30 pts, breakable]
\lipsum[1-2]\\
\begin{enumerate}
\item prima domanda
\item seconda domanda
\end{enumerate}
\end{tcolorbox}
\newpage
\begin{tcolorbox}[enhanced, title style={left color=black, right color=white}, title=\bf Long Question - 50 pts, breakable]
\lipsum[1-2]\\
\includegraphics[scale=1.5]{graph sinus and cosinus.pdf}\\
Rispondi alle seguenti domande:
\begin{enumerate}
\item dimostrare che $\sin^2 x+\cos^2 x=1$
\item Disegnare il grafico della funzione $y=\sqrt{\frac{2x-1}{x+3}}$
\end{enumerate}
\lipsum[4-7]
\end{tcolorbox}
\newpage
\begin{tcolorbox}[enhanced, title style={left color=black, right color=white}, title=\bf Shortest Question - 20 pts, breakable]
\lipsum[1-2]\\
\begin{enumerate}
\item prima domanda
\item seconda domanda
\end{enumerate}
\end{tcolorbox}
\end{document}