Commit c9306f14 authored by Alija Sabic's avatar Alija Sabic
Browse files

Add ASPECTRATIO and start new beamer template with options

parent 1443a834
......@@ -4,6 +4,7 @@ $builddir = $ENV{'BUILDDIR'};
$job = $ENV{'JOBNAME'};
$bibdirs = $ENV{'BIBDIRS'};
$type = $ENV{'TYPE'};
$aratio = $ENV{'ARATIO'};
$viewer = $ENV{'VIEWER'};
$recorder = 1;
......@@ -19,7 +20,11 @@ $jobname = $job;
@BIBINPUTS = ('.',$bibdirs);
# $bibtex = 'bibtex %O %B';
$pdflatex = join '', 'pdflatex %O -interaction=nonstopmode -synctex=1 -file-line-error "\PassOptionsToClass{', $type, '}{beamer} \input{%S}"';
$pdflatex = join '',
'pdflatex %O',
'-interaction=nonstopmode -synctex=1 -file-line-error "',
'\PassOptionsToClass{',$type,',aspectratio=',$aratio,'}{beamer} ',
'\input{%S}"';
$pdf_previewer = $viewer;
push @generated_exts, 'blg', 'cut', 'nav', 'snm', 'sta', 'vrb', 'synctex.gz';
\ No newline at end of file
......@@ -10,30 +10,34 @@ print_banner = $1$(header)\n==$(rst) $2$1\n$(header)$(rst)\n
ERRS = error
LOG = @echo "$(call print_banner,$(ac),Error Log:$(sc)$1$(rst))\e[1A" && \
grep $(ERRS) $1 -nR -A4 -B8 | fold -sw $(out_length) | \
echo grep $(ERRS) $1 -nR -A4 -B8 | fold -sw $(out_length) | \
sed --expression='s/--/$(ac)$(header)\n$(header)$(rst)/g' | \
grep --color -E -e '' -e '$(ERRS)' && echo "$(ac)$(header)\n$(header)$(rst)\n"
INSTRUCTIONS = "$(call print_banner,$(pr),$(sc)Help Instructions $(rst))\n" \
"Provided targets:\n\n build, view, preview, clean, distclean, log, open, help\n" \
"\n" \
"Three environment variables are used to configure the behavior of those targets:\n" \
"Four environment variables are used to configure the behavior of those targets:\n" \
"\n" \
"$(pr)$(dollar)TARGET$(rst) is used to specify the $(sc)tex$(rst) file to compile" \
"(default: $(pr)$(dollar)BASENAME$(rst)).\n" \
"$(pr)$(dollar)VARIANTS$(rst) is used to specify none, one, or multiple variants" \
"(default: $(pr)$(dollar)BASEVARIANTS$(rst)).\n" \
"$(pr)$(dollar)ASPECTRATIO$(rst) is used to specify the aspect ratio(s)" \
"(default: $(pr)$(dollar)BASEARATIO$(rst)).\n" \
"$(pr)$(dollar)OPTS$(rst) is used to pass additional options to $(sc)latexmk$(rst).\n" \
"\n" \
"Examples:\n\n" \
" $(dollar) make $(pr)OPTS$(rst)=$(sc)-gg$(rst)\n" \
" $(dollar) make $(pr)TARGET$(rst)=$(sc)resources/tex/intro$(rst) view\n" \
" $(dollar) make $(pr)VARIANTS$(rst)=$(sc)handout,presentation$(rst) build\n" \
" $(dollar) make $(pr)VARIANTS$(rst)=$(sc)handout,presentation$(rst)" \
"$(pr)ASPECTRATIO$(rst)=$(sc)43,169$(rst) build\n" \
" $(dollar) make $(pr)VARIANTS$(rst)=, view\n" \
"\n" \
"Export variables to set them permanently.\n\n" \
" $(dollar) export $(pr)TARGET$(rst)=$(sc)resources/tex/intro.tex$(rst)\n" \
" $(dollar) export $(pr)VARIANTS$(rst)=$(sc)notes$(rst)\n" \
" $(dollar) export $(pr)ASPECTRATIO$(rst)=$(sc)43$(rst)\n" \
" $(dollar) make\n" \
" $(dollar) make open\n" \
" $(dollar) make preview\n" \
......@@ -43,29 +47,65 @@ INSTRUCTIONS = "$(call print_banner,$(pr),$(sc)Help Instructions $(rst))\n"
LATEXMK_ERRS = $(if $(strip $(TARGET)),,$(eval TARGET=$(BASENAME))) \
$(if $(strip $(VARIANTS)),,$(eval VARIANTS=$(BASEVARIANTS))) \
$(if $(strip $(ASPECTRATIO)),,$(eval ASPECTRATIO=$(BASEARATIO))) \
$(foreach file,$(TARGET), \
$(eval SOURCE=$(notdir $(basename $(file)))) \
$(if $(strip $(VARIANTSLIST)), \
$(foreach variant, $(VARIANTSLIST), \
$(foreach variant,$(VARIANTSLIST), \
$(if $(strip $(ASPECTRATIOLIST)), \
$(foreach aratio,$(ASPECTRATIOLIST), \
$(call LOG, $(BUILDDIR)/$(SOURCE)-$(variant)-$(aratio).log) \
) \
, \
$(call LOG, $(BUILDDIR)/$(SOURCE)-$(variant).log) \
);, \
) \
) \
, \
$(if $(strip $(ASPECTRATIOLIST)), \
$(foreach aratio,$(ASPECTRATIOLIST), \
$(call LOG, $(BUILDDIR)/$(SOURCE)-$(aratio).log) \
) \
, \
$(call LOG, $(BUILDDIR)/$(SOURCE).log) \
) \
) \
)
LATEXMK_SELECT = $(if $(strip $(TARGET)),,$(eval TARGET=$(BASENAME))) \
$(if $(strip $(VARIANTS)),,$(eval VARIANTS=$(BASEVARIANTS))) \
$(if $(strip $(ASPECTRATIO)),,$(eval ASPECTRATIO=$(BASEARATIO))) \
$(foreach file,$(TARGET), \
$(eval SOURCE=$(basename $(file))) \
$(if $(strip $(VARIANTSLIST)), \
$(foreach variant, $(VARIANTSLIST), \
$(if $(strip $(ASPECTRATIOLIST)), \
$(foreach aratio, $(ASPECTRATIOLIST), \
export JOBNAME=$(notdir $(SOURCE))-$(variant)-$(aratio) \
TYPE=$(variant) \
ARATIO=$(aratio) && \
$(call LATEXMK,$(SOURCE),$1); \
) \
, \
export JOBNAME=$(notdir $(SOURCE))-$(variant) \
TYPE=$(variant) && \
TYPE=$(variant) \
ARATIO=43 && \
$(call LATEXMK,$(SOURCE),$1); \
) \
) \
, \
$(if $(strip $(ASPECTRATIOLIST)), \
$(foreach aratio, $(ASPECTRATIOLIST), \
export JOBNAME=$(notdir $(SOURCE))-$(aratio) \
TYPE=presentation \
ARATIO=$(aratio) && \
$(call LATEXMK,$(SOURCE),$1); \
), \
) \
, \
export JOBNAME=$(notdir $(SOURCE)) \
TYPE=presentation && \
$(call LATEXMK, $(SOURCE), $1); \
TYPE=presentation \
ARATIO=43 && \
$(call LATEXMK,$(SOURCE),$1); \
) \
) \
)
......@@ -75,14 +115,30 @@ LATEXMK_PREVIEW = $(if $(strip $(VARIANTS)),,$(eval VARIANTS=$(BASEVARIANTS)))
LATEXMK_OPEN = $(if $(strip $(TARGET)),,$(eval TARGET=$(BASENAME))) \
$(if $(strip $(VARIANTS)),,$(eval VARIANTS=$(BASEVARIANTS))) \
$(if $(strip $(ASPECTRATIO)),,$(eval ASPECTRATIO=$(BASEARATIO))) \
$(foreach file,$(TARGET), \
$(eval SOURCE=$(basename $(file))) \
$(if $(strip $(VARIANTSLIST)), \
$(foreach variant, $(VARIANTSLIST), \
$(if $(strip $(ASPECTRATIOLIST)), \
$(foreach aratio, $(ASPECTRATIOLIST), \
$(eval JOBNAME=$(notdir $(SOURCE))-$(variant)-$(aratio).pdf) \
$(VIEWER) $(BUILDDIR)/$(JOBNAME); \
) \
, \
$(eval JOBNAME=$(notdir $(SOURCE))-$(variant).pdf) \
$(VIEWER) $(BUILDDIR)/$(JOBNAME); \
), \
) \
) \
, \
$(if $(strip $(ASPECTRATIOLIST)), \
$(foreach aratio, $(ASPECTRATIOLIST), \
$(eval JOBNAME=$(notdir $(SOURCE))-$(aratio).pdf) \
$(VIEWER) $(BUILDDIR)/$(JOBNAME); \
) \
, \
$(eval JOBNAME=$(notdir $(SOURCE)).pdf) \
$(VIEWER) $(BUILDDIR)/$(JOBNAME); \
) \
) \
)
\ No newline at end of file
......@@ -3,12 +3,17 @@ include .utils
BASENAME = demo demo2
BUILDDIR = build
BASEVARIANTS = presentation,handout,notes
# BASEVARIANTS = beamer,second,handout,trans,article
BASEARATIO = 43,169
# BASEARATIO = 1610,169,149,141,54,43,32
# space separated list of requested variants
VARIANTSLIST = $(eval comma:=,) $(subst $(comma), ,$(VARIANTS))
ASPECTRATIOLIST = $(eval comma:=,) $(subst $(comma), ,$(ASPECTRATIO))
# Environment
TEXDIRS = resources/latex/:resources/latex-sty/:resources/images/:resources/listings/
TEXDIRS := $(TEXDIRS):resources/figures:resources/tables:resources/tex
TEXDIRS = resources/latex:resources/latex-sty:resources/images:resources/listings
TEXDIRS := $(TEXDIRS):resources/figures:resources/tables:resources/tex:resources/theme
BIBDIRS = resources/latex/
BSTDIR = resources/latex-bst/
......
......@@ -8,10 +8,11 @@ Provided targets:
build, view, preview, clean, distclean, log, open, help
Three environment variables are used to configure the behavior of those targets:
Four environment variables are used to configure the behavior of those targets:
* `*$TARGET*` is used to specify the tex file to compile (default: `$BASENAME`).
* `*$VARIANTS*` is used to specify none, one, or multiple variants (default: `$BASEVARIANTS`).
* `*$ASPECTRATIO*` is used to specify the aspect ratio(s) (default: `$BASEARATIO`).
* `*$OPTS*` is used to pass additional options to latexmk.
......@@ -25,7 +26,7 @@ Three environment variables are used to configure the behavior of those targets:
pass:q[
$ make *OPTS*=-gg
$ make *TARGET*=resources/tex/intro *view*
$ make *VARIANTS*=handout,presentation *build*
$ make *VARIANTS*=handout,presentation *ASPECTRATIO*=43,169 *build*
$ make *VARIANTS*=, *view*
]
----
......@@ -40,6 +41,7 @@ $ make *VARIANTS*=, *view*
pass:q[
$ *TARGET*=resources/tex/intro.tex
$ *VARIANTS*=notes
$ *ASPECTRATIO*=43
$ make
$ make *open*
$ make *preview*
......@@ -53,10 +55,15 @@ $ make *clean*
This beamer template provides various features, viz.
* `*.latexmkrc*` configuration
* One source file, three different variants, i.e.,
** link:build/demo-presentation.pdf[*Presentation*]
** link:build/demo-handout.pdf[*Handout*]
** link:build/demo-notes.pdf[*Notes*]
* One source file
** three different variants
*** link:build/demo-presentation.pdf[*Presentation*]
*** link:build/demo-handout.pdf[*Handout*]
*** link:build/demo-notes.pdf[*Notes*]
** and different aspect ratios
*** link:build/demo-presentation-43.pdf[*Presentation (4:3)*]
*** link:build/demo-presentation-169.pdf[*Presentation (16:9)*]
*** supported aspect ratios: `16:10`, `16:9`, `14:9`, `14:1`, `5:4`, `4:3`, `3:2`
* Modularized (and resuable) slides, figures, tables, etc. (`standalone`), e.g.,
** link:build/title.pdf[*Title Page*]
** link:build/control-system.pdf[*Figure*]
......
% \documentclass[aspectratio=169]{beamer}
\documentclass{beamer}
% \usepackage[texcoord,grid,gridunit=mm,gridcolor=red!10,subgridcolor=green!10]{eso-pic}
\usepackage[subpreambles,sort]{standalone}
\usepackage{preamble}
\usepackage{fhtw}
% \usepackage{preamble}
% \usepackage{fhtw}
\usetheme[front=noir]{fhtw}
\author{George Orwell}
\title{Animal Farm}
\date{\today}
\logo{\includegraphics[width=3cm]{fhtw-logo.pdf}}
\begin{document}
\def\biblio{}
\def\bibliolist{}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Test}{Subtitle}
\end{frame}
% Add acronyms used in images or not used at all by adding to the list
\acuse{FHTW,FG}
% \acuse{FHTW,FG}
% ----------------------------------------------------------------------------------------------------------------------------
% Title & ToC
% ----------------------------------------------------------------------------------------------------------------------------
\input{title}
% \input{title}
\begin{frame}[plain]{Outline}
\tableofcontents[subsubsectionstyle=hide]
\addtocounter{framenumber}{-1}
\end{frame}
% \begin{frame}[plain]{Outline}
% \tableofcontents[subsubsectionstyle=hide]
% \addtocounter{framenumber}{-1}
% \end{frame}
% ----------------------------------------------------------------------------------------------------------------------------
% Intro
% ----------------------------------------------------------------------------------------------------------------------------
\input{intro}
% \input{intro}
% ----------------------------------------------------------------------------------------------------------------------------
% Main Content
% ----------------------------------------------------------------------------------------------------------------------------
\input{content}
% \input{content}
% ----------------------------------------------------------------------------------------------------------------------------
% Outro
% ----------------------------------------------------------------------------------------------------------------------------
\input{outro}
% \input{outro}
% ----------------------------------------------------------------------------------------------------------------------------
% Appendix
% ----------------------------------------------------------------------------------------------------------------------------
\section{Appendix}
\appendix
% \section{Appendix}
% \appendix
% Acronyms
\begin{frame}[allowframebreaks]{Acronyms}
\label{acronyms}
\printacronyms
\end{frame}
% % Acronyms
% \begin{frame}[allowframebreaks]{Acronyms}
% \label{acronyms}
% \printacronyms
% \end{frame}
% References
\begin{frame}[allowframebreaks]{References}
\label{references}
\bibliography{references}
\end{frame}
% % References
% \begin{frame}[allowframebreaks]{References}
% \label{references}
% \bibliography{references}
% \end{frame}
\end{document}
\ No newline at end of file
......@@ -32,7 +32,7 @@
% Choose between default font families: \rmdefault (roman), \sfdefault (serif), \ttdefault (monospace)
\renewcommand\familydefault{\sfdefault}
% Choose between available fonts: e.g., palatino, helvet, lmodern, kpfonts, libertine, mathpazo
% \RequirePackage{helvet}
% \RequirePackage{kpfonts}
% ----------------------------------------------------------------------------------------------------------------------------
% Listings
......
......@@ -173,18 +173,18 @@
]
\coordinate (start) at ($(current page.south west)+(0.1,0.1)$);
\coordinate (end) at ($(current page.north east)+(-0.1,-0.1)$);
\coordinate (textstart) at ($(current page.south west)+(0.1,-0.1)$);
\def\identation{0.4}
% Content
\node[title text style, shift={(\identation,8)}] at (start) {\title};
\node[norm text style, shift={(\identation,7)}] at (start) {\subtitle};
\coordinate (textstart) at ($(current page.south west)+(0.1,-0.1)$);
\node[norm text style, shift={(\identation,4.75)}] at (textstart) {\authortext};
\node[norm text style, shift={(\identation,4.25)}] at (textstart) {\studentid};
\node[norm text style, shift={(\identation,3.5)}] at (textstart) {\supervisortitle};
\node[norm text style, shift={(\identation+1.5,3.5)}] at (textstart) {\supervisor};
\node[norm text style, shift={(\identation+1.5,3)}] at (textstart) {\secondsupervisor};
\node[norm text style, shift={(10,2.95)}, anchor=north east] at (textstart) {\place, \currentdate};
\node[title text style, text width=\textwidth , shift={(\identation,8)}] at (start) {\title};
\node[norm text style, text width=\textwidth , shift={(\identation,7)}] at (start) {\subtitle};
\node[norm text style, text width=\textwidth , shift={(\identation,6)}] at (textstart) {\authortext};
\node[norm text style, text width=\textwidth , shift={(\identation,5.35)}] at (textstart) {\studentid};
\node[norm text style, text width=0.15\textwidth , shift={(\identation,4.5)}] at (textstart) {\supervisortitle};
\node[norm text style, text width=0.82\textwidth , shift={(\identation+1.75,4.5)}] at (textstart) {\supervisor};
\node[norm text style, text width=0.82\textwidth , shift={(\identation+1.75,3.85)}] at (textstart) {\secondsupervisor};
\node[norm text style, shift={(10.45,3), align=right}, anchor=north east] at (textstart) {\place, \currentdate};
% Colored rectangles
\def\fw{9.4/42}
......@@ -198,9 +198,9 @@
% Logo
\def\logowidth{2.5cm}
\node[anchor=center] at ($(current page.south west)+(3*\logowidth/4,3*\identation)$) {\includegraphics[width=\logowidth]{resources/images/fhtw-logo.pdf}};
\node[anchor=center] at ($(current page.south west)+(22*\identation+4*\logowidth/2,3*\identation)$) {\includegraphics[width=\logowidth]{resources/images/placeholder.pdf}};
\node[anchor=center] at ($(current page.south west)+(180*\identation+5*\logowidth/2,3*\identation)$) {\includegraphics[width=\logowidth]{resources/images/placeholder.pdf}};
\node[anchor=south west] at ($(current page.south west)+(\identation,0.3)$) {\includegraphics[width=\logowidth]{resources/images/fhtw-logo.pdf}};
\node[anchor=south west] at ($(current page.south west)+(4.15,0.3)$) {\includegraphics[width=\logowidth]{resources/images/placeholder.pdf}};
\node[anchor=south west] at ($(current page.south west)+(7.75,0.3)$) {\includegraphics[width=\logowidth]{resources/images/placeholder.pdf}};
% Frame
\draw[draw=black,line width=0.2mm,anchor=north west] (start) rectangle (end);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment