From 800cd9271c7b8b6dfba99ff6eb988fbca0eafcd9 Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Fri, 23 Sep 2022 09:16:23 +0200 Subject: [PATCH] - Makefile: Add indermediate tex target for debugging - Template pdf: finetune for rendering non-print style - Set correct order for chapters --- Makefile | 10 ++++ chapters/99-0-chemicals.md | 2 +- .../{1000-suppliers.md => 998-suppliers.md} | 2 + chapters/999-references-and-links.md | 2 +- metadata.yml | 14 ++++-- templates/pdf.latex | 47 +++++++++++++++++++ 6 files changed, 71 insertions(+), 6 deletions(-) rename chapters/{1000-suppliers.md => 998-suppliers.md} (96%) diff --git a/Makefile b/Makefile index bee897e..d262fe9 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,7 @@ DOCX_ARGS = --standalone --reference-doc templates/docx.docx EPUB_ARGS = --template templates/epub.html --epub-cover-image $(COVER_IMAGE) HTML_ARGS = --template templates/html.html --standalone --to html5 PDF_ARGS = --template templates/pdf.latex --pdf-engine xelatex +TEX_ARGS = --template templates/pdf.latex --pdf-engine xelatex # Per-format file dependencies @@ -49,6 +50,7 @@ DOCX_DEPENDENCIES = $(BASE_DEPENDENCIES) EPUB_DEPENDENCIES = $(BASE_DEPENDENCIES) HTML_DEPENDENCIES = $(BASE_DEPENDENCIES) PDF_DEPENDENCIES = $(BASE_DEPENDENCIES) +TEX_DEPENDENCIES = $(BASE_DEPENDENCIES) #################################################################################################### # Basic actions @@ -77,6 +79,9 @@ html: $(BUILD)/html/$(OUTPUT_FILENAME).html .PHONY: pdf pdf: $(BUILD)/pdf/$(OUTPUT_FILENAME).pdf +.PHONY: tex +tex: $(BUILD)/tex/$(OUTPUT_FILENAME).tex + .PHONY: docx docx: $(BUILD)/docx/$(OUTPUT_FILENAME).docx @@ -96,6 +101,11 @@ $(BUILD)/pdf/$(OUTPUT_FILENAME).pdf: $(PDF_DEPENDENCIES) $(CONTENT) | $(CONTENT_FILTERS) | $(PANDOC_COMMAND) $(ARGS) $(PDF_ARGS) -o $@ @echo "$@ was built" +$(BUILD)/tex/$(OUTPUT_FILENAME).tex: $(TEX_DEPENDENCIES) + mkdir -p $(BUILD)/tex + $(CONTENT) | $(CONTENT_FILTERS) | $(PANDOC_COMMAND) $(ARGS) $(TEX_ARGS) -o $@ + @echo "$@ was built" + $(BUILD)/docx/$(OUTPUT_FILENAME).docx: $(DOCX_DEPENDENCIES) mkdir -p $(BUILD)/docx $(CONTENT) | $(CONTENT_FILTERS) | $(PANDOC_COMMAND) $(ARGS) $(DOCX_ARGS) -o $@ diff --git a/chapters/99-0-chemicals.md b/chapters/99-0-chemicals.md index 77da802..6587360 100644 --- a/chapters/99-0-chemicals.md +++ b/chapters/99-0-chemicals.md @@ -2,4 +2,4 @@ A chemical substance is a form of matter having constant chemical composition and characteristic properties. Some references add that chemical substance cannot be separated into its constituent elements by physical separation methods, i.e., without breaking chemical bonds. Chemical substances can be simple substances, chemical compounds, or alloys. -In pyrotechnics specific chemicals are used for different effects, and some as helpers during manufacturing like solvents and binders. +In pyrotechnics specific chemicals are used for creating different effects. Some are used as helpers during manufacturing like solvents and binders. diff --git a/chapters/1000-suppliers.md b/chapters/998-suppliers.md similarity index 96% rename from chapters/1000-suppliers.md rename to chapters/998-suppliers.md index 95d8adc..93776b4 100644 --- a/chapters/1000-suppliers.md +++ b/chapters/998-suppliers.md @@ -1,5 +1,7 @@ # Suppliers +## International + * [Lortone ball mills](https://lortone.com/) ## United States (US) diff --git a/chapters/999-references-and-links.md b/chapters/999-references-and-links.md index 3a8b79a..59af32b 100644 --- a/chapters/999-references-and-links.md +++ b/chapters/999-references-and-links.md @@ -1,4 +1,4 @@ -## References and links +# References and links - TODO process links from: diff --git a/metadata.yml b/metadata.yml index 194361a..b5fed79 100644 --- a/metadata.yml +++ b/metadata.yml @@ -2,13 +2,19 @@ title: Pyrotechnics Revived author: PureChemical rights: MIT License -lang: en-US +lang: en-UK mainlang: english otherlang: english -tags: [pandoc, book, pyro, pyrotechnics] -abstract: | - Your summary. +tags: [pyro, pyrotechnics, fireworks, engineering] +numbersections: true mainfont: DejaVu Sans +documentclass: book +book: true + +#NOTE: this is for screen-viewing the book +noprint: true +geometry: [a4paper] +classoption: [oneside] # one-side printing # Filter preferences: # - pandoc-crossref diff --git a/templates/pdf.latex b/templates/pdf.latex index 8aaef43..163d010 100644 --- a/templates/pdf.latex +++ b/templates/pdf.latex @@ -236,6 +236,10 @@ $if(beamer)$ \geometry{$for(geometry)$$geometry$$sep$,$endfor$} $else$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} +$if(noprint)$ +\geometry{left=2cm} +\geometry{right=2cm} +$endif$ $endif$ $endif$ $if(beamer)$ @@ -400,6 +404,49 @@ $if(logo)$ $endif$ $endif$ +% +% header and footer +% +$if(beamer)$ +$else$ +$if(disable-header-and-footer)$ +$else$ +\usepackage[headsepline,footsepline]{scrlayer-scrpage} + +\newpairofpagestyles{eisvogel-header-footer}{ + \clearpairofpagestyles + \ihead*{$if(header-left)$$header-left$$else$$title$$endif$} + \chead*{$if(header-center)$$header-center$$else$$endif$} + \ohead*{$if(header-right)$$header-right$$else$$date$$endif$} + \ifoot*{$if(footer-left)$$footer-left$$else$$endif$} + \cfoot*{$if(footer-center)$$footer-center$$else$$endif$} + \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$} + \addtokomafont{pageheadfoot}{\upshape} +} +\pagestyle{eisvogel-header-footer} + +% TODO +%$if(book)$ +%\deftripstyle{ChapterStyle}{}{}{}{}{\pagemark}{} +%\renewcommand*{\chapterpagestyle}{ChapterStyle} +%$endif$ + +$if(page-background)$ +\backgroundsetup{ +scale=1, +color=black, +opacity=$if(page-background-opacity)$$page-background-opacity$$else$0.2$endif$, +angle=0, +contents={% + \includegraphics[width=\paperwidth,height=\paperheight]{$page-background$} + }% +} +$endif$ +$endif$ +$endif$ + + + \begin{document} $if(has-frontmatter)$ \frontmatter