1
0
Fork 0
mirror of https://github.com/lise-henry/crowbook synced 2024-05-12 02:16:02 +02:00

Use rendering.chapter and rendering.part in LaTeX output

Fixes #50
This commit is contained in:
Elisabeth Henry 2018-06-01 17:50:35 +02:00
parent fff43d73f4
commit 84126bb365
2 changed files with 20 additions and 1 deletions

View File

@ -241,7 +241,12 @@ impl<'a> LatexRenderer<'a> {
.insert_str("margin_bottom", self.book.options.get_str("tex.margin.bottom").unwrap())
.insert_str("margin_top", self.book.options.get_str("tex.margin.top").unwrap());
if let Ok(chapter_name) = self.book.options.get_str("rendering.chapter") {
data = data.insert_str("chapter_name", chapter_name);
}
if let Ok(part_name) = self.book.options.get_str("rendering.part") {
data = data.insert_str("part_name", part_name);
}
if self.book.options.get_bool("rendering.initials") == Ok(true) {
data = data.insert_bool("initials", true);
}

View File

@ -53,6 +53,7 @@
left=<<&margin_left>>,right=<<&margin_right>>]{geometry} % Set dimensions/margins of the parge
<</stdpage>>
\makeatletter
\date{<<&date>>}
@ -237,6 +238,19 @@
\begin{document}
% Redefine chapter and part names if they needs to be
% Needs to be after \begin{document} because babel
<<#chapter_name>>
\makeatletter
\renewcommand{\@chapapp}{<<&chapter_name>>}
\makeatother
<</chapter_name>>
<<#part_name>>
\renewcommand{\partname}{<<&part_name>>}
<</part_name>>
<<#tex_title>>
\maketitle
<</tex_title>>