v1.1.0 Refactor
This commit is contained in:
parent
90aae529d7
commit
eec6a52baa
|
|
@ -1,24 +0,0 @@
|
|||
from: markdown
|
||||
to: epub
|
||||
output-file: build/basic-book-builder.epub
|
||||
|
||||
metadata:
|
||||
title: "Basic Book Builder"
|
||||
author: "John Haverlack"
|
||||
date: "2026-02-04"
|
||||
rights: "© 2026 Alaska Center for Energy and Power"
|
||||
|
||||
epub-cover-image: lib/img/UAF-ACEP.png
|
||||
|
||||
include-before-body:
|
||||
- conf/frontmatter_epub.xhtml
|
||||
|
||||
resource-path:
|
||||
- .
|
||||
- lib/img
|
||||
|
||||
css:
|
||||
- conf/style_epub.css
|
||||
|
||||
filters:
|
||||
- filters/callouts-html.lua
|
||||
|
|
@ -1 +0,0 @@
|
|||
$body$
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<div class="frontmatter">
|
||||
|
||||
<!-- Title Page -->
|
||||
<h1 style="margin-top:3em; font-size:2.4em; text-align:center;">Basic Book Builder</h1>
|
||||
<h2 style="text-align:center; font-weight:normal;">A Pandoc Template for building books and articles</h2>
|
||||
|
||||
<div style="text-align:center; margin:2em 0;">
|
||||
<img src="lib/img/UAF-ACEP.png" alt="Cover illustration" style="max-height:100px;">
|
||||
</div>
|
||||
|
||||
<hr style="margin:3em 0;">
|
||||
|
||||
|
||||
<!-- Metadata Page (PDF analog) -->
|
||||
<div style="text-align:left; margin-top:5em;">
|
||||
<!-- Metadata Page (PDF analog) -->
|
||||
<table style="margin-top:5em; width:100%; border-collapse:collapse;">
|
||||
<tbody>
|
||||
<tr><td style="width:30%; font-weight:bold;">Title</td><td>Basic Book Builder</td></tr>
|
||||
<tr><td style="font-weight:bold;">Subtitle</td><td>A Pandoc Template for building books and articles</td></tr>
|
||||
<tr><td style="font-weight:bold;">Affiliation</td><td>Alaska Center for Energy and Power</td></tr>
|
||||
<tr><td style="font-weight:bold;">Institution</td><td>University of Alaska Fairbanks</td></tr>
|
||||
<tr><td style="font-weight:bold;">Author</td><td>John Haverlack</td></tr>
|
||||
<tr><td style="font-weight:bold;">Version</td><td>0.0.6</td></tr>
|
||||
<!-- <tr><td style="font-weight:bold;">Copyright</td><td>© 2005–2025 John Haverlack</td></tr>
|
||||
<tr><td style="font-weight:bold;">License</td><td>Dual Licensed: CC BY-ND 4.0 for PDF and HTML editions; All Rights Reserved for EPUB and print editions.</td></tr> -->
|
||||
<tr><td style="font-weight:bold;">Date</td><td>2025-12-07</td></tr>
|
||||
<tr><td style="font-weight:bold;">ISBN:</td><td>UNSPECIFIED</td></tr>
|
||||
<tr><td style="font-weight:bold;">DOI:</td><td>UNSPECIFIED</td></tr>
|
||||
<tr><td style="font-weight:bold;">State</td><td>PRE-DRAFT</td></tr>
|
||||
<!-- <tr><td style="font-weight:bold;">Source</td><td></td></tr> -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<hr style="margin:4em 0;">
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
<div class="frontmatter">
|
||||
|
||||
<!-- Title Page -->
|
||||
<h1 class="titlepage" style="margin-top:3em; font-size:2.4em; text-align:center;">Basic Book Builder</h1>
|
||||
<h2 style="text-align:center; font-weight:normal;">A Pandoc template for building books and articles</h2>
|
||||
|
||||
<div style="text-align:center; margin:2em 0;">
|
||||
<img src="lib/img/UAF-ACEP.png" alt="Cover illustration" style="max-width:350px;">
|
||||
</div>
|
||||
|
||||
<hr style="margin:3em 0;">
|
||||
|
||||
|
||||
<!-- Metadata Page -->
|
||||
<div style="text-align:left; margin-top:5em;">
|
||||
|
||||
<h2>Basic Book Builder</h2>
|
||||
<i>A Pandoc template for building books and articles</i>
|
||||
|
||||
<table style="margin-top:2em; width:50%; border-collapse:collapse;">
|
||||
<tbody>
|
||||
<tr><td style="font-weight:bold;">Author</td><td>John Haverlack</td></tr>
|
||||
<tr><td style="font-weight:bold;">Version</td><td>1.1.0</td></tr>
|
||||
<tr><td style="font-weight:bold;">Date</td><td>2026-02-04</td></tr>
|
||||
<tr><td style="font-weight:bold;">ISBN:</td><td>UNSPECIFIED</td></tr>
|
||||
<tr><td style="font-weight:bold;">DOI:</td><td>UNSPECIFIED</td></tr>
|
||||
<tr><td style="font-weight:bold;">Maturity</td><td>BETA</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>Copyright © 2026 Alaska Center for Energy and Power</p>
|
||||
|
||||
<h3>Licensing</h3>
|
||||
|
||||
<h4>Open Source Edition (PDF and HTML)</h4>
|
||||
<p>Licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License
|
||||
<ul>
|
||||
<li>License: <a href="https://creativecommons.org/licenses/by-nd/4.0/">CC BY-ND 4.0</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<!-- <h4>Commercial Edition (ebook and print)</h4>
|
||||
<p>All Rights Reserved. No part of the EPUB or printed editions may be reproduced or redistributed without permission.</p> -->
|
||||
|
||||
</div>
|
||||
|
||||
<hr style="margin:4em 0;">
|
||||
|
||||
<!-- Image attribution + perception note (PDF analog) -->
|
||||
<!-- <div style="width:100%; text-align:left; display:block; margin:1em 0;">
|
||||
<h2>Cover Illustration</Code></h2>
|
||||
</div>
|
||||
<div style="max-width:40em; margin:auto;">
|
||||
Cover illustration by <a href="$img-attribution-url$">$img-attribution$</a>.
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <hr style="margin:4em 0;">
|
||||
|
||||
<div style="max-width:40em; margin:auto;">
|
||||
<div style="width:100%; text-align:center; display:block; margin:1em 0; font-style: italic;">
|
||||
This book is dedicated to ****.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr style="margin:4em 0;"> -->
|
||||
|
||||
<script>
|
||||
window.MathJax = {
|
||||
tex: { inlineMath: [['$', '$'], ['\\(', '\\)']] },
|
||||
svg: { fontCache: 'global' }
|
||||
};
|
||||
</script>
|
||||
<script src="lib/mathjax/tex-mml-chtml.js"></script>
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
% -------------------------
|
||||
% 1. Title Page
|
||||
% -------------------------
|
||||
\begin{titlepage}
|
||||
\centering
|
||||
|
||||
\vspace*{2cm}
|
||||
|
||||
{\Huge\bfseries Basic Book Builder \par}
|
||||
\vspace{0.4cm}
|
||||
{\Large A Pandoc template for building books and articles \par}
|
||||
|
||||
\vspace{1.2cm}
|
||||
\includegraphics[width=0.5\textwidth]{lib/img/UAF-ACEP.png}
|
||||
|
||||
\vfill
|
||||
|
||||
\end{titlepage}
|
||||
|
||||
% -------------------------
|
||||
% 2. COPYRIGHT / META PAGE
|
||||
% -------------------------
|
||||
\newpage
|
||||
\thispagestyle{empty}
|
||||
|
||||
{\Large\bfseries Basic Book Builder \par}
|
||||
\vspace{0.2cm}
|
||||
{\normalsize\textit{A Pandoc template for building books and articles}\par}
|
||||
\vspace{0.4cm}
|
||||
|
||||
\renewcommand{\arraystretch}{1.3} % row spacing
|
||||
\setlength{\tabcolsep}{8pt} % column padding
|
||||
\begin{tabular}{@{}p{0.28\textwidth}p{0.65\textwidth}@{}}
|
||||
\textbf{Author:} & John Haverlack \\
|
||||
\textbf{Version:} & 1.1.0 \\
|
||||
\textbf{Date:} & 2026-02-04 \\
|
||||
\textbf{ISBN:} & UNSPECIFIED \\
|
||||
\textbf{DOI:} & UNSPECIFIED \\
|
||||
\textbf{Maturity:} & BETA \\
|
||||
\end{tabular}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\textbf{Copyright} © 2026 Alaska Center for Energy and Power
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
% ----- Licensing Section -----
|
||||
\section*{Licensing}
|
||||
|
||||
\subsection*{Open Source Edition (PDF and HTML)}
|
||||
Licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License.
|
||||
|
||||
\begin{itemize}
|
||||
\item License: \href{https://creativecommons.org/licenses/by-nd/4.0/}{CC BY-ND 4.0}
|
||||
\end{itemize}
|
||||
|
||||
% \subsection*{Commercial Edition (ebook and print)}
|
||||
% All Rights Reserved. No part of the EPUB or printed editions may be reproduced or redistributed without permission.
|
||||
|
||||
\vspace*{\fill}
|
||||
|
||||
% -------------------------
|
||||
% 3. Cover Illustration Page
|
||||
% -------------------------
|
||||
% ----- Title Page Image Note -----
|
||||
\newpage
|
||||
\thispagestyle{empty}
|
||||
|
||||
% \vspace*{1.5cm}
|
||||
|
||||
% {\Large\bfseries Cover Illustration\par}
|
||||
|
||||
% \begin{center}
|
||||
% \includegraphics[width=0.33\textwidth]{lib/img/UAF-ACEP.png}
|
||||
|
||||
% \vspace{0.6cm}
|
||||
|
||||
|
||||
% \vspace{0.8cm}
|
||||
|
||||
% {\small
|
||||
% \textit{“Cover illustration by****”}
|
||||
% \end{center}
|
||||
|
||||
|
||||
% -------------------------
|
||||
% Reset numbering
|
||||
% -------------------------
|
||||
\clearpage
|
||||
\pagenumbering{roman}
|
||||
|
||||
% -------------------------
|
||||
% Insert dedication
|
||||
% -------------------------
|
||||
|
||||
% \begin{titlepage}
|
||||
% \centering
|
||||
% \vspace*{\fill}
|
||||
|
||||
% \textit{This book is dedicated to ****.}
|
||||
|
||||
% \vspace*{\fill}
|
||||
% \end{titlepage}
|
||||
|
||||
% (Pandoc will insert the TOC next, using roman numerals)
|
||||
144
conf/header.tex
144
conf/header.tex
|
|
@ -1,144 +0,0 @@
|
|||
\usepackage{etoolbox}
|
||||
\usepackage[most]{tcolorbox}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{xparse}
|
||||
\tcbuselibrary{breakable}
|
||||
|
||||
% --- Disable floating figures globally ---
|
||||
\usepackage{float}
|
||||
\let\origfigure\figure
|
||||
\let\endorigfigure\endfigure
|
||||
\renewenvironment{figure}[1][H]{\origfigure[H]}{\endorigfigure}
|
||||
|
||||
% --- Colors ---
|
||||
\usepackage{xcolor}
|
||||
\definecolor{speculativeback}{RGB}{247,232,255} % #f7e8ff
|
||||
\definecolor{speculativeframe}{RGB}{139,43,226} % #8b2be2
|
||||
|
||||
% --- Left-align all Pandoc tables ---
|
||||
\usepackage{longtable}
|
||||
\usepackage{etoolbox}
|
||||
\makeatletter
|
||||
\patchcmd\longtable{\par}{\par\raggedright}{}{}
|
||||
\setlength{\LTleft}{0pt}
|
||||
\setlength{\LTright}{0pt}
|
||||
\makeatother
|
||||
|
||||
% Enable index generation
|
||||
\usepackage{makeidx}
|
||||
\makeindex
|
||||
|
||||
|
||||
% Helper to show a blank title if empty
|
||||
\newcommand{\blanktitle}{\mbox{}}
|
||||
|
||||
% =========================================================
|
||||
% Concept Boxes
|
||||
% =========================================================
|
||||
\newtcolorbox{infobox}[1][Information]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=blue!3!white,
|
||||
colframe=blue!50!black,
|
||||
colbacktitle=blue!10!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{proposedbox}[1][Proposed Concept]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=blue!5!white,
|
||||
colframe=blue!75!black,
|
||||
colbacktitle=blue!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{establishedbox}[1][Established Concept]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=green!5!white,
|
||||
colframe=green!75!black,
|
||||
colbacktitle=green!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{speculativebox}[1][Speculative Concept]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=speculativeback,
|
||||
colframe=speculativeframe,
|
||||
colbacktitle=speculativeback!80!white, % lighter variant for title bar
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
|
||||
\newtcolorbox{cautionbox}[1][Caution]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=orange!5!white,
|
||||
colframe=orange!75!black,
|
||||
colbacktitle=orange!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{warningbox}[1][Warning]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=orange!5!white,
|
||||
colframe=orange!75!black,
|
||||
colbacktitle=orange!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\newtcolorbox{dangerbox}[1][Danger]{%
|
||||
title=\ifstrempty{#1}{\blanktitle}{#1},
|
||||
colback=red!5!white,
|
||||
colframe=red!75!black,
|
||||
colbacktitle=red!15!white,
|
||||
fonttitle=\bfseries,
|
||||
coltitle=black,
|
||||
enhanced, sharp corners, breakable,
|
||||
after=\par\vspace{6pt}
|
||||
}
|
||||
|
||||
\usepackage{xurl}
|
||||
|
||||
\usepackage{fancyhdr}
|
||||
\setlength{\headheight}{15pt}
|
||||
|
||||
% --- Chapter-opening pages (plain style) ---
|
||||
\fancypagestyle{plain}{%
|
||||
\fancyhf{}%
|
||||
\fancyhead[C]{\leftmark} % Chapter title
|
||||
\cfoot{Basic Book Builder: A Pandoc template for building books and articles} % Book title
|
||||
\rfoot{\thepage} % Page number
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
\renewcommand{\footrulewidth}{0pt}
|
||||
}
|
||||
|
||||
% --- Normal running pages ---
|
||||
\pagestyle{fancy}
|
||||
\fancyhf{}
|
||||
|
||||
% Header
|
||||
\fancyhead[C]{\leftmark} % Chapter title (centered)
|
||||
|
||||
% Footer
|
||||
\cfoot{Basic Book Builder: A Pandoc template for building books and articles} % Book title
|
||||
\rfoot{\thepage} % Page number
|
||||
|
||||
% Line rules
|
||||
\renewcommand{\headrulewidth}{0pt} % rule under header
|
||||
\renewcommand{\footrulewidth}{0pt} % no rule above footer
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# conf/html.yaml
|
||||
from: markdown
|
||||
to: html5
|
||||
standalone: true
|
||||
output-file: build/basic-book-builder.html
|
||||
|
||||
include-before-body:
|
||||
- conf/frontmatter.html
|
||||
|
||||
metadata:
|
||||
title: "Basic Book Builder"
|
||||
title-block: false
|
||||
|
||||
# This enables EPUB TOC
|
||||
toc: true
|
||||
toc-depth: 3
|
||||
|
||||
css:
|
||||
- conf/style.css
|
||||
|
||||
resource-path:
|
||||
- .
|
||||
- lib/img
|
||||
|
||||
filters:
|
||||
- filters/callouts-html.lua
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
from: markdown+yaml_metadata_block+raw_tex
|
||||
to: latex
|
||||
standalone: true
|
||||
|
||||
# Name of the intermediate .tex file is controlled externally
|
||||
# (Makefile passes -o build/basic-book-builder.tex)
|
||||
|
||||
include-in-header:
|
||||
- conf/header.tex
|
||||
|
||||
include-before-body:
|
||||
- conf/frontmatter.tex
|
||||
|
||||
filters:
|
||||
- filters/callouts.lua
|
||||
|
||||
metadata:
|
||||
# PDF engine used during XeLaTeX compilation
|
||||
pdf-engine: xelatex
|
||||
bookmarks: false
|
||||
|
||||
variables:
|
||||
documentclass: book
|
||||
classoption:
|
||||
- openany
|
||||
fontsize: 12pt
|
||||
geometry:
|
||||
- margin=1in
|
||||
|
||||
toc: true
|
||||
toc-depth: 3
|
||||
toc-title: "Contents"
|
||||
|
||||
numbersections: true
|
||||
|
||||
# used by your header template
|
||||
graphics: true
|
||||
colorlinks: true
|
||||
linkcolor: blue
|
||||
float: false
|
||||
figure-latex-placement: H
|
||||
|
||||
resource-path:
|
||||
- .
|
||||
- lib/img
|
||||
- lib/diag
|
||||
|
||||
citeproc: true
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# conf/markdown.yaml
|
||||
from: markdown
|
||||
to: gfm
|
||||
standalone: true
|
||||
output-file: build/basic-book-builder.md
|
||||
|
||||
include-before-body:
|
||||
- conf/frontmatter-md.html # HTML frontmatter works fine here
|
||||
|
||||
metadata:
|
||||
title: "Clear Skies - A Reference Architecture for Resilient Alaskan Microgrid Cyberinfrastructure"
|
||||
title-block: false
|
||||
|
||||
toc: true
|
||||
toc-depth: 3
|
||||
|
||||
resource-path:
|
||||
- .
|
||||
- lib/img
|
||||
- lib/diag
|
||||
|
||||
filters:
|
||||
- filters/callouts-html.lua
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# Title
|
||||
title: "Basic Book Builder"
|
||||
subtitle: "A Pandoc template for building books and articles"
|
||||
name: "basic-book-builder"
|
||||
logo: "lib/img/UAF-ACEP.png"
|
||||
|
||||
# Version / Repo
|
||||
version: "1.1.0"
|
||||
date: "2026-02-04"
|
||||
state: "BETA"
|
||||
source: "https://github.com/jehaverlack/basic-book-builder"
|
||||
|
||||
# Identifiers
|
||||
doi: "UNSPECIFIED"
|
||||
isbn-pdf: "UNSPECIFIED"
|
||||
isbn-epub: "UNSPECIFIED"
|
||||
isbn-kindle: "UNSPECIFIED"
|
||||
isbn-paperback: "UNSPECIFIED"
|
||||
isbn-hardcover: "UNSPECIFIED"
|
||||
isbn-audiobook: "UNSPECIFIED"
|
||||
|
||||
# Publisher and Author
|
||||
publisher: "University of Alaska Fairbanks"
|
||||
|
||||
author: "John Haverlack"
|
||||
author-email: "jehaverlack@alaska.edu"
|
||||
affiliation: "Alaska Center for Energy and Power"
|
||||
institution: "University of Alaska Fairbanks"
|
||||
|
||||
# Copyright
|
||||
copyright: "© 2026 Alaska Center for Energy and Power"
|
||||
|
||||
# License
|
||||
license: "CC BY-ND 4.0"
|
||||
license-name: "Creative Commons Attribution-NoDerivatives 4.0 International License"
|
||||
# Open Source License
|
||||
license-os: "CC BY-ND 4.0"
|
||||
license-os-text: "Creative Commons Attribution-NoDerivatives 4.0 International License"
|
||||
license-os-url: "https://creativecommons.org/licenses/by-nd/4.0/"
|
||||
# Commercial License
|
||||
license-com: "All Rights Reserved."
|
||||
license-com-text: "No part of the EPUB or printed editions may be reproduced or redistributed without permission."
|
||||
|
||||
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# pandoc.yaml
|
||||
input-files:
|
||||
- chapters/Preface.md
|
||||
- chapters/00_Introduction.md
|
||||
- chapters/01_Getting_Started.md
|
||||
# - chapters/02_Features.md
|
||||
# - chapters/Terminology.md
|
||||
# - chapters/Citations.md
|
||||
- chapters/Appendix.md
|
||||
- chapters/AppendixA.md
|
||||
- chapters/Glossary.md
|
||||
- chapters/Index.md
|
||||
- chapters/Bibliography.md
|
||||
|
||||
from: markdown+yaml_metadata_block+raw_tex
|
||||
standalone: true
|
||||
|
||||
|
||||
metadata:
|
||||
mainfont: "Noto Serif"
|
||||
sansfont: "Noto Sans"
|
||||
monofont: "Noto Sans Mono"
|
||||
# mainfont: "Libertinus Serif"
|
||||
# sansfont: "Libertinus Sans"
|
||||
# monofont: "DejaVu Sans Mono"
|
||||
date: "" # <-- forces maketitle to exist, but blank
|
||||
link-citations: true
|
||||
|
||||
variables:
|
||||
documentclass: book
|
||||
fontsize: 12pt
|
||||
geometry:
|
||||
- margin=1in
|
||||
toc: true # ✅ Pandoc-recognized variable
|
||||
toc-depth: 3 # ✅ nested inside variables
|
||||
toc-title: "Contents" # ✅ controls TOC heading
|
||||
numbersections: true # ✅ correct key (not number-sections)
|
||||
colorlinks: true # nice PDF hyperlinks
|
||||
linkcolor: blue
|
||||
graphics: true
|
||||
float: false
|
||||
figure-latex-placement: H
|
||||
# suppress-chapter: true
|
||||
|
||||
resource-path:
|
||||
- .
|
||||
- lib/img
|
||||
- lib/diag
|
||||
|
||||
citeproc: true
|
||||
bibliography: lib/zotero.bib
|
||||
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# pdf.yaml
|
||||
to: pdf
|
||||
pdf-engine: xelatex
|
||||
output-file: build/basic-book-builder.pdf
|
||||
|
||||
include-before-body:
|
||||
- conf/frontmatter.tex
|
||||
|
||||
include-in-header:
|
||||
- conf/header.tex
|
||||
|
||||
filters:
|
||||
- filters/callouts.lua
|
||||
251
conf/style.css
251
conf/style.css
|
|
@ -1,251 +0,0 @@
|
|||
/* ------------------------------
|
||||
Base book typography
|
||||
------------------------------ */
|
||||
|
||||
body {
|
||||
font-family: "Libertinus Serif", Georgia, serif;
|
||||
max-width: 42em;
|
||||
margin: auto;
|
||||
padding: 3rem 1.25rem;
|
||||
line-height: 1.65;
|
||||
background: #fff;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Headings
|
||||
------------------------------ */
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
font-family: "Libertinus Sans", sans-serif;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2.1rem;
|
||||
}
|
||||
|
||||
h1.titlepage {
|
||||
border-bottom: 2px solid #ddd;
|
||||
padding-bottom: 0.4rem;
|
||||
margin-top: 2em;
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Front matter page
|
||||
------------------------------ */
|
||||
|
||||
.frontmatter {
|
||||
text-align: center;
|
||||
margin-top: 10vh;
|
||||
}
|
||||
|
||||
.frontmatter img {
|
||||
max-width: 30%;
|
||||
margin: 2rem auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Lists / paragraphs
|
||||
------------------------------ */
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
padding-left: 1.5em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Math block spacing
|
||||
------------------------------ */
|
||||
|
||||
.math.display {
|
||||
margin: 1.2em 0;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Callouts (final tuned spacing)
|
||||
------------------------------ */
|
||||
|
||||
.callout-established,
|
||||
.callout-proposed,
|
||||
.callout-speculative,
|
||||
.callout-caution,
|
||||
.callout-warning,
|
||||
.callout-danger {
|
||||
border-radius: 6px;
|
||||
padding: 5px; /* internal padding */
|
||||
margin-top: 5px; /* external spacing tightened */
|
||||
margin-bottom: 5px;
|
||||
border-left: 6px solid;
|
||||
background: #fefefe;
|
||||
}
|
||||
|
||||
/* Title line */
|
||||
.callout-established p:first-child strong,
|
||||
.callout-proposed p:first-child strong,
|
||||
.callout-speculative p:first-child strong,
|
||||
.callout-caution p:first-child strong,
|
||||
.callout-warning p:first-child strong,
|
||||
.callout-danger p:first-child strong {
|
||||
display: block;
|
||||
font-family: "Libertinus Sans", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 1.05rem;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* Paragraphs inside callouts */
|
||||
.callout-established p,
|
||||
.callout-proposed p,
|
||||
.callout-speculative p,
|
||||
.callout-caution p,
|
||||
.callout-warning p,
|
||||
.callout-danger p {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
line-height: 1.45; /* slightly condensed text spacing */
|
||||
}
|
||||
|
||||
/* Remove top margin on first paragraph, bottom on last */
|
||||
.callout-established p:first-child,
|
||||
.callout-proposed p:first-child,
|
||||
.callout-speculative p:first-child,
|
||||
.callout-caution p:first-child,
|
||||
.callout-warning p:first-child,
|
||||
.callout-danger p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.callout-established p:last-child,
|
||||
.callout-proposed p:last-child,
|
||||
.callout-speculative p:last-child,
|
||||
.callout-caution p:last-child,
|
||||
.callout-warning p:last-child,
|
||||
.callout-danger p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Math inside callouts */
|
||||
.callout-established .math.display,
|
||||
.callout-proposed .math.display,
|
||||
.callout-speculative .math.display,
|
||||
.callout-caution .math.display,
|
||||
.callout-warning .math.display,
|
||||
.callout-danger .math.display {
|
||||
margin: 0.4em 0;
|
||||
}
|
||||
|
||||
/* Colors */
|
||||
.callout-established {
|
||||
background: #e8f7e8;
|
||||
border-left-color: #3a8d3a;
|
||||
}
|
||||
.callout-proposed {
|
||||
background: #e8f0ff;
|
||||
border-left-color: #3b6dd8;
|
||||
}
|
||||
.callout-speculative {
|
||||
background: #f7e8ff;
|
||||
border-left-color: #8b2be2;
|
||||
}
|
||||
|
||||
.callout-caution {
|
||||
background: #fff0e8;
|
||||
border-left-color: #f5a22f;
|
||||
}
|
||||
|
||||
.callout-warning {
|
||||
background: #fff0e8;
|
||||
border-left-color: #f5a22f;
|
||||
}
|
||||
|
||||
.callout-danger {
|
||||
background: #ffe8e8;
|
||||
border-left-color: #d83b3a;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Images (in body content)
|
||||
------------------------------ */
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
margin: 1.2em auto;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Blockquotes (normal ones)
|
||||
------------------------------ */
|
||||
|
||||
blockquote {
|
||||
border-left: 4px solid #ccc;
|
||||
padding-left: 1em;
|
||||
font-style: italic;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Horizontal rule
|
||||
------------------------------ */
|
||||
|
||||
hr {
|
||||
margin: 3rem 0;
|
||||
border: none;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
/* ------------------------------
|
||||
Code (rare in your book)
|
||||
------------------------------ */
|
||||
|
||||
code {
|
||||
background: #f3f3f3;
|
||||
padding: 0.1em 0.3em;
|
||||
border-radius: 4px;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
/* Force all header cells to left-align their text */
|
||||
table thead th {
|
||||
text-align: left !important;
|
||||
vertical-align: bottom; /* optional: aligns nicely with text baseline */
|
||||
padding: 4px 8px; /* optional: consistent spacing */
|
||||
}
|
||||
|
||||
/* Make data cells match if you want consistent left alignment */
|
||||
table tbody td {
|
||||
text-align: left;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
/* Optional: keep math inline nicely aligned */
|
||||
table td .math,
|
||||
table th .math {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* Optional: make math display nicely aligned */
|
||||
table td .math.display,
|
||||
table th .math.display {
|
||||
display: block;
|
||||
margin: 0.4em 0;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/* Safer defaults for varied EPUB engines (Kindle, iBooks, KOReader, etc.) */
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0.8em;
|
||||
line-height: 1.55;
|
||||
widows: 2;
|
||||
orphans: 2;
|
||||
}
|
||||
|
||||
/* Avoid fonts that may not exist on the device */
|
||||
body {
|
||||
font-family: serif;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
/* Headings */
|
||||
h1, h2, h3 {
|
||||
font-family: serif;
|
||||
font-weight: 700;
|
||||
margin: 1.2em 0 0.5em 0;
|
||||
}
|
||||
|
||||
h1 { font-size: 1.6em; }
|
||||
h2 { font-size: 1.3em; }
|
||||
h3 { font-size: 1.1em; }
|
||||
|
||||
/* Lists and paragraphs */
|
||||
p { margin: 0.7em 0; }
|
||||
ul, ol { margin: 0.7em 0 0.7em 1.2em; }
|
||||
|
||||
/* Images */
|
||||
img { max-width: 100%; height: auto; }
|
||||
|
||||
/* Page breaks for supported readers */
|
||||
section[epub|type="titlepage"] {
|
||||
break-after: page;
|
||||
page-break-after: always; /* fallback */
|
||||
}
|
||||
section#pubmeta {
|
||||
break-after: page;
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
/* Callouts (match HTML look, keep it minimal for EPUB) */
|
||||
.callout-established,
|
||||
.callout-proposed,
|
||||
.callout-speculative {
|
||||
padding: 0.6em;
|
||||
margin: 0.7em 0;
|
||||
border-left: 0.35em solid;
|
||||
background: #fefefe;
|
||||
}
|
||||
|
||||
.callout-established { border-color: #3a8d3a; background: #e8f7e8; }
|
||||
.callout-proposed { border-color: #3b6dd8; background: #e8f0ff; }
|
||||
.callout-speculative { border-color: #8b2be2; background: #f7e8ff; }
|
||||
|
||||
/* First bold line inside a callout = title */
|
||||
.callout-established p:first-child strong,
|
||||
.callout-proposed p:first-child strong,
|
||||
.callout-speculative p:first-child strong {
|
||||
display: block;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
/* Math (MathML) spacing */
|
||||
.math.display { margin: 0.8em 0; }
|
||||
|
||||
/* Blockquotes */
|
||||
blockquote {
|
||||
border-left: 0.25em solid #bbb;
|
||||
padding-left: 0.8em;
|
||||
color: #444;
|
||||
}
|
||||
Loading…
Reference in New Issue