Fonts & Character SetsSetting up a New document - Layout

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

Setting up a New document - Layout

Post by Christoph »

Oh, I see it!

plainheadsepline

But actually thee is no need to have an different layout when there is a new chapter so I think ist the better solution to renew the \chapterpagestyle comand...

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

Setting up a New document - Layout

Post by Christoph »

To get the Frame over the chapter heading ist really hard (for me)

I started with the Example an page 530, Chapter 21:

It took me quite a time to find out that I have a heading without prefix (--> \chapterlinesformat)
from that it was a long way to find out that i have to load the "xcolor" package (as described on page 529...)
I´m still not shure why I need the \makeatletter and the \makeatother - I just know I need it because of the "\@hangfrom"

Code: Select all

\usepackage{xcolor}
\setlength{\fboxsep}{10pt}

\makeatletter
\renewcommand{\chapterlinesformat}[3]{%
	\colorbox{lightgray}{%
	\framebox{
		\parbox{\dimexpr\linewidth-5
			\fboxrule-2\fboxsep}{%
			\@hangfrom{#2}#3%
		}%
	}%
}}
\makeatother
It would be fine to get some input again, how to set up the framebox and the colorbox, so that they have the same size and that they don´t go further to the outer margin than the rest of the text.
Furthermore I´d like to have a point at the headings number and the heading should use uppercase letters:
"1. ALLGEMEINES"

But these are my targets for tomorrow...
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

Setting up a New document - Layout

Post by Christoph »

Oh at the time I see, that it´s probably better to use the fcolorbox instead of a combination of colorbox and the framebox...
And by using the fcolorbox the outer margin of the box is at the same distance as the rest of the text and headers!

Ohhh WOW!!!

So there are only the point after the number and the uppercase letter missing to get the chapter heading done! Great!

Code: Select all

\usepackage{xcolor}
\setlength{\fboxsep}{10pt}

\makeatletter
\renewcommand{\chapterlinesformat}[3]{%
	\fcolorbox{black}{lightgray}{%
%	\framebox{
		\parbox{\dimexpr\linewidth-5
			\fboxrule-2\fboxsep}{%
			\@hangfrom{#2}#3%
		}%
	}%
}%}
\makeatother
Bartman
Posts: 366
Joined: Fri Jan 03, 2020 2:39 pm

Setting up a New document - Layout

Post by Bartman »

A comment on the development of the topic: It should serve to provide an overview if you try to give each target its own topic.

To your question: What do \makeatletter and \makeatother do? (answers in English and German)
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

Setting up a New document - Layout

Post by Christoph »

OK, thanks for all your great help!

I´ve got an idea now of what´s the \makeatletter and \makeatother is doing and what it´s needed for.

AND I´ve made a new topic now:
https://latex.org/forum/viewtopic.php?f=48&t=34799
Post Reply