From aac57f0cd7aea0d101e3240a12321b2cba46fb28 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 30 Nov 2018 21:48:50 +0000 Subject: hagenberg-thesis (30nov18) git-svn-id: svn://tug.org/texlive/trunk@49284 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/hagenberg-thesis/hgb.sty | 50 ++++++---- .../tex/latex/hagenberg-thesis/hgbabbrev.sty | 2 +- .../tex/latex/hagenberg-thesis/hgbalgo.sty | 109 +++++++++++++++++++++ .../tex/latex/hagenberg-thesis/hgbarticle.cls | 14 ++- .../tex/latex/hagenberg-thesis/hgbbib.sty | 37 ++++++- .../tex/latex/hagenberg-thesis/hgbheadings.sty | 27 +---- .../tex/latex/hagenberg-thesis/hgblistings.sty | 19 +++- .../tex/latex/hagenberg-thesis/hgbmath.sty | 2 +- .../tex/latex/hagenberg-thesis/hgbreport.cls | 12 ++- .../tex/latex/hagenberg-thesis/hgbthesis.cls | 9 +- 10 files changed, 222 insertions(+), 59 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/hagenberg-thesis/hgbalgo.sty (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/hagenberg-thesis/hgb.sty b/Master/texmf-dist/tex/latex/hagenberg-thesis/hgb.sty index 41af43020dd..0522897796f 100644 --- a/Master/texmf-dist/tex/latex/hagenberg-thesis/hgb.sty +++ b/Master/texmf-dist/tex/latex/hagenberg-thesis/hgb.sty @@ -5,7 +5,7 @@ %% File encoding: ASCII \NeedsTeXFormat{LaTeX2e} -\newcommand{\hgbDate}{2017/10/28} % version string +\newcommand{\hgbDate}{2018/11/24} % version string \ProvidesPackage{hgb}[\hgbDate] % Create a default/fallback main language so it is set no matter what @@ -141,10 +141,20 @@ % Captions with font size "small" and additional margin spacing \RequirePackage[small,bf]{caption} +\DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=colon} \setlength{\captionmargin}{5mm} \setlength{\abovecaptionskip}{10pt} \setlength{\belowcaptionskip}{10pt} +%% Disable \footnote in captions: +\newcommand{\@WarnFootnoteInCaption}{% +\GenericError{}{Package hgb Error: footnotes in captions are disabled}% +{How to fix: do not place footnotes in captions!}{}}% +\DeclareCaptionTextFormat{nofootnotes}{% + \renewcommand{\footnote}[1]{\@WarnFootnoteInCaption\relax}#1} +\captionsetup{textformat=nofootnotes} + + % Make float placement easier \renewcommand{\floatpagefraction}{.9} % previously: .5 \renewcommand{\textfraction}{.1} % previously: .2 @@ -173,23 +183,15 @@ % \end{nowidows} -%% Definitions for Algorithms ------------------------------------------------- - -% 'algorithm' creates a floating environment for algorithms (\begin{algorithm}...) -\@ifundefined{chapter}% - {\RequirePackage[ruled]{algorithm}}% - {\RequirePackage[ruled,chapter]{algorithm}} - -\DeclareCaptionStyle{ruled}{labelfont=bf,labelsep=colon} +% Setup for Table of Contents (ToC) -% 'algorithmicx' returns the inner content of algorithms (\begin{algorithmic}[1]...) -\RequirePackage{algorithmicx} -\RequirePackage{algpseudocode} -\algsetlanguage{pseudocode} -\renewcommand{\algorithmicprocedure}{} % use no 'Procedure' keyword +%\RequirePackage[tocgraduated,tocbreaksstrict]{tocstyle}% %% Note: tocstyle is unsupported! +%\usetocstyle{classic}% +\RequirePackage{tocbasic}% %% tocbasic is part of koma script +\DeclareTOCStyleEntry[entryformat=\bfseries\textsf]{tocline}{chapter}% -%% Program and Algorithm Environments ---------------------------------------- +%% Program environments ---------------------------------------- % Define the program float environment: \@ifundefined{chapter}% @@ -200,14 +202,10 @@ \restylefloat*{program} \ifthenelse{\equal{\bbl@main@language}{german} \or \equal{\bbl@main@language}{ngerman}}% -{ \floatname{program}{Programm} - \floatname{algorithm}{Algorithmus} -}{} + {\floatname{program}{Programm}}{}% \ifthenelse{\equal{\bbl@main@language}{english}}% -{ \floatname{program}{Program} - \floatname{algorithm}{Algorithm} -}{} + {\floatname{program}{Program}}{}% %% Date-related commands ------------------------------------------------------ @@ -277,6 +275,16 @@ \RequirePackage{pdfpages} +%% Prevent subfigure package from being loaded ------------------------------- + +% The subfigure package is DEPRECATED (see https://ctan.org/pkg/subfigure)! +% We strongly advise against its use since it creates poor output which is not +% compatible with our quality standards. Loading this package is therefore blocked +% by default. We recommend to use the 'tabular' environment instead. + +\newcommand{\subfigure}{% +\PackageError{hgb}{Use of the 'subfigure' package is not supported in this setup, because it is obsolete}{}} + %% ---------------------------------------------------------------------------- \setlength{\fboxsep}{0mm} %globally zero fbox separator diff --git a/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbabbrev.sty b/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbabbrev.sty index 01e7f6f9838..89215160845 100644 --- a/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbabbrev.sty +++ b/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbabbrev.sty @@ -4,7 +4,7 @@ %% GitHub: https://github.com/Digital-Media/HagenbergThesis %% File encoding: ASCII -\ProvidesPackage{hgbabbrev}[2017/10/28] +\ProvidesPackage{hgbabbrev}[2018/11/24] \newcommand{\latex}{La\-TeX\xspace} % no ornamental LaTeX anymore \newcommand{\tex}{TeX\xspace} % no ornamental LaTeX anymore diff --git a/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbalgo.sty b/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbalgo.sty new file mode 100644 index 00000000000..f7f0f8c2e50 --- /dev/null +++ b/Master/texmf-dist/tex/latex/hagenberg-thesis/hgbalgo.sty @@ -0,0 +1,109 @@ +%% hgbalgo.sty + +%% Toward better looking algorithms ... +%% This package imports and pre-configures the 'algorithmicx'/'algorithmicpseudocode' packages +%% (see https://ctan.org/pkg/algorithmicx), fixes some problems and adds new functionality +%% and colors. It relies on the 'algorithm' package for typesetting float-type algorithms +%% with captions. + +%% This file is part of the Hagenberg Thesis package for creating bachelors's and masters's theses +%% Author: Wilhelm Burger (wilhelm.burger@fh-hagenberg.at) +%% GitHub: https://github.com/Digital-Media/HagenbergThesis +%% File encoding: ASCII + +\ProvidesPackage{hgbalgo}[2018/11/24] + +\RequirePackage[]{algpseudocode} % imports algpseudocode + algorithmicx (use 'noend' to turn off 'end') +\RequirePackage{calc} % for numeric calculations +\RequirePackage{xcolor} + +% Colors to be used in algorithms (can be redefined locally if desired) +%\definecolor{AlgKeywordColor}{named}{black} +%\definecolor{AlgProcedureColor}{named}{black} +%\definecolor{AlgCommentColor}{named}{black} + +\definecolor{AlgKeywordColor}{rgb}{0.00, 0.00, 0.666} % = Dark Blue +\definecolor{AlgProcedureColor}{rgb}{0.00, 0.5, 0.20} % = Dark Green +\definecolor{AlgCommentColor}{gray}{0.40} % = Gray (40% black) + +\algrenewcommand\algorithmicend{\textbf{\color{AlgKeywordColor}end}} +\algrenewcommand\algorithmicdo{\textbf{\color{AlgKeywordColor}do}} +\algrenewcommand\algorithmicwhile{\textbf{\color{AlgKeywordColor}while}} +\algrenewcommand\algorithmicfor{\textbf{\color{AlgKeywordColor}for}} +\algrenewcommand\algorithmicforall{\textbf{\color{AlgKeywordColor}for all}} +\algrenewcommand\algorithmicloop{\textbf{\color{AlgKeywordColor}loop}} +\algrenewcommand\algorithmicrepeat{\textbf{\color{AlgKeywordColor}repeat}} +\algrenewcommand\algorithmicuntil{\textbf{\color{AlgKeywordColor}until}} +\algrenewcommand\algorithmicprocedure{\textbf{\color{AlgKeywordColor}procedure}} +\algrenewcommand\algorithmicfunction{\textbf{\color{AlgKeywordColor}function}} +\algrenewcommand\algorithmicif{\textbf{\color{AlgKeywordColor}if}} +\algrenewcommand\algorithmicthen{\textbf{\color{AlgKeywordColor}then}} +\algrenewcommand\algorithmicelse{\textbf{\color{AlgKeywordColor}else}} +\algrenewcommand\algorithmicrequire{\textbf{\color{AlgKeywordColor}Require:}} +\algrenewcommand\algorithmicensure{\textbf{\color{AlgKeywordColor}Ensure:}} +\algrenewcommand\algorithmicreturn{\textbf{\color{AlgKeywordColor}return}} + +\algrenewcommand\algorithmiccomment[1]{\hfill{\color{AlgCommentColor}\(\triangleright\) #1}}% + +%% algpseudocode assumes that these keywords are non-empty: +%\algrenewcommand\algorithmicprocedure{} % no 'procedure' keyword +%\algrenewcommand\algorithmicfunction{} % no 'function' keyword + +% Use SF font and color for procedure and function names: +\newcommand{\@AlgTextProc}[1]{\textcolor{AlgProcedureColor}{\textsf{#1}}} +\algrenewcommand\textproc{\@AlgTextProc} + +% Redefinitions to remove wrong space when \algorithmicprocedure is empty. +% Inserts an empty () parameter list when no parameters are supplied: +\algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}[2]{% + \ifthenelse{\equal{\algorithmicprocedure}{}}% + {}{\algorithmicprocedure\ }% + \textproc{#1}\hskip0.75pt(#2)}% + {\algorithmicend\ \algorithmicprocedure}% + +\algdef{SE}[FUNCTION]{Function}{EndFunction}[2]{% + \ifthenelse{\equal{\algorithmicfunction}{}}% + {}{\algorithmicfunction\ }% + \textproc{#1}\hskip0.75pt(#2)}% + {\algorithmicend\ \algorithmicfunction}% + +%\algrenewcommand\Call[2]{\textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}% +\algrenewcommand\Call[2]{\textproc{#1}\hskip0.75pt(#2)}% + +%% ----------------------------------------------------------------- + +\newlength{\@AlgTmpIndent} + +%% New public macros: + +% \StateLong{} creates numbered statements like algorithmicx's \State command but +% provides consistent indentation on multi-line statements. +% Note that the statement text must be passed as an argument in {...} brackets +\newcommand*{\StateL}[1]{\State \parbox[t]{\linewidth-\ALG@thistlm}{#1\strut}}% + +% \StateNN[]{} creates non-numbered statements like algorithmicx's \Statex +% command but provides consistent indentation inside nested constructs and over multiple lines. +% The optional integer argument [] can be used to specify the nesting depth +% to counteract a bug in algorithmicx (nesting level is not set properly before the first \State +% command inside a nested construct. +\newcommand{\StateNN}[2][\numexpr\theALG@nested-1]{% default indentation = nesting - 1 + \setlength\@AlgTmpIndent{\algorithmicindent*#1}% requires calc package + \Statex\hskip\@AlgTmpIndent\parbox[t]{\linewidth-\@AlgTmpIndent}{#2\strut}% +}% + +% Macros for describing input and output of procedures and functions: +\algnewcommand\Input[1]{\StateNN[1]{\textbf{Input:} #1}}% use to describe input parameters: \Input{} +\algnewcommand\Output[1]{\StateNN[1]{\textbf{Output:} #1}}% use to describe output values: \Output{} +\algnewcommand\Returns[1]{\StateNN[1]{\textbf{Returns} #1}}% use to describe what a procedure/function returns: \Returns{