Browse Source

Improving on workflow

JoostSijm 4 years ago
parent
commit
ac8566613a

+ 1 - 0
.gitignore

@@ -31,5 +31,6 @@ publish.tex
 main.pdf
 main.png
 published/
+docs/
 config.tex
 .env

+ 12 - 23
Makefile

@@ -5,35 +5,22 @@ export
 
 main: pdf
 
-# pdf			: generate the document as pdf
-# publish		: make a copy of pdf with desired name
-# watch			: continuious watch for changes
-# clean			: remove regeneratable latex files, except output
-# purge			: remove regeneratable latex files
-# init			: create config.tex and .env files
-# config		: copy clean config.tex file
-# env			: copy clean .env file
-# ignore		: add config.tex and .env to .gitignore
-# acknowledge	: remove config.tex and .env from .gitignore
-
 pdf: version
 	latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex
 
 publish: version
 	if [ ! -d "published" ]; then mkdir published; fi
+	if [ ! -d "published/$(currentvolume)_$(currentissue)" ]; then mkdir published/$(currentvolume)_$(currentissue); fi
 	sed -i 's/\\pagecolor/%\\pagecolor/g' config.tex
 	latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex 
 	sed -i 's/%\\pagecolor/\\pagecolor/g' config.tex
-	cp $(publish).pdf published/$(publish)_$(currentvolume)_$(currentissue).pdf
-	cp $(publish).pdf published/$(publish)_$(currentvolume)_$(currentissue)_$(shell date --iso-8601=seconds).pdf
+	cp $(document).pdf published/$(currentvolume)_$(currentissue)/$(publish).pdf
+	cp $(document).pdf published/$(currentvolume)_$(currentissue)/$(publish)_$(shell date --iso-8601=seconds).pdf
 	latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf $(document).tex 
-	convert -verbose -density 150 published/$(publish)_$(currentvolume)_$(currentissue).pdf -strip -quality 100 -sharpen 0x1.0 -append published/$(publish)_$(currentvolume)_$(currentissue).png
-	convert published/$(publish)_$(currentvolume)_$(currentissue).png -trim published/$(publish)_$(currentvolume)_$(currentissue).png
-	cp published/$(publish)_$(currentvolume)_$(currentissue).png published/$(publish)_$(currentvolume)_$(currentissue)_$(shell date --iso-8601=seconds).png
-
-version:
-	sed -i '/currentvolume/c\\\currentvolume{$(currentvolume)}' config.tex
-	sed -i '/currentissue/c\\\currentissue{$(currentissue)}' config.tex
+	convert -verbose -density 150 published/$(currentvolume)_$(currentissue)/$(publish).pdf -strip -quality 100 -sharpen 0x1.0 -append published/$(currentvolume)_$(currentissue)/$(publish).png
+	convert published/$(currentvolume)_$(currentissue)/$(publish).png -trim published/$(currentvolume)_$(currentissue)/$(publish).png
+	cp published/$(currentvolume)_$(currentissue)/$(publish).png published/$(currentvolume)_$(currentissue)/$(publish)_$(shell date --iso-8601=seconds).png
+	cp docs published/$(currentvolume)_$(currentissue) -r
 
 watch:
 	latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -pvc $(document).tex
@@ -44,6 +31,10 @@ clean:
 purge:
 	latexmk -C
 
+version:
+	sed -i '/currentvolume/c\\\currentvolume{$(currentvolume)}' config.tex
+	sed -i '/currentissue/c\\\currentissue{$(currentissue)}' config.tex
+
 init: config env docs
 
 config: FORCE
@@ -53,9 +44,7 @@ env:
 	cp example.env .env
 
 docs:
-	cp docs/template_news.tex docs/news.tex
-	cp docs/template_short_news.tex docs/short_news.tex
-
+	cp template_docs docs -r
 
 ignore: acknowledge
 	echo config.tex >> .gitignore

+ 0 - 5
deploy.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-cp template_paperconfig.tex paperconfig.tex
-cp docs/template_news.tex docs/news.tex
-cp docs/template_short_news.tex docs/short_news.tex

+ 0 - 0
docs/template_news.tex → docs/template_docs/template_news.tex


+ 0 - 0
docs/template_short_news.tex → docs/template_docs/template_short_news.tex


+ 156 - 0
template_docs/template_news.tex

