Skip to content
Snippets Groups Projects
Commit 779da3ad authored by Jan Wille's avatar Jan Wille
Browse files

implement abstract

parent a993c69b
Branches
Tags
No related merge requests found
...@@ -7,8 +7,15 @@ All notable changes to this project will be documented in this file. ...@@ -7,8 +7,15 @@ All notable changes to this project will be documented in this file.
### Fixed ### Fixed
- implement the `abstract` enviroment to behave as pre v3
- removed debug print from `latexmk` inkscape recipy - removed debug print from `latexmk` inkscape recipy
### Added
- option `abstract`
- `abstract=keywords|nokeywords` to enable/disable the display of keywords after the abstract
- `abstract=totoc|notoc` to add the abstract to the TOC
## [3.0] ## [3.0]
### Breaking ### Breaking
......
No preview for this file type
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%% %%
\NeedsTeXFormat{LaTeX2e}[2022-06-01] \NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesClass{HsH-article} \ProvidesClass{HsH-article}
[2024-04-25 3.01 HsH-class based on KOMA] [2024-04-26 3.01 HsH-class based on KOMA]
\let\HsHClassName\@currname \let\HsHClassName\@currname
\def\HsHClassName@ParrentClass{% \def\HsHClassName@ParrentClass{%
scrartcl% scrartcl%
...@@ -122,6 +122,37 @@ ...@@ -122,6 +122,37 @@
\AtEndOfClass{% \AtEndOfClass{%
\headheight=\HsH@opt@headheight% \headheight=\HsH@opt@headheight%
} }
\newif\if@HsH@option@abstract@show@keywords
\def\HsH@abstract@chap{\addchap*}
\DefineFamilyKey{HsH}{abstract}{%
\begingroup
\FamilySetNumerical{HsH}{abstract}{@tempa}{%
{keywords}{0},%
{nokeywords}{1},%
{totoc}{2},{toc}{2},%
{notoc}{3},{nottotoc}{3},%
}{#1}
\ifx\FamilyKeyState\FamilyKeyStateProcessed
\aftergroup\FamilyKeyStateProcessed
\ifcase\@tempa% 0
\endgroup
\@HsH@option@abstract@show@keywordstrue
\or% 1
\endgroup
\@HsH@option@abstract@show@keywordsfalse
\or% 2
\endgroup
\def\HsH@abstract@chap{\addchap}
\or% 3
\endgroup
\def\HsH@abstract@chap{\addchap*}
\else% should never be
\endgroup
\fi
\else
\endgroup
\fi
}
\DefineFamilyKey{HsH}{twoside}[semi]{% \DefineFamilyKey{HsH}{twoside}[semi]{%
\HsH@Options@PassToParrent{twoside=#1,BCOR=1cm} \HsH@Options@PassToParrent{twoside=#1,BCOR=1cm}
\FamilyKeyStateProcessed \FamilyKeyStateProcessed
...@@ -162,6 +193,7 @@ ...@@ -162,6 +193,7 @@
headheight=2.15\baselineskip, headheight=2.15\baselineskip,
toc=listof, toc=listof,
toc=bibliography, toc=bibliography,
abstract=keywords,
faculty=none, faculty=none,
} }
\FamilyProcessOptions{HsH}\relax \FamilyProcessOptions{HsH}\relax
...@@ -361,6 +393,20 @@ ...@@ -361,6 +393,20 @@
\renewcommand{\labelitemii}{\raisebox{.3ex}{\scalebox{0.7}{$\circ$}}} \renewcommand{\labelitemii}{\raisebox{.3ex}{\scalebox{0.7}{$\circ$}}}
\renewcommand{\labelitemiii}{\raisebox{.1ex}{-}} \renewcommand{\labelitemiii}{\raisebox{.1ex}{-}}
\renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}} \renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}}
\defcaptionname{german,ngerman}\abstractname{Abstract}
\newcaptionname{english}\keywordsname{Keywords}
\newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter}
\renewenvironment{abstract}{
\quotation
\setparsizes{\z@}{\z@}{.25\linewidth \@plus 1fil}\selectfont
\HsH@abstract@chap{\abstractname}
}{%
\ifx\@keywords\@empty\else\if@HsH@option@abstract@show@keywords
\par\bigskip
\noindent\textbf{\keywordsname}\hskip 2em\@keywords
\fi\fi\par
\endquotation
}
\upsubscripts \upsubscripts
\raggedbottom \raggedbottom
\let\layercontentsmeasure\relax \let\layercontentsmeasure\relax
...@@ -551,7 +597,7 @@ ...@@ -551,7 +597,7 @@
\global\let\@lowertitleback\@empty \global\let\@lowertitleback\@empty
\global\let\@dedication\@empty \global\let\@dedication\@empty
\global\let\@matrikelnr\@empty \global\let\@matrikelnr\@empty
\global\let\@prof\@empty \global\let\@professor\@empty
\global\let\author\relax \global\let\author\relax
\global\let\title\relax \global\let\title\relax
\global\let\extratitle\relax \global\let\extratitle\relax
......
...@@ -74,7 +74,7 @@ http://www.latex-project.org/lppl.txt ...@@ -74,7 +74,7 @@ http://www.latex-project.org/lppl.txt
%<report>\ProvidesClass{HsH-report} %<report>\ProvidesClass{HsH-report}
%<standalone>\ProvidesClass{HsH-standalone} %<standalone>\ProvidesClass{HsH-standalone}
%<*article|report|standalone> %<*article|report|standalone>
[2024-04-25 3.01 HsH-class based on KOMA] [2024-04-26 3.01 HsH-class based on KOMA]
%</article|report|standalone> %</article|report|standalone>
%<*driver> ^^A ---------- documentation driver ----------------------------------------- %<*driver> ^^A ---------- documentation driver -----------------------------------------
\documentclass{ltxdoc} \documentclass{ltxdoc}
...@@ -253,6 +253,16 @@ http://www.latex-project.org/lppl.txt ...@@ -253,6 +253,16 @@ http://www.latex-project.org/lppl.txt
% message. The emssage should tell you what value you need, but you can pass any % message. The emssage should tell you what value you need, but you can pass any
% valid length. % valid length.
% %
% \DescribeOption{abstract}
% The \opt{abstract=\meta{opt}} option allows you to configure different behaviors of the abstract.
% The availabel options are described below:
% \begin{options}
% \item[keywords] Print the \cmd{\keywords} after the abstract.
% \item[nokeywords] Do \emph{not} print the \cmd{\keywords} after the abstract.
% \item[totoc] The abstract will be listed in the table of contentes.
% \item[notoc] The abstract will \emph{not} be listed in the table of contentes.
% \end{options}
%
% \paragraph{Often relevant \KOMAScript\ options} % \paragraph{Often relevant \KOMAScript\ options}
% The following options are implemented by the parrent classes and only listed here % The following options are implemented by the parrent classes and only listed here
% for completness. For more detils, see \href{http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf?page=239#chapter.3}{its manual}. % for completness. For more detils, see \href{http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf?page=239#chapter.3}{its manual}.
...@@ -272,11 +282,10 @@ http://www.latex-project.org/lppl.txt ...@@ -272,11 +282,10 @@ http://www.latex-project.org/lppl.txt
% the inner edge. % the inner edge.
% %
% \DescribeOption{BCOR} % \DescribeOption{BCOR}
% The \opt{BCOR=}\meta{dim} option allows you to define a custom binding-correction. % The \opt{BCOR=\meta{dim}} option allows you to define a custom binding-correction.
% Any valid length can be put here, but to large of a value will shrink the outer % Any valid length can be put here, but to large of a value will shrink the outer
% margin to a not-desirable level. % margin to a not-desirable level.
% %
%
% \subsection{Standalone specific options} % \subsection{Standalone specific options}
% The \cls{standalone} utillity class has some special options which are documented % The \cls{standalone} utillity class has some special options which are documented
% here. % here.
...@@ -640,6 +649,47 @@ http://www.latex-project.org/lppl.txt ...@@ -640,6 +649,47 @@ http://www.latex-project.org/lppl.txt
% \end{macrocode} % \end{macrocode}
% \end{option} % \end{option}
% %
% \begin{option}{abstract}
% The \opt{abstract} option sets multiple different switches and configureations.
% We first define the needed macros:
% \begin{macrocode}
\newif\if@HsH@option@abstract@show@keywords
\def\HsH@abstract@chap{\addchap*}
% \end{macrocode}
% Now the actuall option can be defiend to handle all the cases.
% \begin{macrocode}
\DefineFamilyKey{HsH}{abstract}{%
\begingroup
\FamilySetNumerical{HsH}{abstract}{@tempa}{%
{keywords}{0},%
{nokeywords}{1},%
{totoc}{2},{toc}{2},%
{notoc}{3},{nottotoc}{3},%
}{#1}
\ifx\FamilyKeyState\FamilyKeyStateProcessed
\aftergroup\FamilyKeyStateProcessed
\ifcase\@tempa% 0
\endgroup
\@HsH@option@abstract@show@keywordstrue
\or% 1
\endgroup
\@HsH@option@abstract@show@keywordsfalse
\or% 2
\endgroup
\def\HsH@abstract@chap{\addchap}
\or% 3
\endgroup
\def\HsH@abstract@chap{\addchap*}
\else% should never be
\endgroup
\fi
\else
\endgroup
\fi
}
% \end{macrocode}
% \end{option}
%
% For the \opt{twoside} option we only redefine the default, everyting else is % For the \opt{twoside} option we only redefine the default, everyting else is
% handled by the parrent class. % handled by the parrent class.
% \begin{macrocode} % \begin{macrocode}
...@@ -769,6 +819,7 @@ http://www.latex-project.org/lppl.txt ...@@ -769,6 +819,7 @@ http://www.latex-project.org/lppl.txt
%<*article|report> %<*article|report>
toc=listof, toc=listof,
toc=bibliography, toc=bibliography,
abstract=keywords,
%</article|report> %</article|report>
faculty=none, faculty=none,
%<*standalone> %<*standalone>
...@@ -1296,7 +1347,8 @@ http://www.latex-project.org/lppl.txt ...@@ -1296,7 +1347,8 @@ http://www.latex-project.org/lppl.txt
% %
% \subsubsection{Styling \LaTeX{} default constucts} % \subsubsection{Styling \LaTeX{} default constucts}
% %
% \paragraph{Floats}\vspace*{-1\baselineskip} % \vspace{-1\baselineskip}
% \paragraph{Floats}\vspace{-1\baselineskip}
% \begin{macrocode} % \begin{macrocode}
%<*!standalone> %<*!standalone>
% \end{macrocode} % \end{macrocode}
...@@ -1345,6 +1397,25 @@ http://www.latex-project.org/lppl.txt ...@@ -1345,6 +1397,25 @@ http://www.latex-project.org/lppl.txt
\renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}} \renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}}
% \end{macrocode} % \end{macrocode}
% %
% \paragraph{Abstract}
% We define some custom behavior for the abstract.
% \begin{macrocode}
\defcaptionname{german,ngerman}\abstractname{Abstract}
\newcaptionname{english}\keywordsname{Keywords}
\newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter}
\renewenvironment{abstract}{
\quotation
\setparsizes{\z@}{\z@}{.25\linewidth \@plus 1fil}\selectfont
\HsH@abstract@chap{\abstractname}
}{%
\ifx\@keywords\@empty\else\if@HsH@option@abstract@show@keywords
\par\bigskip
\noindent\textbf{\keywordsname}\hskip 2em\@keywords
\fi\fi\par
\endquotation
}
% \end{macrocode}
%
% \paragraph{Misc} % \paragraph{Misc}
% We activae one of the commands defined above to make math-indices upright by % We activae one of the commands defined above to make math-indices upright by
% default. % default.
......
No preview for this file type
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%% %%
\NeedsTeXFormat{LaTeX2e}[2022-06-01] \NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesClass{HsH-report} \ProvidesClass{HsH-report}
[2024-04-25 3.01 HsH-class based on KOMA] [2024-04-26 3.01 HsH-class based on KOMA]
\let\HsHClassName\@currname \let\HsHClassName\@currname
\def\HsHClassName@ParrentClass{% \def\HsHClassName@ParrentClass{%
scrreprt% scrreprt%
...@@ -122,6 +122,37 @@ ...@@ -122,6 +122,37 @@
\AtEndOfClass{% \AtEndOfClass{%
\headheight=\HsH@opt@headheight% \headheight=\HsH@opt@headheight%
} }
\newif\if@HsH@option@abstract@show@keywords
\def\HsH@abstract@chap{\addchap*}
\DefineFamilyKey{HsH}{abstract}{%
\begingroup
\FamilySetNumerical{HsH}{abstract}{@tempa}{%
{keywords}{0},%
{nokeywords}{1},%
{totoc}{2},{toc}{2},%
{notoc}{3},{nottotoc}{3},%
}{#1}
\ifx\FamilyKeyState\FamilyKeyStateProcessed
\aftergroup\FamilyKeyStateProcessed
\ifcase\@tempa% 0
\endgroup
\@HsH@option@abstract@show@keywordstrue
\or% 1
\endgroup
\@HsH@option@abstract@show@keywordsfalse
\or% 2
\endgroup
\def\HsH@abstract@chap{\addchap}
\or% 3
\endgroup
\def\HsH@abstract@chap{\addchap*}
\else% should never be
\endgroup
\fi
\else
\endgroup
\fi
}
\DefineFamilyKey{HsH}{twoside}[semi]{% \DefineFamilyKey{HsH}{twoside}[semi]{%
\HsH@Options@PassToParrent{twoside=#1,BCOR=1cm} \HsH@Options@PassToParrent{twoside=#1,BCOR=1cm}
\FamilyKeyStateProcessed \FamilyKeyStateProcessed
...@@ -162,6 +193,7 @@ ...@@ -162,6 +193,7 @@
headheight=2.15\baselineskip, headheight=2.15\baselineskip,
toc=listof, toc=listof,
toc=bibliography, toc=bibliography,
abstract=keywords,
faculty=none, faculty=none,
} }
\FamilyProcessOptions{HsH}\relax \FamilyProcessOptions{HsH}\relax
...@@ -374,6 +406,20 @@ ...@@ -374,6 +406,20 @@
\renewcommand{\labelitemii}{\raisebox{.3ex}{\scalebox{0.7}{$\circ$}}} \renewcommand{\labelitemii}{\raisebox{.3ex}{\scalebox{0.7}{$\circ$}}}
\renewcommand{\labelitemiii}{\raisebox{.1ex}{-}} \renewcommand{\labelitemiii}{\raisebox{.1ex}{-}}
\renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}} \renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}}
\defcaptionname{german,ngerman}\abstractname{Abstract}
\newcaptionname{english}\keywordsname{Keywords}
\newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter}
\renewenvironment{abstract}{
\quotation
\setparsizes{\z@}{\z@}{.25\linewidth \@plus 1fil}\selectfont
\HsH@abstract@chap{\abstractname}
}{%
\ifx\@keywords\@empty\else\if@HsH@option@abstract@show@keywords
\par\bigskip
\noindent\textbf{\keywordsname}\hskip 2em\@keywords
\fi\fi\par
\endquotation
}
\upsubscripts \upsubscripts
\raggedbottom \raggedbottom
\let\layercontentsmeasure\relax \let\layercontentsmeasure\relax
...@@ -621,7 +667,7 @@ ...@@ -621,7 +667,7 @@
\global\let\@lowertitleback\@empty \global\let\@lowertitleback\@empty
\global\let\@dedication\@empty \global\let\@dedication\@empty
\global\let\@matrikelnr\@empty \global\let\@matrikelnr\@empty
\global\let\@prof\@empty \global\let\@professor\@empty
\global\let\author\relax \global\let\author\relax
\global\let\title\relax \global\let\title\relax
\global\let\extratitle\relax \global\let\extratitle\relax
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%% %%
\NeedsTeXFormat{LaTeX2e}[2022-06-01] \NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesClass{HsH-standalone} \ProvidesClass{HsH-standalone}
[2024-04-25 3.01 HsH-class based on KOMA] [2024-04-26 3.01 HsH-class based on KOMA]
\let\HsHClassName\@currname \let\HsHClassName\@currname
\def\HsHClassName@ParrentClass{% \def\HsHClassName@ParrentClass{%
standalone% standalone%
...@@ -240,6 +240,20 @@ ...@@ -240,6 +240,20 @@
\renewcommand{\labelitemii}{\raisebox{.3ex}{\scalebox{0.7}{$\circ$}}} \renewcommand{\labelitemii}{\raisebox{.3ex}{\scalebox{0.7}{$\circ$}}}
\renewcommand{\labelitemiii}{\raisebox{.1ex}{-}} \renewcommand{\labelitemiii}{\raisebox{.1ex}{-}}
\renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}} \renewcommand{\labelitemiv}{\raisebox{-.1ex}{\scalebox{1.3}{$\cdot$}}}
\defcaptionname{german,ngerman}\abstractname{Abstract}
\newcaptionname{english}\keywordsname{Keywords}
\newcaptionname{german,ngerman}\keywordsname{Schl{\"u}sselw{\"o}rter}
\renewenvironment{abstract}{
\quotation
\setparsizes{\z@}{\z@}{.25\linewidth \@plus 1fil}\selectfont
\HsH@abstract@chap{\abstractname}
}{%
\ifx\@keywords\@empty\else\if@HsH@option@abstract@show@keywords
\par\bigskip
\noindent\textbf{\keywordsname}\hskip 2em\@keywords
\fi\fi\par
\endquotation
}
\upsubscripts \upsubscripts
\raggedbottom \raggedbottom
\let\layercontentsmeasure\relax \let\layercontentsmeasure\relax
......
No preview for this file type
...@@ -14,9 +14,8 @@ ...@@ -14,9 +14,8 @@
\title{long and elaborate title that just goes on and on without stopping} \title{long and elaborate title that just goes on and on without stopping}
\subtitle{Subtitle} \subtitle{Subtitle}
\date{\today} \date{\today}
\keywords{test, wow} \keywords{test, hello, world}
\defcaptionname{german,ngerman}\abstractname{Abstract}
\begin{document} \begin{document}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment