Page Layout ⇒ FancyHdr with color background and Picture Env
FancyHdr with color background and Picture Env
I have not been successful. I am attaching 3 items.
1. First version of the header (odd pages)
2. Second version of the header (even pages)
3. My attempt LaTeX file.
The macro I am creating takes 2 parameters. One is the text to display. The other is a macro which is a picture graphics/text.
I am using the table to hold everything together. I have tried using the commands in FancyHdr to create the header but nothing gives the color background.
Thanks
PTH
- Attachments
-
- Image of original page. (Odd page numbers)
- FirstImagePageHeader.jpg (18.13 KiB) Viewed 7736 times
-
- Image of original page. (Even page numbers)
- SecondImagePageHeader.jpg (19.92 KiB) Viewed 7736 times
-
- PSKK_test.tex
- LaTeX example trying to create macro which creates header
- (791 Bytes) Downloaded 353 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
FancyHdr with color background and Picture Env
[1] Fancy chapter headings | TikZ example
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: FancyHdr with color background and Picture Env
http://www.texample.net/tikz/examples/f ... -headings/
I was able to build a sectionlabel command. This looks at the page number for \isodd.
If found it reverses the placement of the graphic and the text label.
Two issues: 1. I can not remove the \chapterlabel command with out losing the \sectionlabel commands function? (I thought they were independent.)
2. I get a section number with the text and the graphics. I would like to remove both but can live with only removing the number from the graphics.
3. I would like to have 2 parameters. One for the text and a second for the graphics. I have not been able to get the second parameter to work.
Thanks
- Attachments
-
- HeaderTest_tikz.tex
- Test using tikz as bases.
- (4.07 KiB) Downloaded 352 times
Re: FancyHdr with color background and Picture Env
Some progress. I have one issue remaining.
I would like to pass 2 parameters to the macro
\section{The Section}{\MFP}
\section{The Other}{\MFP2}
It is accepting the first parameter but I can not get the second.
I have reduced my example to be smaller.
Thanks
- Attachments
-
- HeaderTest_tikz_2.tex
- Example of macro and test document using the macro. Does not accept second parameter to macro.
- (3.13 KiB) Downloaded 346 times
Re: FancyHdr with color background and Picture Env
I reworked the example. I have an example which uses FancyHdr.
I need some direction. I want to make the RED block wider.
The section text needs to be higher in the block. I do not know
how to adjust the position of this text.
Putting red block higher and correctly setting page length would also help
Can not see footer.
HELP
Thanks
- Attachments
-
- HeadTest_fancyhdr.tex
- Test using fancyhdr package. Needs position of section title updated
- (2.26 KiB) Downloaded 406 times
FancyHdr with color background and Picture Env
Code: Select all
\newcommand{\formPageHeader}[2]{\fancyhead{}\addtolength{\voffset}{-3cm} % remove gap at top\addtolength{\headsep}{5cm} % space betwen header and text\fancyhead[CE,CO]{\colorbox{red}{\begin{tabular}[t]{l}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\\end{tabular}}}\fancyhead[LE,RO]{\colorbox{red}{\begin{tabular}[t]{l}\ \\\textbf{\textcolor{white}{\Huge{#1}}} \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\end{tabular}}}\fancyhead[LO,RE]{\colorbox{red}{\begin{tabular}[t]{lll}\ & \ & \ \\\ & \textbf{\textcolor{white}{#2}} & \ \\\ & \ & \ \\\end{tabular}}}\addcontentsline{toc}{section}{#1}\fancyfoot{} % clear all footer fields
- Attachments
-
- FancyHdr_example.tex
- Example produces 3 pages
- (6.85 KiB) Downloaded 416 times