gpt4 book ai didi

latex - 全局设置 Tikz Boarder | latex

转载 作者:行者123 更新时间:2023-12-04 04:08:32 25 4
gpt4 key购买 nike

通过以下代码,我可以为当前页面设置边界,但是如何在不在每个页面上明确设置边界的情况下使边界对所有页面可用。


% !TeX TS-program = xelatex % | xelatex %

\documentclass[12pt, a4paper]{article}
\usepackage[left=3.3cm,right=2.3cm,top=2.3cm,bottom=2.3cm, footskip=42pt]{geometry}

\usepackage{fontspec}
\setmainfont{Times New Roman}

\usepackage{tikz}
\usetikzlibrary{calc}


\begin{document}

\begin{tikzpicture}[remember picture, overlay]
\draw[line width=3pt] ($(current page.north west)+(2.5cm,-1.5cm)$) rectangle ($(current page.south east)+(-1.5cm,1.5cm)$);
\draw[line width=1pt] ($(current page.north west)+(2.6cm,-1.6cm)$) rectangle ($(current page.south east)+(-1.6cm,1.6cm)$);
\fill[red] (current page.center) circle (0.1);
\node[font=\Large\bfseries, text width=5cm,align=center] at (current page.center) {
\uppercase{Note -- 1}

\vspace{24pt}

\uppercase{Data analysis}
};
\end{tikzpicture}

\newpage

test

\end{document}

最佳答案

一种可能是使用 eso-pic 包:

% !TeX TS-program = xelatex % | xelatex %

\documentclass[12pt, a4paper]{article}
\usepackage[left=3.3cm,right=2.3cm,top=2.3cm,bottom=2.3cm, footskip=42pt]{geometry}

\usepackage{fontspec}
\setmainfont{Times New Roman}

\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{eso-pic}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[remember picture, overlay]
\draw[line width=3pt] ($(current page.north west)+(2.5cm,-1.5cm)$) rectangle ($(current page.south east)+(-1.5cm,1.5cm)$);
\draw[line width=1pt] ($(current page.north west)+(2.6cm,-1.6cm)$) rectangle ($(current page.south east)+(-1.6cm,1.6cm)$);
\end{tikzpicture}%
}

\begin{document}

\begin{tikzpicture}[remember picture, overlay]
\fill[red] (current page.center) circle (0.1);
\node[font=\Large\bfseries, text width=5cm,align=center] at (current page.center) {
\uppercase{Note -- 1}

\vspace{24pt}

\uppercase{Data analysis}
};
\end{tikzpicture}

\newpage

test

\end{document}

关于latex - 全局设置 Tikz Boarder | latex ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62138057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com