Page Layout ⇒ Colored boxes in footer
Colored boxes in footer
Hi all, im trying to get 3 colored boxes in my footer, i need to be able to specify the height and width exactly (in mm). And i need to be able to put the pagenumber in the box.
I had some stupid ideas but cant think of how to fix it:
+ using tikz (its not possible to put a tikz pic in a footer) (using fncyhdr)
+ using a table (impossible to make it the exact with and height i want (or am i missing something ?)
Anyone has an idea ?
I had some stupid ideas but cant think of how to fix it:
+ using tikz (its not possible to put a tikz pic in a footer) (using fncyhdr)
+ using a table (impossible to make it the exact with and height i want (or am i missing something ?)
Anyone has an idea ?
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Colored boxes in footer
Hi,
have a look at Fancy chapter headings with TikZ, there are examples using TikZ together with fancyhdr and scrpage2 to get colored boxes in the header. That could be done similar with the footer.
Stefan
have a look at Fancy chapter headings with TikZ, there are examples using TikZ together with fancyhdr and scrpage2 to get colored boxes in the header. That could be done similar with the footer.
Stefan
LaTeX.org admin
Re: Colored boxes in footer
yeah i already googled that page, but hardly understand it 

- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Colored boxes in footer
Perhaps try the code in comment 20 on this page. If you would have concrete questions then ask here or there.
Stefan
Stefan
LaTeX.org admin
Colored boxes in footer
I found some way
now i got a few questions, but first my code:
Some code is not working but this is the partthat matters:
Problem is, my picture is not centered in the middle of te page, also trying \lfoot, or \rfoot doesent matter over here, the image is alligned really odd. Dident even try the pagenumber yet
anyone has an idea ?
ps: the pic is wider then textwidth, thats why im trying to make the footer wider but i suck at it

Code: Select all
\documentclass[a4paper, 10pt, oneside]{report}
\usepackage{fancyhdr}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{tikz}
\definecolor{paars}{cmyk}{0.04,0.95,0,0}
\definecolor{rood}{cmyk}{0,0.93,1,0}
\newcommand*\tikzhead{%
\begin{tikzpicture}[remember picture,overlay]
\fill[color=paars!100] (0,0) rectangle (6.1,-0.75);
\fill[color=rood!100] (6.6,0) rectangle (12.6,-0.75);
\fill[color=rood!100] (13.1,0) rectangle (19,-0.75);
\end{tikzpicture}}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfootoffset{-2.0in}
\foot{\tikzhead}
\pagestyle{fancy}
\newcommand*\headcolor{Aqua}
\newcommand*\setheadcolor[1]{\renewcommand*\headcolor{#1}}
\begin{document}
\setheadcolor{Gold}
\tableofcontents
\clearpaged
\setheadcolor{Olive}
\blinddocument
\end{document}
Code: Select all
\newcommand*\tikzhead{%
\begin{tikzpicture}[remember picture,overlay]
\fill[color=paars!100] (0,0) rectangle (6.1,-0.75);
\fill[color=rood!100] (6.6,0) rectangle (12.6,-0.75);
\fill[color=rood!100] (13.1,0) rectangle (19,-0.75);
\end{tikzpicture}}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfootoffset{-2.0in}
\cfoot{\tikzhead}

ps: the pic is wider then textwidth, thats why im trying to make the footer wider but i suck at it

- Stefan Kottwitz
- Site Admin
- Posts: 10322
- Joined: Mon Mar 10, 2008 9:44 pm
Colored boxes in footer
That's why the example on the other page used the current page node for positiong:znarch wrote: the image is alligned really odd.
Code: Select all
\node[yshift=-2cm] at (current page.north west)
{\begin{tikzpicture} ...
Stefan
LaTeX.org admin
Colored boxes in footer
Also, making the boxes in tikz should have been done different.
Mypic started at coordinate 0,0, and thats the anchor,now i did like this:
and it works better, gnna fix some more, ill keep u updated 
Mypic started at coordinate 0,0, and thats the anchor,now i did like this:
Code: Select all
\begin{tikzpicture}[remember picture,overlay]
\fill[color=paars!100] (-9.5,0) rectangle (-3.4,-0.75);
\fill[color=rood!100] (-2.9,0) rectangle (3.1,-0.75);
\fill[color=rood!100] (3.6,0) rectangle (9.6,-0.75);
\end{tikzpicture}}

Colored boxes in footer
Okej, another stupid question
I want the chapter number/title and so on aligned left, and in color.
I tried using something like this, but i really cant seem to do it:
Using Titlesec ofc, also would like to have *normal* section/subsection etc styles, but then in red. Could someone help me out ? 

I want the chapter number/title and so on aligned left, and in color.
I tried using something like this, but i really cant seem to do it:
Code: Select all
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}
{\chaptertitlename\ \thechapter\hfill \chaptertitle{\Huge}
