Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. documentclass{book}
  2. usepackage[rmargin=1cm]{geometry}
  3. usepackage{xcolor}
  4. usepackage{fancyhdr}
  5. usepackage{tikzpagenodes}
  6. usepackage{lipsum}
  7. usetikzlibrary{calc}
  8.  
  9. pagestyle{fancy}
  10. fancyhf{}
  11. renewcommandheadrulewidth{0pt}
  12. fancyhead[EL]{%
  13. begin{tikzpicture}[remember picture,overlay]
  14. path
  15. let
  16. p1=(current page.west),
  17. p2=(current page.east)
  18. in
  19. node[fill=gray!20,inner sep=0pt,text width=x2-x1,anchor=west,minimum height=1cm]
  20. at (current page header area.west)
  21. (box)
  22. {}
  23. node[fill=black,inner sep=0pt,minimum height=1cm,text width=10pt,anchor=west]
  24. at (box.west)
  25. (bbox)
  26. {}
  27. node[font=Huge,anchor=west]
  28. at (bbox.east)
  29. {thechapter};
  30. end{tikzpicture}%
  31. }
  32. fancyhead[OR]{%
  33. begin{tikzpicture}[remember picture,overlay]
  34. path
  35. let
  36. p1=(current page.east),
  37. p2=(current page.west)
  38. in
  39. node[fill=gray!20,inner sep=0pt,text width=x1-x2,anchor=east,minimum height=1cm]
  40. at (current page header area.east)
  41. (box)
  42. {}
  43. node[fill=black,inner sep=0pt,minimum height=1cm,text width=10pt,anchor=east]
  44. at (box.east)
  45. (bbox)
  46. {}
  47. node[font=Huge,anchor=east]
  48. at (bbox.west)
  49. {thechapter};
  50. end{tikzpicture}%
  51. }
  52.  
  53. begin{document}
  54.  
  55. chapter{A test chapter}
  56. lipsum[1-20]
  57.  
  58. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement