Тёмный

LaTeX in a Minute: Custom Page Layout 

Maths Partner
Подписаться 17 тыс.
Просмотров 9 тыс.
50% 1

TikzPageNodes absolute positioning guide: drive.google.c...
%%%%%%%%%%%%%% MWE CODE
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage[top=4cm,bottom=4cm,headheight=2cm,footskip=3cm,marginparwidth=2cm]{geometry}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{tikzpagenodes}
%custom template layout

ewcommand{\mypage}{%
\begin{tikzpicture}[remember picture, overlay]
\fill[fill=gray](current page.north west) rectangle ([yshift=-30mm]current page.north east) node[midway] {\Huge\bfseries\sffamily\color{white}{Here is my title}};

ode at (current page footer area) {\Huge\bfseries\sffamily\ Page \thepage};
\end{tikzpicture}
}%
%load page style
\fancypagestyle{MyPageStyle}{%
\fancyhf{}
\fancyhead[C]{\mypage}

enewcommand{\headrulewidth}{0pt}
}%
\pagestyle{MyPageStyle}
\begin{document}
\lipsum[1-50]
\end{document}

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 5   
@haraldurkarlsson1147
@haraldurkarlsson1147 Год назад
So I do not get the header gray area and the page number print way to right (off page) in the upper right hand corner of each page.
@haraldurkarlsson1147
@haraldurkarlsson1147 Год назад
Unfortuantely I am not able to reproduce the results in TeXShop. Not sure what the issue is. I did skip those % inside the { . That are they (%) for??
@MathPartner
@MathPartner Год назад
The % are just comments which I use to easily navigate the start and finish of an environment and are not essential for compilation. It's difficult to say why it does not compile for you. It could be any one of a number of things, but I suspect that it is almost certainly down to configurations within TeXShop. For example, are you using pdflatex? Are you using windows/mac? What Tex distribution are you using behind TeXShop (simple/basic)? Are all the necessary packages up to date and installed? Be aware that Overleaf (used in this video) uses TeX Live to compile so some macros packages will come installed in the background. TexShop may require you to install these manually. My advice is to spend some time navigating forums such as Stack Overflow to see if somebody else has had a similar issue and posted solutions might help you to diagnose the issue. Since I have long since abondoned local compilers for Overleaf and have never used TeXShop, I cannot help much beyond these suggestions I'm afraid.
@haraldurkarlsson1147
@haraldurkarlsson1147 Год назад
@@MathPartner I see. I thought perhaps you wanted to have an empty line and LaTeX is some instances does not like that.
@tejaltatiwar4682
@tejaltatiwar4682 4 месяца назад
What's this
Далее
LaTeX in a Minute: Multiple Page Styles
1:00
Просмотров 4,3 тыс.
LaTeX for Students - A Simple Quickstart Guide
13:51
Просмотров 159 тыс.
LaTeX Tutorial 3: Page Layout // Text Formatting
16:15
Latex Playlist - Footnote, header and footer
10:07
Просмотров 4,1 тыс.
page styling,fancy headers,footers in latex
8:50
Просмотров 8 тыс.
LaTeX Templates Elsevier Example
6:29
Просмотров 24 тыс.
Why LaTeX?
9:44
Просмотров 217 тыс.