如何在此页面上自动重复命令 \around页。 谢谢。
答案1
您可以加载\usepackage[color=black,opacity=1,angle=0,scale=1]{background}
,然后将其包含\around
在设置背景的设置中。这需要在命令中进行一些更改,\Title
因为垂直空间会发生变化。所以这是完整的解决方案。
输出
代码
\documentclass[a4paper]{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{multicol}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage[color=black,opacity=1,angle=0,scale=1]{background}
\usepackage{lipsum}
\usetikzlibrary{calc}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[R]{\textsc{page}~\thepage/\pageref{LastPage}}
\newcounter{numex}
\def\thrulefill{\leavevmode\leaders\hrule height 0.7ex depth \dimexpr1pt-0.7ex\hfill\kern0pt}
\setlength{\columnseprule}{.5pt}
\setlength{\columnsep}{1.2cm}
\newcommand\Startex{%
\stepcounter{numex}
\begin{center}
\thrulefill~\textsc{\bfseries Exercise~\thenumex}~\thrulefill
\end{center}
}
\backgroundsetup{
contents={%
\begin{tikzpicture}[overlay, remember picture]
\draw[rounded corners=5mm] ($(current page.south west)+(1cm,1cm)$) rectangle ($(current page.north east)+(-1cm,-1cm)$);
\node[fill=white, rotate=90, anchor=west, font=\footnotesize\scshape] at ($(current page.south west)+(1cm,2cm)$) {CPGE Lycée Med V};
\end{tikzpicture}
}
}
\newcommand\Title{
\begin{center}
\begin{tikzpicture}[overlay, remember picture]
\node[draw, rounded corners, align=center, text width=7cm, minimum height=1.5cm] (title) at (0,-2) {TD 10\\\bfseries Fonctions convexes};
\node[anchor=south west] (top) at (title.north west) {PCSI-2 — CPGE Lycée Med V};
\draw (top.east) -- ($(top.east-|title.east)+(-5pt,0)$);
\node[anchor=north east] (bottom) at (title.south east) {2015-2016};
\draw (bottom.west) -- ($(bottom.west-|title.west)+(5pt,0)$);
\end{tikzpicture}
\end{center}
\vspace{4cm}
}
\begin{document}
\Title
\begin{multicols*}{2}
\Startex
\lipsum[1]
\Startex
\lipsum[2]
\Startex
\lipsum[3-5]
\Startex
\lipsum[5-8]
\end{multicols*}
\end{document}