用Tikz制作精美的边框装饰

您所在的位置:网站首页 Linux修改权限递归 用Tikz制作精美的边框装饰

用Tikz制作精美的边框装饰

2024-06-24 00:14| 来源: 网络整理| 查看: 265

pgfornamentborder-1代码设计如下:

\documentclass{article} \usepackage[%   margin=4cm   %,showframe% to show the page layout ]{geometry} \usepackage[object=vectorian]{pgfornament} \newcommand\om{5mm}% ornament margin \newcommand\ow{5cm}% ornament width \newcommand\ols{5.5mm}% ornament line shift \newcommand\on{63}% ornament number \colorlet{bordercolor}{purple} \tikzset{ ol/.style={line width=1mm,dotted}% style for the lines } % define the border and save it in a box \newsavebox\border \sbox\border{%   \tikz[color=bordercolor]{     \useasboundingbox(0,0)rectangle(\paperwidth,-\paperheight);     \foreach[count=\i]\a/\p/\s in {%       north west/{\om,-\om}/none,       north east/{{\paperwidth-\om},-\om}/v,       south east/{{\paperwidth-\om},{-\paperheight+\om}}/c,%       south west/{\om,{-\paperheight+\om}}/h%       }\node[anchor=\a](n\i) at (\p){\pgfornament[width=\ow,symmetry=\s]{\on}};     \begin{scope}[ol]       \draw([yshift=-\ols]n1.north east)--([yshift=-\ols]n2.north west);       \draw([xshift=-\ols]n2.south east)--([xshift=-\ols]n3.north east);       \draw([yshift=\ols]n3.south west)--([yshift=\ols]n4.south east);       \draw([xshift=\ols]n4.north west)--([xshift=\ols]n1.south west);     \end{scope}   }% } \usepackage[manualmark]{scrlayer-scrpage} \clearpairofpagestyles \addtokomafont{pagehead}{\color{blue!50!green!80!black}\large} \chead*{The current page style is \toplevelpagestyle{} \ifstr{\toplevelpagestyle}{\currentpagestyle}{}{as alias for \currentpagestyle}.} \cfoot*{\pagemark} % define a switch to enable and disable the border \newif\ifBorder % define a new layer \DeclareNewLayer[{%     background,     page,     contents={\ifBorder\usebox\border\fi}   }]{border.bg} % add the border layer to all layer page styles (scrheadings, plain, empty, ...) ... \AddLayersAtBeginOfPageStyle{@everystyle@}{border.bg} % but no border on empty pages \AddToLayerPageStyleOptions{empty}{oninit=\Borderfalse} \usepackage{blindtext}% dummy text \begin{document} \Bordertrue \Blindtext \clearpage \pagestyle{empty} \Blindtext[10] \clearpage \pagestyle{plain} \Blindtext \end{document}

选自:http://tex.stackexchange.com/questions/245904/create-page-border-using-tikz



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3