cleanup and bring in line

This commit is contained in:
Ren Kararou 2023-10-23 15:49:44 -05:00
parent d3d6e22c8c
commit 6c326410fe
Signed by: spicywolf
GPG key ID: B0BA4EEC0714F8E6
8 changed files with 56 additions and 220 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
build/
*.swp
*.bak

2
Jenkinsfile vendored
View file

@ -9,7 +9,7 @@ agent { label 'tex' }
}
post {
always {
archiveArtifacts artifacts: 'build/*.pdf', fingerprint: true
archiveArtifacts artifacts: 'build/*.{pdf,epub}', fingerprint: true
}
}
}

110
Makefile
View file

@ -1,95 +1,27 @@
# Build variables
BASEBDIR=./build
BDIR=$(BASEBDIR)
SDIR=./src
BNAME=aetherials-`git show --oneline | head -1 | cut -d" " -f1`
CONF=default.cfg
SOURCE=main.tex
TEMP=templ.tex
.PHONY : all
all: pdf epub
# Author and metadata
# THESE FIELDS MAY NOT CONTAIN ANY SEMICOLONS!
TITLE=Ætherials: a collection of short stories
PENNAME=Liette Faerchild
LEGALNAME=Ren Kararou
PRONOUNS=fae/faer
STREETADDR=1010 Fake Blvd
LASTADDR=Denver, CO
EMAIL=ren@kararou.space
PHONE=(303)555-4202
build/%.pdf : src/%.tex
@echo "Building $@... $^"
@if [ ! -d "./build" ]; then mkdir ./build; fi
@pdflatex --output-dir ./build $<
@pdflatex --output-dir ./build $<
all: pdf cleanbuild timestamp
build/%.epub : src/%.tex
@echo "Building $@... $^"
@if [ ! -d "./build" ]; then mkdir ./build; fi
@pandoc -f latex $< -o $@
timestamp: mkbuild
if [ -f $(BDIR)/$(BNAME).epub ]; then mv $(BDIR)/$(BNAME).epub $(BDIR)/$(BNAME)-`date -u +%d%m%y-%H%M`.epub; fi
if [ -f $(BDIR)/$(BNAME).pdf ]; then mv $(BDIR)/$(BNAME).pdf $(BDIR)/$(BNAME)-`date -u +%d%m%y-%H%M`.pdf; fi
if [ -f $(BDIR)/$(BNAME).docx ]; then mv $(BDIR)/$(BNAME).docx $(BDIR)/$(BNAME)-`date -u +%d%m%y-%H%M`.docx; fi
pdf : build/aetherials.pdf
mkbuild:
if [ ! -d $(BDIR) ]; then mkdir -p $(BDIR); fi
epub : build/aetherials.epub
mktemp: mkbuild
if [ ! -f $(BDIR)/$(TEMP) ]; then cp $(SDIR)/$(SOURCE) $(BDIR)/$(TEMP); fi
wordcount: mktemp
# This only works when you've got
sed -i "s;WORDCOUNT;`cat $(SDIR)/chapters/*.tex | wc -w`;g" \
$(BDIR)/$(TEMP)
repo: mktemp
sed -i "s;REPO;`git remote get-url origin`;g" $(BDIR)/$(TEMP)
title: mktemp
sed -i "s;PROJECT;$(TITLE);g" $(BDIR)/$(TEMP)
phone: mktemp
sed -i "s;PHONE;$(PHONE);g" $(BDIR)/$(TEMP)
pen: mktemp
sed -i "s;PENNAME;$(PENNAME);g" $(BDIR)/$(TEMP)
# Change the following line's -f# to decide which name to use
# LNAME needs to be the family name.
sed -i "s;SNAME;`echo $(PENNAME) | cut -d" " -f2`;g" $(BDIR)/$(TEMP)
email: mktemp
sed -i "s;EMAIL;$(EMAIL);g" $(BDIR)/$(TEMP)
3ppn: mktemp
sed -i "s;PRONOUNS;$(PRONOUNS);g" $(BDIR)/$(TEMP)
addr: mktemp
sed -i "s;STREETADDR;$(STREETADDR);g" $(BDIR)/$(TEMP)
sed -i "s;LASTADDR;$(LASTADDR);g" $(BDIR)/$(TEMP)
lname: mktemp
sed -i "s;LEGALNAME;$(LEGALNAME);g" $(BDIR)/$(TEMP)
template: mktemp wordcount repo title phone pen email 3ppn addr lname
if [ -f $(BDIR)/$(TEMP) ]; \
then mv $(BDIR)/$(TEMP) $(BDIR)/$(SOURCE); \
else cp $(SDIR)/$(SOURCE) $(BDIR)/$(SOURCE); \
fi
pdf: template
pdflatex -jobname=$(BNAME) -output-directory=$(BDIR) $(BDIR)/$(SOURCE)
epub: template
tex4ebook -f epub -c $(SDIR)/$(CONF) -j $(BNAME) $(BDIR)/$(SOURCE)
mv $(BNAME).epub $(BDIR)
word: template
pandoc $(BDIR)/$(SOURCE) -o $(BDIR)/$(BNAME).docx
spellcheck:
for c in $(SDIR)/chapters/*.tex; do aspell -t -c $${c}; done
cleanbuild:
rm -rf $(BDIR)/*.log $(BDIR)/*.aux $(BDIR)/*.toc $(BDIR)/$(TEMP) \
$(BDIR)/$(SOURCE) ./*.opf ./*.html ./*.aux ./*.css ./*.dvi \
./*-epub/ ./*-mobi/ ./*.idv ./*.lg ./*.log ./*.toc ./*.xref \
./*.4ct ./*.4tc ./*.ncx ./*.tmp $(SDIR)/chapters/*.bak
clean: cleanbuild
rm -rf $(BASEBDIR)
.PHONY : release
release : pdf epub
@echo "Building release.... $<"
@if [ ! -d "./release" ]; then mkdir ./release; fi
@cp ./build/*.pdf ./release/
@cp ./build/*.epub ./release/
clean :
@rm -rf *.aux *.dvi *.log *.out *.pdf *.bak ./build/ ./release/

BIN
cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

32
src/aetherials.tex Normal file
View file

@ -0,0 +1,32 @@
% Document Definition
\documentclass[9pt]{extbook}
% Required Packages
\usepackage[a6paper, total={3.3in, 4.6in}, bottom=0.6in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{ragged2e}
\usepackage{titlesec}
% Document
\title{{\AE}therials}
\author{Liette Fairchild}
\begin{document}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\chapter{The Datacentre}
\input{src/chapters/thedatacentre.tex}
\chapter{An Arthurian Tale}
\input{src/chapters/arthurian.tex}
%\chapter{Accidental Summoning}
%\input{src/chapters/summoning.tex}
\end{document}

View file

@ -1 +0,0 @@
I keep having weird dreams about things of all natures, as I think about technological problems and other assorted issues. So consider this anthology of aetherial short stories as some weird look into my demented head.

View file

@ -1,129 +0,0 @@
% Document Definition
\documentclass[12pt]{book}
% Required Packages
\usepackage[letterpaper, margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{ragged2e}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage{times}
\usepackage{subfiles} % Load me last
% Package Options
% Headings bullshit
\pagestyle{fancy}
\fancyhead[L,C]{}
\fancyhead[R]{SNAME / PROJECT / \thepage}
\fancyfoot[L,C,R]{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% Formatting Stuff
\setlength{\parindent}{0.5in}
% Macros
%%% \mkchap
%%% used as \mkchap{toc number}{title}{subtitle}
\newcommand{\mkchap}[3]{
\newpage
\vspace*{3in}
\addcontentsline{toc}{chapter}{#1 - #2}
\begin{center}
#2
{\small #3}
\end{center}
\vspace{0.5in}
}
%%% \mkinfo
%%% used as \mkinfo{name}{pronouns}{address}{phone}{email}
\newcommand{\mkinfo}[5]{
\begin{flushleft}
\singlespacing
#1 (#2)\newline
#3\newline
#4\newline
#5
\end{flushleft}
}
%%% \mktitle
%%% used as
%%% \mktitle{title}{penname}{srcuri}%
%%% {legalname}{pronouns}%
%%% {address}{phone}{email}%
%%% {wc}
\newcommand{\mktitle}[9]{
\begin{titlepage}
\mkinfo{#4}{#5}{#6}{#7}{#8}
\center
\vspace*{3in}
#1
by #2
\vspace{1in}
{\tiny
As compiled from \LaTeX source on \today.
A copy of the source can be found at:
#3
}
\vspace{\fill}
\center #9 words
\end{titlepage}
}
\newcommand{\mkack}{
\newpage
\vspace*{3in}
\addcontentsline{toc}{chapter}{Acknowledgements}
\begin{center}
Acknowledgements
\end{center}
\vspace{0.5in}
\subfile{src/ack}
}
\newcommand{\mkfw}{
\newpage
\vspace*{3in}
\addcontentsline{toc}{chapter}{Foreword}
\begin{center}
Foreword
\end{center}
\vspace{0.5in}
\subfile{src/fw}
}
% Document
\begin{document}
\begin{doublespacing}
\mktitle{PROJECT}{PENNAME}%
{REPO}%
{LEGALNAME}{PRONOUNS}%
{STREETADDR\newline%
LASTADDR}{PHONE}%
{EMAIL}%
{WORDCOUNT}
\mkfw
\setcounter{page}{1}
% canon worthy
\mkchap{1}{The Datacentre}{}
\subfile{src/chapters/thedatacentre}
\mkchap{2}{An Arthurian Tale}{}
\subfile{src/chapters/arthurian}
% Need acknowledgements before enabling this.
% \mkack
\end{doublespacing}
\end{document}