0

I am designing a book cover in latex. However I need to be able to paste it into a template given to me by the publisher. The template is a PDF file that looks like below. I need to paste my cover in the highlighted box. That is the first problem. The second problem is that I don't want to occlude the barcode in the template as I paste over my book cover. Is this possible with the latex toolchain? How? Otherwise what are my options? Thank you so much.

enter image description here

morpheus
  • 113
  • Hello, welcome to TeX.SE! What if you put this in the background and "build" the cover on top of it, by placing the elements? When you're done you can just hide the background and then you have the cover ready. – Alenanno Nov 09 '20 at 19:37
  • Correct. I think that is how they want me to use the template. But I think that flow is applicable when using WYSIWYG editors like Adobe Photoshop etc. How can I implement that flow with latex? How can I use the template PDF as a background and build on top of it? – morpheus Nov 09 '20 at 19:41
  • You only need the blue and pink part, right? Is the rest needed for when you build? – Alenanno Nov 09 '20 at 19:53
  • When I submit the file to the publisher they want the rest as well. The expectation is that the blue and pink will be filled with the cover and that the barcode won't be occluded. – morpheus Nov 09 '20 at 20:01
  • Why don't you use the bookcover class? This was specifically devised for such tasks. – hair-splitter Dec 25 '20 at 14:29

1 Answers1

2

This is the bare minimum to get it setup. The rest depends on how you're building the cover.

For example in this example code, I've placed the template.png in the same folder, loaded it up, set the paperwidth/paperheight to the same dimensions as the .png and forced the same to keep the dimensions (as you see in the same template).

Right now the image is in the background, you can write on top with regular text. If you want to place elements you could try something like tikz (see solution #2). I personally find it easier to place a grid on top of the background and use it to easily find coordinates and move elements on top. But it's just one approach and it depends on what you need to do and what you prefer to use.

Method with the background package

enter image description here

\documentclass{article}
\usepackage[paperwidth=483mm, paperheight=305mm, margin=0cm]{geometry}
\usepackage[scale=1,angle=0,opacity=1]{background}
\usepackage{graphicx}
\usepackage{lipsum}% to create fake text

\pagestyle{empty}

\begin{document}\noindent% \backgroundsetup{% contents={\includegraphics[width=483mm, keepaspectratio]{template.png}}}% \lipsum[1-4]% example text \end{document}

Alternative method with tikz

enter image description here

\documentclass{article}
\usepackage[paperwidth=483mm, paperheight=305mm, margin=0cm]{geometry}
\usepackage{graphicx, lipsum}
\usepackage{tikz}

\pagestyle{empty}

\begin{document}\noindent \begin{tikzpicture}[remember picture, overlay] \node[anchor=south west] at (current page.south west) {% \includegraphics[width=483mm, keepaspectratio]{template.png}}; \draw[step=1cm,gray] (current page.south west) grid (current page.north east); \end{tikzpicture} \end{document}

Alenanno
  • 37,338