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

9
  • If they are images, you will need graphicx. \AddToHook{shipout/background}{...} can handle everything else and it is built in. Commented Dec 31, 2022 at 0: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. Commented Dec 31, 2022 at 2:31
  • @JohnKormylo Thank you for your comment. They are indeed images… What do you mean by "everything else"? Thanks again.
    – GPWR
    Commented Dec 31, 2022 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]. Commented Jan 1, 2023 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
    Commented Jan 1, 2023 at 23:59

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .