Page LayoutPage numbering with color

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Lauviah
Posts: 2
Joined: Sun Apr 05, 2015 8:37 pm

Page numbering with color

Post by Lauviah »

Hi, I'm new on latex but I want use it to write my thesis. I have to make page numbering looking like this one in attachment, and have no idea how to do it.
Requirements:
- even page numbers on the left, odd page numbers on the right
- color of the line: RGB 194/00/11
- 0,5pt
- no line spacing before and after number

Can I make an asymmetric 2-colum, 1-row table with 3 visible borders and put into footnote? Or someone has any other ideas how to do shape of this line ?
Thanks in advance for any suggestions.

Code: Select all

\documentclass[a4paper,12pt, twoside, titlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage[OT4]{fontenc}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{color}

\definecolor{red2}{RGB}{194,00,11}

\geometry{
 a4paper,
 left=35mm,
 right=25mm,
 top=25mm,
 bottom=25mm,
 }
\pagestyle{fancy}

\fancyhead{}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.5pt}

\begin{document}
smth
\newpage
smth
\end{document}
Attachments
str.JPG
str.JPG (21.14 KiB) Viewed 5152 times
Last edited by Lauviah on Mon Apr 06, 2015 11:08 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Page numbering with color

Post by Stefan Kottwitz »

Hi Lauviah,

welcome to the forum!

At first I understood that you meant footnotes, but after reading all it seems that you mean page numbers. Making that is not so difficult. Positioning can be done by fancyhdr, the challenge of drawing the line by TikZ. I would use TikZ as we can draw related to the paper dimensions, using the current page node.

I just cannot program it right now, it may take a day or to for me to find some more time, but I guess it's a bigger work and the deadline is not tomorrow. ;-)

There are also further LaTeX and TikZ friends here, perhaps one is faster than me.

Stefan
LaTeX.org admin
Lauviah
Posts: 2
Joined: Sun Apr 05, 2015 8:37 pm

Page numbering with color

Post by Lauviah »

Thank you for your quick reply!
As you noticed topic name was wrong, so i changed it.
I didn't hear about TikZ before, it's great ;) I drew shape I wanted, but I don't know how to draw line exactly from left margin to the right (they are different for even and odd pages)

Code: Select all

\usepackage[top=2.5cm, bottom=2.5cm, inner=3.5cm,outer=2.5cm]{geometry}
and how to fit page number exactly in the centre of this small window.
Now I'm doing it inside the document

Code: Select all

\begin{document}
\begin{tikzpicture}[remember picture,overlay]
  \tikzset{shift={(current page.south)},yshift=1.2cm, ,xshift=-8.0cm}
  \draw[red2, line width=0.5pt] (0,1) -- (2,1) -- (2,0) -- (14,0);
\end{tikzpicture}
\end{document}
is it possible to do it before \begin{document} like this

Code: Select all

\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\begin{document}
\end{document}
So it will be added for every page automatically ?
As you noticed I've got few months to do it, so I don't have to rush ;)
Post Reply