Commit 7801b00d authored by Alija Sabic's avatar Alija Sabic
Browse files

Update README, help instructions, and Makefile

parent 9127fe3c
......@@ -9,24 +9,42 @@ header = -----------------------------------------------------------------
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" && \
LOG = @echo "$(call print_banner,$(ac),Error Log:$(sc)$1$(rst))\e[1A" && \
grep $(ERRS) $1 -nR -A4 -B8 | fold -sw $(out_length) | \
sed --expression='s/--/$(ac)$(header)\n$(header)$(rst)/g' | \
sed --expression='s/--/$(ac)$(header)\n$(header)$(rst)/g' | \
grep --color -E -e '' -e '$(ERRS)' && echo "$(ac)$(header)\n$(header)$(rst)"
INSTRUCTIONS = "$(call print_banner,$(pr),$(sc)Help Instructions $(rst))\n"\
"Provided targets:\n\n build, view, preview, log, clean, distclean, help\n\n" \
"Set $(pr)$(dollar)TARGET$(rst) to specify the $(sc)tex$(rst) file to compile.\n" \
"Unset to turn off this help instruction.\n\n" \
"Set $(pr)$(dollar)OPTS$(rst) to pass additional options to latexmk.\n" \
"\n"\
"Provided targets:\n\n build, view, preview, log, clean, distclean, help\n" \
"\n" \
"Two 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)OPTS$(rst) is used to pass additional options to $(sc)latexmk$(rst).\n" \
"\n" \
"Examples:\n\n" \
" $(dollar) make $(pr)TARGET$(rst)=$(sc)tex/figures/logo$(rst) $(pr)OPTS$(rst)=$(sc)-gg$(rst)\n" \
" $(dollar) make $(pr)TARGET$(rst)=$(sc)tex/figures/logo$(rst) clean\n\n" \
"Export to set permanently.\n\n"\
" $(dollar) export $(pr)TARGET$(rst)=$(sc)tex/chapter.tex$(rst)\n"\
" $(dollar) make\n"\
" $(dollar) make preview\n"\
" $(dollar) make clean\n"\
"\n$(pr)$(header)$(rst)"\
"\n$(pr)$(header)$(rst)"
\ No newline at end of file
" $(dollar) make $(pr)TARGET$(rst)=$(sc)tex/figures/logo$(rst) clean\n" \
"\n" \
"Export variables to set them permanently.\n" \
"\n" \
" $(dollar) export $(pr)TARGET$(rst)=$(sc)tex/chapter.tex$(rst)\n" \
" $(dollar) make\n" \
" $(dollar) make preview\n" \
" $(dollar) make clean\n" \
"\n$(pr)$(header)$(rst)" \
"\n$(pr)$(header)$(rst)"
LATEXMK_COND = $(if $(strip $(TARGET)), \
export DEPSFILE=$(notdir $(basename $(TARGET))) && \
$(call LATEXMK, $(basename $(TARGET)).tex $1), \
export DEPSFILE=$(BASENAME) && \
$(call LATEXMK, $(BASENAME)$1) \
)
LATEXMK_ERRS = $(if $(strip $1), \
$(call LOG, $(BUILDDIR)/$(notdir $(basename $1)).log), \
$(call LOG, $(BUILDDIR)/$(basename $(BASENAME)).log) \
)
\ No newline at end of file
......@@ -14,17 +14,6 @@ BSTDIR = resources/latex-bst/
LATEXMK = latexmk $(OPTS)$1 | fold -sw $(out_length)
VIEWER = xdg-open
LATEXMK_COND = @export DEPSFILE=$(notdir $(basename $(TARGET))) && \
$(if $(strip $(TARGET)), \
$(call LATEXMK, $(basename $(TARGET).tex )$1), \
$(call LATEXMK, $(BASENAME)$1) \
&& echo '\e[1A' && echo $(INSTRUCTIONS))
LATEXMK_ERRS = $(if $(strip $1), \
$(call LOG, $(BUILDDIR)/$(notdir $(basename $1)).log), \
$(call LOG, $(BUILDDIR)/$(basename $(BASENAME)).log) \
)
all: build
build: setup
......
......@@ -4,75 +4,73 @@
Template for LaTeX document (FHTW).
== Make
== Help Instructions
You can build the main file specified in the Makefile (cf. `$BASENAME`) by issuing following command
Provided targets:
----
$ make
----
build, view, preview, log, clean, distclean, help
Two environment variables are used to configure the behavior of those targets:
Individual files or targets may be specified using `$TARGET`
* `*$TARGET*` is used to specify the tex file to compile (default: `$BASENAME`).
* `*$OPTS*` is used to pass additional options to latexmk.
---
.pass variables with `make` command
====
[subs=+macros]
----
pass:quotes[
$ make *TARGET*=demo.tex
$ make *TARGET*=resources/tex/chapter.tex
$ make *TARGET*=resources/figures/figure.tex
$ make *TARGET*=resources/tables/table.tex
pass:q[
$ make *TARGET*=resources/tex/chapter *OPTS*=-gg
$ make *TARGET*=resources/tex/chapter *clean*
]
----
====
Additionally, `$TARGET` may be exported to allow for shorter commands
---
.`export` variables to set them permanently
====
[subs=+macros]
----
pass:quotes[
pass:q[
$ export *TARGET*=resources/tex/chapter.tex
$ make
$ ...
$ make
$ make *preview*
$ make *clean*
]
----
To provide additional configuration to `latexmk` use `$OPTS`.
For instance, to force build process each time issue
[subs=+macros]
====
== Features
This beamer template provides various features, viz.
* `*.latexmkrc*` configuration
* Modularized (and resuable) chapters, figures, tables, etc. (`standalone`), e.g.,
** link:build/demo.pdf[*Main Document*]
** link:build/tw-title.pdf[*Title Page*]
** link:build/control-system.pdf[*Figure*]
** link:build/siunits.pdf[*Table*]
* Title page drawn with *TikZ*
* *Crossreferences*
* *Demos*
** Acronyms (`acro`)
** References (`natbib`)
** Itemize, Enumerate, Description, Block
** Formulas
** Illustrations
** Listings
** Tables (`tabu`)
== Notes
.read documentation on the various `LaTeX` packages
====
----
pass:quotes[
$ make *OPTS*=-gg
$ make *TARGET*=resouces/figures/figure.tex *OPTS*=-gg
]
$ texdoc <package>
----
The Makefile provides different targets, i.e.,
[horizontal]
build:: Either build using file specified with `$BASENAME`, or use `$TARGET` if set.
log:: `grep` error entries of log file of `$BASENAME` or `$TARGET`.
view:: Same as build, additionally open output with a viewer (cf. Makefile, `$VIEWER`).
preview:: Same as build, additionally open output with a viewer and rebuild on demand (cf. Makefile, `$VIEWER`).
clean:: Delete auxiliary files of build of `$BASENAME` or `$TARGET`.
distclean:: Delete all files of build of `$BASENAME` or `$TARGET`.
help:: Print help instructions.
// == Directory Structure
// ----
// build/
// resources/
// - figures/
// - images/
// - latex/
// - latex-bst/
// - latex-sty/
// - listings/
// - tables/
// - tex/
// demo.tex
// Makefile
// ----
====
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -108,6 +108,27 @@
\addcontentsline{toc}{chapter}{\bibname}
\bibliography{#2}
}
\newcommand{\biblio}[1]{
\bibliography{#1}
}
\newcommand{\bibliolist}[1]{
\biblio{#1}
\def\acrotitle{List of Acronyms}
\chapter*{\acrotitle}
\printacronyms[heading=none]
\listoffigures
\begingroup
\let\clearpage\relax
\listoftables
\renewcommand{\lstlistlistingname}{List of Listings}
\lstlistoflistings
\endgroup
}
% --------------------------------------------------------------------------------------------------------------------------------
% Acronyms
% --------------------------------------------------------------------------------------------------------------------------------
......
......@@ -19,27 +19,4 @@
%% Listings
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{listings}
\newcommand{\biblio}{
% \bibliographystyle{./../resources/latex-bst/IEEEtranSNC}
% \bibliographystyle{ksfh_nat}
\bibliography{references}
}
\newcommand{\bibliolist}{
\biblio{}
\def\acrotitle{List of Acronyms}
\chapter*{\acrotitle}
\printacronyms[heading=none]
\listoffigures
\begingroup
\let\clearpage\relax
\listoftables
\renewcommand{\lstlistlistingname}{List of Listings}
\lstlistoflistings
\endgroup
}
\ No newline at end of file
\RequirePackage{listings}
\ No newline at end of file
......@@ -136,7 +136,7 @@
% ----------------------------------------------------------------------------------------------------------------------------
% Miscellaneous
% ----------------------------------------------------------------------------------------------------------------------------
\RequirePackage{fhtw}
% \RequirePackage{fhtw}
\RequirePackage{graphicx}
\RequirePackage{textcomp}
......
......@@ -204,7 +204,7 @@
\setstretch{1.5}
\cleardoublepage
% \biblio{}
\bibliolist{}
% \biblio{references}
\bibliolist{references}
\end{document}
\ No newline at end of file
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