1

I am creating a poster using Latex and would like to split the background into two parts. Then I was wondering how we can create a background that is two-colored. For example, upper part is red and lower part is yellow (as on the exemplary image)?

enter image description here

2

You could use background. You don't give a minimal example, so your kilometres may well vary:

\documentclass[a4paper]{article}
\usepackage{geometry,tikz}
\usetikzlibrary{calc}
\usepackage[placement=bottom,scale=1,opacity=1]{background}
\backgroundsetup{contents={%
    \begin{tikzpicture}
      \fill [red] (current page.north west) rectangle ($(current page.north east)!.2!(current page.south east)$) coordinate (a);
      \fill [yellow] (current page.south west) rectangle (a);
    \end{tikzpicture}}}
\usepackage{kantlipsum}
\begin{document}
\kant[1-5]
\end{document}

red-yellow background

  • This example gives me LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. no matter how many times I compile it, whether with luatex, pdftex, or xetex. The PDF looks OK though. – Thérèse Jan 3 '16 at 5:38
  • @Thérèse That's odd. It does me, too. But I have no idea why. (And I am not sure whether it did when I first wrote this answer or not. Probably I failed to notice.) – cfr Jan 3 '16 at 14:59
  • @Thérèse I'm clueless. Hence tex.stackexchange.com/questions/285813/…. Hopefully I can correct this answer when I learn how. If you think I should delete it for now, let me know. I'm reluctant to do that since it does seem to produce the desired output, there are no other answers and it is a warning rather than an error. (I don't mean warnings don't matter - just that if it gave an error, I would definitely delete it, whereas a warning is somewhat less serious and I'm less clear if I should delete it.) – cfr Jan 3 '16 at 20:21
  • I see no reason to delete it; I learned something from the example, and maybe we’ll learn more with your new question, which I’m glad you opened. – Thérèse Jan 3 '16 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.