@@ -0,0 +1,156 @@
+\byline{\textbf{\Large Craftbroec Pledge}}{Bèrg C.}
+Wij van Craftbroec helpen graag mee aan de opbouw van Noord-Nederland zodat deze provincie aantrekkelijker wordt voor spelers.
+Daarom komen we met het volgende plan:
+
+\begin{center}
+	\textbf{\textit{\huge 2.000.000.000}}\\
+	\textit{olie en ore voor Noord-Nederland}\\
+\end{center}
+
+Dit is het doel dat we met onze party willen bereiken binnen een week.
+We houden jullie op de hoogte van de status van deze uitdaging!
+\closearticle{}
+
+\byline{\textbf{\Large Grafiek}}{Bèrg C.}
+Een mooie grafiek!
+
+\begin{tikzpicture}
+	\begin{axis}[
+		xbar, xmin				= 0,
+		xlabel					= Totaal gedoneerd,
+		y				 		= 4ex,
+		enlarge y limits		= 0.3,
+		tickwidth				= 0pt,
+		axis x line*			= none,
+		axis y line*			= none,
+		ytick					= data,
+		nodes near coords align	= horizontal,
+		nodes near coords 		= \pgfmathprintnumber\pgfplotspointmeta\ KK,
+		xtick					= {500,1000,1500,2000},
+		symbolic y coords		= 
+			{%
+				Doel,
+				Totaal,
+				Olie,
+				Ore,
+			},
+		every node near coord/.append style = 
+			{%
+				xshift=5pt,
+				yshift=-13pt,
+				anchor=east,
+				font=\footnotesize
+			},
+		]
+		\addplot[white,fill=white] coordinates
+			{%
+				(600,Ore)
+				(1046,Olie)
+				(1646,Totaal)
+				(2000,Doel)
+			};
+	\end{axis}
+\end{tikzpicture}
+\closearticle{}
+
+\byline{\textbf{\Large Wow een pie-chart}}{Bèrg C.}
+\color{black}
+\begin{tikzpicture}
+	\tikzset{%
+		lines/.style={draw=none},
+	}
+	\pie [text=inside, scale font, explode=0.02, radius=4, color=white]
+		{%
+			25/ DIP,
+			23/ TBL,
+			12/ CB,
+			 9/ DCP,
+			 9/ NVP,
+			 8/ FVD,
+			 3/ NCP,
+			11/ Overig
+		}
+\end{tikzpicture}
+\color{white}
+\captionof{figure}{Verdeling in het parlement}
+
+\vfill\null{}
+\columnbreak{}
+
+Hier een polar-chart
+
+\color{rr-background}
+\begin{tikzpicture}
+	\tikzset{%
+		lines/.style={draw=none},
+	}
+	\pie[
+		polar,
+		scale font,
+		text		= inside,
+		explode		= 0.02,
+		radius		= 5,
+		color		= white,
+		style		= lines,
+		]
+		{%
+			29/ Nationaalisme,
+			11/ Liberaal,
+			 8/ Conserv.
+		}
+\end{tikzpicture}
+\color{white}
+
+Verkiezingen uitslag in een grafiek
+\pgfplotstableread[col sep=&, header=true]{%
+    description & DIP & TBL & CB & DCP
+    10–2 & 29.83 & 15.79 & 10.53 & 12.29
+    15–2 & 21.84 & 16.18 &  6.75 & 14.3
+    20–2 & 21.75 & 18.01 & 12.40 & 11.17
+    25–2 & 25.28 & 23.08 & 12.09 & 8.8
+     2–3 & 25.59 & 22.10 & 13.96 & 10.47
+     7–3 & & 22 & 14 & 10
+}\datatableentry{}
+\begin{tikzpicture}
+    \begin{axis}[
+        title 				= Verkiezingen,
+        enlarge y limits	= {value=0.2,upper},
+        xtick				= data,
+        xticklabels			= {10–2,15–2,20–2,25–2,2–3,7–3},
+        x tick label style	= {rotate=-45,anchor=west,font=\tiny},
+        legend style		= {font=\tiny,legend pos=north west,legend cell align=left, fill=none},
+    ]
+        \addlegendentry{DIP};
+        \addplot [loosely dashed] table [y=DIP, x expr=\coordindex] {\datatableentry};
+        \addlegendentry{TBL};
+        \addplot [densely dashed] table [y=TBL, x expr=\coordindex] {\datatableentry};
+        \addlegendentry{CB};
+        \addplot [dotted] table [y=CB, x expr=\coordindex] {\datatableentry};
+        \addlegendentry{DCP};
+        \addplot [dashed] table [y=DCP, x expr=\coordindex] {\datatableentry};
+    \end{axis}
+\end{tikzpicture}
+
+\noindent\fbox{%
+	\begin{minipage}{\dimexpr\linewidth-12pt\relax}
+		\begin{multicols}{2}
+			\centering
+			\includegraphics[height=3.5cm]{figs/adlogo} \\
+			\columnbreak{}
+			\textit{Noord-Nederland}
+			\textbf{Hollands Goud}
+			Een advertentie. Vandaag kost het maar \$17.5mil om een ijsje te kopen.
+		\end{multicols}
+	\end{minipage}
+}
+
+\byline{\textbf{\Large Een table met informatie}}{Bèrg C.}
+\begin{tabular}{lcc}
+	Type & Bulgarije & Gem Nederland \\
+	\hline
+	Hospital	& 153	& 928	\\
+	School		& 93	& 528	\\
+	Missile		& 250	& 1016	\\
+	Power		& 400	& 794	\\
+	Housefund	& 2500	& 4906	\\
+\end{tabular}

+ 7 - 0
template_docs/template_short_news.tex

@@ -0,0 +1,7 @@
+\byline{\textbf{\large Craftbroec Pledge}}{Bèrg C.}
+Wij van Craftbroec helpen graag mee aan de opbouw van Noord-Nederland zodat deze provincie aantrekkelijker wordt voor spelers.
+\closearticle{}
+
+\byline{\textbf{\large Meer nieuws}}{Bèrg C.}
+Hier is nog een template nieuws bericht zodat het er wat opgevuld er uit komt te zien.
+Dit is voor je eigenveiligheid, wat we hier mee bedoelen weten we zelf ook niet zeker maar we hopen dat je vandaag een feine dag heb.