Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Commit

Permalink
Added the user guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed May 3, 2015
1 parent 6ce71bc commit c9f6f47
Show file tree
Hide file tree
Showing 74 changed files with 718 additions and 225 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all clear
all:
cd fithesis3 && make
make -C fithesis3
make pdflatex.pdf xelatex.pdf clear

# This target typesets the pdfLaTeX example.
Expand Down
80 changes: 48 additions & 32 deletions fithesis3/Makefile
Original file line number Diff line number Diff line change
@@ -1,50 +1,63 @@
.PHONY: all clean dist dist-clean explode implode install uninstall test
SUBMAKES_REQUIRED=logo/mu logo/mu/color locale style style/mu
SUBMAKES_MISCELLANEOUS=guide/mu
SUBMAKES=$(SUBMAKES_REQUIRED) $(SUBMAKES_MISCELLANEOUS)
.PHONY: all complete clean dist dist-implode implode install uninstall test $(SUBMAKES_REQUIRED)

SUBMAKEFILES=logo/mu logo/mu/color locale style style/mu
CLASSFILES=fithesis.cls fithesis2.cls fithesis3.cls
STYLEFILES=style/*.sty style/*/*.sty style/*/*.clo
LOGOFILES=logo/*/*.eps logo/*/color/*.eps logo/*/*.pdf logo/*/color/*.pdf
LOCALEFILES=locale/*.def locale/*/*.def locale/*/*/*.def
DTXFILES=*.dtx locale/*.dtx style/*.dtx style/*/*.dtx
INSFILES=*.ins locale/*.ins style/*.ins style/*/*.ins
MAKEFILES=Makefile */Makefile */*/Makefile */*/*/Makefile ../Makefile
MAKES=../Makefile Makefile */Makefile */*/Makefile */*/*/Makefile
READMES=../README
MISCELLANEOUS=$(READMES) ../example.tex
MISCELLANEOUS=$(READMES) ../*.tex guide/*/*.tex guide/*/*/*.tex guide/*/*.bib
RESOURCES=$(STYLEFILES) $(LOGOFILES) $(LOCALEFILES)
SOURCEFILES=$(DTXFILES) $(INSFILES) docstrip.cfg
AUXFILES=fithesis.aux fithesis.log fithesis.toc fithesis.ind fithesis.idx fithesis.out fithesis.ilg fithesis.gls fithesis.glo fithesis.hd
MANUAL=fithesis.pdf
PDFSOURCES=fithesis.dtx
PDFFILES=$(MANUAL)
GUIDES=guide/mu/econ.pdf guide/mu/fi.pdf guide/mu/fsps.pdf guide/mu/fss.pdf guide/mu/law.pdf guide/mu/med.pdf guide/mu/ped.pdf guide/mu/phil.pdf guide/mu/sci.pdf
PDFFILES=$(MANUAL) $(GUIDES)
TDSFILE=fithesis3.tds.zip
CTANFILE=fithesis3.ctan.zip
DISTFILE=fithesis3.zip
DISTFILES=$(TDSFILE) $(CTANFILE) $(DISTFILE)
LATEXFILES=$(CLASSFILES) $(RESOURCES)
TEXLIVEDIR=$(shell kpsewhich -var-value TEXMFLOCAL)

# This pseudo-target creates the class files, typesets the
# technical documentation, makes the style and locale files
# and removes any auxiliary files.
all:
for dir in $(SUBMAKEFILES); do make all -C "$$dir"; done
make explode clean
# This pseudo-target expands all the docstrip
# files, converts the logos and creates the
# class files.
all: $(SUBMAKES_REQUIRED)
make $(CLASSFILES)

# This pseudo-target creates the class files and typesets
# the technical documentation.
explode: fithesis3.cls $(PDFFILES)
# This pseudo-target creates the class files
# and typesets the technical documentation and
# the guides.
complete: all
make $(PDFFILES) clean

# This pseudo-target calls a submakefile
$(SUBMAKES_REQUIRED):
make -C $@ all

# This pseudo-target performs the unit tests
test: all
cd test; make
make -C test

# This pseudo-target creates the distribution archive.
dist: all
dist: complete
make $(TDSFILE) $(DISTFILE)
rm $(TDSFILE)

# This target creates the class files.
fithesis3.cls: fithesis.ins fithesis.dtx
$(CLASSFILES): fithesis.ins fithesis.dtx
tex $<

# This target typesets the guide.
$(GUIDES): $(CLASSFILES) $(RESOURCES)
make -BC $(dir $@)

# This target typesets the technical documentation.
fithesis.pdf: $(DTXFILES)
pdflatex $<
Expand All @@ -57,16 +70,19 @@ fithesis.pdf: $(DTXFILES)
$(TDSFILE): $(LATEXFILES) $(SOURCEFILES) $(PDFFILES) $(PDFSOURCES)
DIR=`mktemp -d` && \
make install to="$$DIR" nohash=true && \
(cd "$$DIR" && zip -r -v -nw $@ *) && \
(cd "$$DIR" && zip -r -v -nw $@ *) && \
mv "$$DIR"/$@ $@ && rm -rf "$$DIR"

# This target generates a distribution file
$(DISTFILE): $(LATEXFILES) $(SOURCEFILES) $(MAKEFILES) $(PDFFILES) $(PDFSOURCES) $(MISCELLANEOUS)
$(DISTFILE): $(LATEXFILES) $(SOURCEFILES) $(MAKES) $(PDFFILES) $(PDFSOURCES) $(MISCELLANEOUS)
DIR=`mktemp -d` && mkdir --parents "$$DIR/fithesis3/fithesis3" && \
cp --verbose $(TDSFILE) "$$DIR" && \
cp --verbose $(TDSFILE) "$$DIR"/fithesis3/fithesis3 && \
cp --parents --verbose $^ "$$DIR/fithesis3/fithesis3" && \
(cd "$$DIR" && zip -r -v -nw $@ *) && \
mv "$$DIR"/$@ $@ && rm -rf "$$DIR"
(cd "$$DIR" && zip -r -v -nw $(CTANFILE) *) && \
(cd "$$DIR"/fithesis3 && zip -r -v -nw $(DISTFILE) *) && \
mv "$$DIR"/$(CTANFILE) . && \
mv "$$DIR"/fithesis3/$(DISTFILE) . && rm -rf "$$DIR"

# This pseudo-target installs the class files and
# the technical documentation into the TeX directory
Expand All @@ -75,8 +91,8 @@ $(DISTFILE): $(LATEXFILES) $(SOURCEFILES) $(MAKEFILES) $(PDFFILES) $(PDFSOURCES)
# to forgo the reindexing of the package database.
install:
@if [ -z "$(to)" ]; then \
printf "Usage: make install to=DIRECTORY\nDetected TeXLive directory: %s\n" $(TEXLIVEDIR); \
exit 1; \
printf "Usage: make install to=DIRECTORY\nDetected TeXLive directory: %s\n" $(TEXLIVEDIR); \
exit 1; \
fi

# Class, locale, style and logo files
Expand All @@ -90,7 +106,7 @@ install:
# Documentation
mkdir --parents "$(to)/doc/latex/fithesis3"
cp $(MANUAL) "$(to)/doc/latex/fithesis3/manual.pdf"

# Rebuild the hash
[ "$(nohash)" = "true" ] || texhash

Expand All @@ -101,8 +117,8 @@ install:
# to forgo the reindexing of the package database.
uninstall:
@if [ -z "$(from)" ]; then \
printf "Usage: make uninstall from=DIRECTORY\nDetected TeXLive directory: %s\n" $(TEXLIVEDIR); \
exit 1; \
printf "Usage: make uninstall from=DIRECTORY\nDetected TeXLive directory: %s\n" $(TEXLIVEDIR); \
exit 1; \
fi

# Class, locale, style and logo files
Expand All @@ -114,7 +130,7 @@ uninstall:
# Documentation
rm "$(from)/doc/latex/fithesis3/manual.pdf"
rmdir "$(from)/doc/latex/fithesis3/"

# Rebuild the hash
[ "$(nohash)" = "true" ] || texhash

Expand All @@ -123,10 +139,10 @@ clean:
rm -f $(AUXFILES)

# This pseudo-target removes the distribution archives.
dist-clean:
rm -f $(DISTFILE)
dist-implode:
rm -f $(DISTFILES)

# This pseudo-target removes any makeable files.
implode: clean dist-clean
implode: clean dist-implode
rm -f $(PDFFILES) $(CLASSFILES)
for dir in $(SUBMAKEFILES); do make implode -C "$$dir"; done
for dir in $(SUBMAKES); do make implode -C "$$dir"; done
83 changes: 49 additions & 34 deletions fithesis3/fithesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,18 @@
%
% \section{Required classes and packages}
% The class loads the \texttt{rapport3} base class and the
% \textsf{xstring}, \textsf{keyval}% and \textsf{etoolbox} packages
% following packages: \begin{itemize}
% \item\textsf{keyval} -- Adds support for parsing
% comma-delimited lists of key-value pairs.
% \item\textsf{etoolbox} -- Adds support for expanding
% code after the preamble.
% \item\textsf{ifxetex} -- Used to detect the \Hologo{XeTeX}
% engine.
% \item\textsf{inputenc} -- Used to enable the input utf-8
% encoding. This package does not get loaded under
% \Hologo{XeTeX}.
% \end{itemize}
% , % and packages
% for string parsing and comparisons.
% The \texttt{hyperref} package is also conditionally loaded during
% the expansion of the |\thesis@load| macro (see section
Expand All @@ -181,6 +192,10 @@
\RequirePackage{xstring}
\RequirePackage{keyval}
\RequirePackage{etoolbox}
\RequirePackage{ifxetex}
\ifxetex\else
\RequirePackage[utf8]{inputenc}
\fi
% \end{macrocode}
% \section{Public API}
% \label{sec:public-api}
Expand Down Expand Up @@ -238,7 +253,7 @@
% \begin{macrocode}
\def\thesis@logopath{\thesis@basepath logo/\thesis@university/}
\define@key{thesis}{logopath}{%
\def\thesis@logopath{\thesis@subdir{#1}}}
\def\thesis@logopath{\thesis@subdir#1\relax}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@subdir}
Expand All @@ -247,16 +262,14 @@
% token of |#1| isn't a slash character (|/|), or to |#1|
% otherwise.
% \begin{macrocode}
\def\thesis@subdir#1{%
\def\thesis@subdir#1#2\relax{%
\ifx\@empty#1\@empty%
\thesis@basepath%
\else%
\def\@slash{/}%
\StrLeft{#1}{1}[\@fst]%
\ifx\@fst\@slash%
#1/%
\if#1/%
#1#2/%
\else%
\thesis@basepath#1/%
\thesis@basepath#1#2/%
\fi%
\fi}
% \end{macrocode}
Expand All @@ -274,7 +287,23 @@
% \begin{macrocode}
\def\thesis@stylepath{\thesis@basepath style/}
\define@key{thesis}{stylepath}{%
\def\thesis@stylepath{\thesis@subdir{#1}}}
\def\thesis@stylepath{\thesis@subdir#1\relax}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@localepath}
% \subsubsection{The \texttt{localepath} key}
% The \marg{\texttt{localepath}=path} pair sets the \textit{path}
% containing the locale files. If the \textit{path} doesn't begin
% with a slash (\texttt{/}), it is normalized to
% \cmd{/thesis@basepath} followed by \textit{path}. The
% normalized \textit{path} is stored within the private
% |\thesis@localepath| macro,
% whose implicit value is |\thesis@basepath| followed by |locale/|.
% By default, this expands to \texttt{fithesis3/locale/}.
% \begin{macrocode}
\def\thesis@localepath{\thesis@basepath locale/}
\define@key{thesis}{localepath}{%
\def\thesis@localepath{\thesis@subdir#1\relax}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@def}
Expand Down Expand Up @@ -302,22 +331,6 @@
\long\def\thesis@declaration{#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@localepath}
% \subsubsection{The \texttt{localepath} key}
% The \marg{\texttt{localepath}=path} pair sets the \textit{path}
% containing the locale files. If the \textit{path} doesn't begin
% with a slash (\texttt{/}), it is normalized to
% \cmd{/thesis@basepath} followed by \textit{path}. The
% normalized \textit{path} is stored within the private
% |\thesis@localepath| macro,
% whose implicit value is |\thesis@basepath| followed by |locale/|.
% By default, this expands to \texttt{fithesis3/locale/}.
% \begin{macrocode}
\def\thesis@localepath{\thesis@basepath locale/}
\define@key{thesis}{localepath}{%
\def\thesis@localepath{\thesis@subdir{#1}}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ifthesis@woman}
% \subsubsection{The \texttt{gender} key}
% The \marg{\texttt{gender}=char} pair sets the author's gender to
Expand Down Expand Up @@ -591,14 +604,14 @@
% \textit{filename} is stored within the private |\thesis@locale|
% macro, whose implicit value is the main language of either the
% \textsf{babel} or the \textsf{polyglossia} package, or
% \texttt{czech}, when undefined. If the inheritance is disabled
% \texttt{english}, when undefined. If the inheritance is disabled
% for locale files, the locale file is loaded from the
% |\thesis@localepath\thesis@locale| path.
% \begin{macrocode}
\def\thesis@locale{%
% Babel detection
\ifx\languagename\undefined%
czech\else\languagename\fi}
english\else\languagename\fi}
\define@key{thesis}{locale}{%
\def\thesis@locale{#1}}
% \end{macrocode}
Expand All @@ -611,16 +624,18 @@
% \ldots |\fi| conditional is made available for testing, whether
% or not the current locale is English.
% \begin{macrocode}
\def\ifthesis@english{{
\let\ea\expandafter%
\ea\def\ea\@english\ea{\string\english}%
\ea\ea\ea\def\ea\ea\ea\@locale\ea\ea\ea{\ea\string\csname%
\thesis@locale\endcsname}%
\ea\csname\ea i\ea f\ifx\@locale\@english%
\def\ifthesis@english{
\expandafter\def\expandafter\@english\expandafter{\string%
\english}%
\expandafter\expandafter\expandafter\def\expandafter%
\expandafter\expandafter\@locale\expandafter\expandafter%
\expandafter{\expandafter\string\csname\thesis@locale\endcsname}%
\expandafter\csname\expandafter i\expandafter f\ifx\@locale%
\@english%
true%
\else%
false%
\fi\endcsname}}
\fi\endcsname}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thesis@locale@inheritance}
Expand Down
25 changes: 25 additions & 0 deletions fithesis3/guide/mu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PDFFILES=fi.pdf sci.pdf ped.pdf med.pdf fss.pdf fsps.pdf phil.pdf law.pdf econ.pdf
TEXFILES=fi.tex sci.tex ped.tex med.tex fss.tex fsps.tex phil.tex law.tex econ.tex
TEMPLATE=guide.tex
BIB=guide.bib
.PHONY: all clean
all:
make all -C examples
make $(PDFFILES) clean

# This target typesets the a PDF file.
$(PDFFILES): $(TEMPLATE) $(BIB)
sed s/faculty=?/faculty=$(basename $@)/ $(TEMPLATE) > $(basename $@).tex
pdflatex -shell-escape $(basename $@).tex
biber $(basename $@)
pdflatex -shell-escape $(basename $@).tex

# This target removes any auxiliary files.
clean:
rm -f $(TEXFILES) *.aux *.log *.out *.toc *.lot *.lof *.bbl *.blg *.pyg *.bcf *-blx.bib *.run.xml

# This target removes any auxiliary files
# and the output PDF files.
implode: clean
make implode -C examples
rm -f $(PDFFILES)
4 changes: 4 additions & 0 deletions fithesis3/guide/mu/examples/01.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
\thesissetup{basepath=../../..}
\begin{document}
Hello world!
\end{document}
9 changes: 9 additions & 0 deletions fithesis3/guide/mu/examples/02.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\documentclass{../../../fithesis3}
\thesissetup{
faculty=fi,
basepath=../../..,
autoLayout=false}
\begin{document}
A document which, except for this line,
is completely empty.
\end{document}
17 changes: 17 additions & 0 deletions fithesis3/guide/mu/examples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PDFFILES=econ-01.pdf fi-01.pdf fsps-01.pdf fss-01.pdf law-01.pdf med-01.pdf ped-01.pdf phil-01.pdf sci-01.pdf 02.pdf
.PHONY: all clean
all: $(PDFFILES) clean

# This target typesets the a PDF file.
%.pdf: %.tex
pdflatex $<
pdflatex $<

# This target removes any auxiliary files.
clean:
rm -f *.aux *.log *.out *.toc *.lot *.lof

# This target removes any auxiliary files
# and the output PDF files.
implode: clean
rm -f $(PDFFILES)
3 changes: 3 additions & 0 deletions fithesis3/guide/mu/examples/econ-01.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\documentclass{../../../fithesis3}
\thesissetup{faculty=econ}
\input01
3 changes: 3 additions & 0 deletions fithesis3/guide/mu/examples/fi-01.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\documentclass{../../../fithesis3}
\thesissetup{faculty=fi}
\input01
3 changes: 3 additions & 0 deletions fithesis3/guide/mu/examples/fsps-01.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\documentclass{../../../fithesis3}
\thesissetup{faculty=fsps}
\input01
3 changes: 3 additions & 0 deletions fithesis3/guide/mu/examples/fss-01.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\documentclass{../../../fithesis3}
\thesissetup{faculty=fss}
\input01
3 changes: 3 additions & 0 deletions fithesis3/guide/mu/examples/law-01.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\documentclass{../../../fithesis3}
\thesissetup{faculty=law}
\input01
Loading

0 comments on commit c9f6f47

Please sign in to comment.