编译时
\documentclass{article}
\pagestyle{empty} % No page numbers
\usepackage{geometry}
\geometry{a4paper}
\usepackage{tikz}
\usepackage[object=pgfhan]{pgfornament}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
every node/.style={inner sep=0pt}]
% corners
\node[anchor=north east] at (current page.north east)
{\pgfornament[width=5cm,symmetry=v]{4}};
\node[anchor=north west] at (current page.north west)
{\pgfornament[width=5cm]{4}};
\node[anchor=south east] at (current page.south east)
{\pgfornament[width=5cm,symmetry=c]{4}};
\node[anchor=south west] at (current page.south west)
{\pgfornament[width=5cm,symmetry=h]{4}};
% borders
\node[anchor=north,xscale=2.2] at (current page.north)
{\pgfornament[height=2.5mm]{30}};
\node[anchor=south,xscale=2.2] at (current page.south)
{\pgfornament[height=2.5mm,symmetry=c]{30}};
\node[anchor=east,shift={(-2.5mm,-10.5cm)},yscale=4,rotate=-90]
at (current page.east)
{\pgfornament[height=2.5mm]{30}};
\node[anchor=west,shift={(2.5mm,-10.5cm)},yscale=4,rotate=90]
at (current page.west)
{\pgfornament[height=2.5mm]{30}};
\end{tikzpicture}
\end{document}
使用xelatex
版本时XeTeX 3.14159265-2.6-0.999992 (TeX Live 2020/Debian)
,我遇到以下问题:
- 垂直边框没有完全对齐
- 在使用 pdftops 之前,我无法使用 psutils release 1 patchlevel 17
gs
可以正确读取 PDF 文件,但不能pstops
。PDFpsresize
文件可以打印,但会被裁剪(预期行为)。
使用pdf2ps
帮助。它使文件与兼容pstops
,但我必须指定纸张尺寸以避免裁剪顶部边框:
pdf2ps -paper=A4 frame-2.pdf frame-2.ps
使用pstops "@0.8(21mm,29.7mm)" -pA4 frame-2.ps frame-2ss.ps
生成一个文件
- 根据需要在 A4 纸上打印。
- 没有正确居中显示
gs
。
我的AVlinux
系统Linux 6.0.0-10.1-liquorix-amd64 #1 ZEN SMP PREEMPT_DYNAMIC liquorix 6.0-6~mx21+1 (2022-11-30) x86_64 GNU/Linux
没有设置为默认的 A4 纸张尺寸吗?
答案1
您可以使用以下pgfornament
包将它们与 pdfTeX、XeTeX 或 LuaTeX 正确对齐:
\documentclass[a4paper]{article}
\pagestyle{empty} % No page numbers
\usepackage{geometry}
\usepackage{tikz}
\usepackage[object=pgfhan]{pgfornament}
\begin{document}
\begin{tikzpicture}[remember picture, overlay, every node/.style={inner sep=0pt}]
% corners
\node[anchor=north east] at (current page.north east) {\pgfornament[width=5cm,symmetry=v]{4}};
\node[anchor=north west] at (current page.north west) {\pgfornament[width=5cm]{4}};
\node[anchor=south east] at (current page.south east) {\pgfornament[width=5cm,symmetry=c]{4}};
\node[anchor=south west] at (current page.south west) {\pgfornament[width=5cm,symmetry=h]{4}};
% borders
\node[anchor=north,xscale=2.2] at (current page.north) {\pgfornament[height=2.5mm]{30}};
\node[anchor=south,xscale=2.2] at (current page.south) {\pgfornament[height=2.5mm,symmetry=c]{30}};
\node[anchor=south,yscale=4,rotate around={-90:(current page.west)}] at (current page.west) {\pgfornament[height=2.5mm]{30}};
\node[anchor=south,yscale=4,rotate around={90:(current page.east)}] at (current page.east) {\pgfornament[height=2.5mm]{30}};
\end{tikzpicture}
\end{document}