3

I want to use a small SVG floral pattern unit, much like the one in the image below, (it is just a prototype, which I am not finished working on) to create a border around my page content in LaTeX:

floral pattern

Obviously, the pattern in the provided image requires some corner species as well, to make the transition between vertical and horizontal recurrences.

What package, if any, should I use, and how should I achieve this using the given package? I've heard much about TiKZ, but I'm not sure whether it is the easiest/simplest way to achieve such a result.

Just to make sure I'm clear, I want to use an external SVG image, not generate a pattern via LaTeX.

P.S. The SE interface would not let me include an actual SVG image, so here it is: https://mega.nz/file/A5tzTTzA#6dneLjLA-H24hc45MdoICEQOoAM7LKllWZ-jnGe1apU

GPWR
  • 267
  • If they are images, you will need graphicx. \AddToHook{shipout/background}{...} can handle everything else and it is built in. – John Kormylo Dec 31 '22 at 00:47
  • Not directly related but there is the Ornaments package which might suit you as an alternative. Or give ideas on how to do what you want with SVG graphics. – David Purton Dec 31 '22 at 02:31
  • @JohnKormylo Thank you for your comment. They are indeed images… What do you mean by "everything else"? Thanks again. – GPWR Dec 31 '22 at 22:49
  • You can position each image width \put(x,y) {...} relative to the top left corner of the page, so that \put(\paperwidth,-\paperheight) {...} would be the bottom right corner. \includegraphics can handle rotation and scaling. Default baseline is at the bottom left corner. See also adjustbox [export]. – John Kormylo Jan 01 '23 at 17:46
  • Not what you expected, but this kind of frames also can be made with some font and the nicreframe package. Some example here, here and here. – Fran Jan 01 '23 at 23:59
  • For pure curiosity: Why don't you want to generate your patterns? There are chances that the result might be better looking. And the file easier to use... – Daniel N Jan 02 '23 at 07:43
  • @DanielN Good question. The image I've shown was to demonstrate the fact that I have identical repeating units. I just grabbed it quickly from the internet. The SVG that I want to use for my patterns is more complex, as it features flowers and other details. I should probably have included that picture in my question instead, but I'm not done working on it yet. – GPWR Jan 02 '23 at 13:24
  • @GPWR Can you show the actual pattern? The meander you show in the question is especially tricky to use as one can't scale it independently without ruining the pattern. For something organic with flowers, this might be much easier to solve. – samcarter_is_at_topanswers.xyz Jan 02 '23 at 13:28
  • @samcarter_is_at_topanswers.xyz Of course. I've updated the question to include my pattern prototype. I will eventually make it more complex. Thank you for your comment! – GPWR Jan 02 '23 at 13:50

1 Answers1

3

For the following answer, I saved a single rapport of your pattern in a file format suitable for latex, e.g. as pdf

enter image description here

Then I'm using the tikzpagenodes package to create a frame:

\documentclass{article}

\usepackage{lipsum} % just for the dummy text \usepackage{tikzpagenodes}

\newcommand{\repx}{8} \newcommand{\repy}{11} \newlength{\patternheight} \setlength{\patternheight}{1.5cm} \newlength{\patternoverlapp} \setlength{\patternoverlapp}{-0.15cm}

\newcommand{\pattern}{% \kern-\patternoverlapp% \foreach \foo in {1,...,\repetition}{% \kern\patternoverlapp% \includegraphics[ width=\dimexpr-\patternoverlapp*(\repetition-1)/(\repetition)+\linewidth/\repetition\relax, height=\patternheight ]{pattern}% }% }

\AddToHook{shipout/background}{ \begin{tikzpicture}[remember picture, overlay,inner sep=0pt,outer sep=0pt] \node[anchor=south,text width=\textwidth+2\patternheight] at (current page text area.north) { \let\repetition\repx \pattern }; \node[anchor=south,rotate=90,text width=\textheight] at (current page text area.west) { \let\repetition\repy \pattern }; \node[anchor=south,rotate=180,text width=\textwidth+2\patternheight] at (current page text area.south) { \let\repetition\repx \pattern };
\node[anchor=south,rotate=270,text width=\textheight] at (current page text area.east) { \let\repetition\repy \pattern };

\end{tikzpicture} }

\begin{document}

\lipsum

\end{document}

enter image description here