move files to subdirectory

This commit is contained in:
Maximilian Keßler 2021-10-06 23:10:06 +02:00
parent 8eb7992e2e
commit 1b442a50fd
31 changed files with 82 additions and 73 deletions

2
PyTeX

@ -1 +1 @@
Subproject commit a9af7d4459379446077e694e1ff2aa2eed274797
Subproject commit a6ba08f1eedc74fea749705fae8f1380773e524b

17
build.py Normal file
View File

@ -0,0 +1,17 @@
from pathlib import *
import sys
sys.path.insert(0, 'PyTeX/')
from package_formatter import PackageFormatter
from replacements import make_default_commands
def build(build_dir: str):
input_root = Path('.').resolve()
output = input_root / build_dir
for file in input_root.rglob('*.pysty'):
formatter = PackageFormatter(package_name=file.with_suffix('').name)
make_default_commands(formatter)
formatter.format_package(file, input_root / build_dir / str(file.parent.relative_to(input_root)))
if __name__ == "__main__":
build('build')

View File

@ -1,26 +0,0 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkessler-hypersetup}[2021-09-06 - Package for setting up hyperref, cleveref and some default hyperref colors]
%%%%%%%%%%%%%%%%%%
\newif\ifmkessler@hypersetup@cleveref\mkessler@hypersetup@clevereffalse
\DeclareOption{cleveref}{\mkessler@hypersetup@clevereftrue}
\DeclareOption*{\PackageWarning{mkessler-hypersetup}{Unknown '\CurrentOption'}}
\ProcessOptions\relax
%%%Hyperref and setup
\RequirePackage{xcolor} % To compute the colors below
\RequirePackage{etoolbox} % Checking for defined commands
\def\mkessler@hypersetup@exec{
\RequirePackage{hyperref} % Hyperlinks
\ifmkessler@hypersetup@cleveref
\RequirePackage{cleveref} % Better referencing
\fi
\hypersetup{colorlinks, citecolor=violet, urlcolor=blue!80!black, linkcolor=red!50!black, pdfauthor=\@author, pdftitle=\ifdef{\@course}{\@course}{\@title}}
}
\AtEndPreamble{
\mkessler@hypersetup@exec
}

View File

@ -1,44 +0,0 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mkessler-vocab}[2021-09-06 - Package for emphasizing vocabulary]
%%%%%%%%%%%%%%%%%%
%%Provides a \vocab<[name in index]>{vocabulary} command to print vocabulary in bold blue and automatically index it.
\newif\ifmkessler@vocab@english\mkessler@vocab@englishtrue
\DeclareOption{german}{\mkessler@vocab@englishfalse}
\DeclareOption{english}{\mkessler@vocab@englishtrue}
\newif\ifmkessler@vocab@index\mkessler@vocab@indexfalse
\DeclareOption{index}{\mkessler@vocab@indextrue}
\DeclareOption{noindex}{\mkessler@vocab@indexfalse}
\DeclareOption*{\PackageWarning{mkessler-vocab}{Unknown '\CurrentOption'}}
\ProcessOptions\relax
%%%%Management of vocabulary and corresponding index
\RequirePackage{xparse}
\RequirePackage{xcolor}
\ifmkessler@vocab@index
\RequirePackage{imakeidx}
\makeindex[name=mkessler@vocab@indexname, columns=2, title=\ifmkessler@vocab@english Index\else Stichwortverzeichnis\fi, intoc]
%Emphasize \vocabulary
\RequirePackage{expl3}
\ExplSyntaxOn
\NewDocumentCommand{\vocab}{O{} m}{
\textbf{\color{blue} #2}%
\if\relax\detokenize{#1}\relax%
\index[mkessler@vocab@indexname]{\text_titlecase_first:n{#2}} % true branch: #1 was empty
\else
\index[mkessler@vocab@indexname]{#1} % false branch: #1 was supplied
\fi
}
\ExplSyntaxOff
\newcommand\printvocabindex{
\printindex[mkessler@vocab@indexname]
}
\else
\NewDocumentCommand{\vocab}{O{} m }{
\textbf{\color{blue} #2}
}
\fi

22
packages/hypersetup.pysty Normal file
View File

@ -0,0 +1,22 @@
__HEADER__(Package for setting up hyperref, cleveref and some default hyperref colors)
__NEW_IF__(cleveref,false)
\DeclareOption{cleveref}{__SET_IF__(cleveref,true)}
__END_OPTIONS___
%%%Hyperref and setup
\RequirePackage{xcolor} % To compute the colors below
\RequirePackage{etoolbox} % Checking for defined commands
\def__PACKAGE_MACRO__(exec){
\RequirePackage{hyperref} % Hyperlinks
__IF__(cleveref)
\RequirePackage{cleveref} % Better referencing
\fi
\hypersetup{colorlinks, citecolor=violet, urlcolor=blue!80!black, linkcolor=red!50!black, pdfauthor=\@author, pdftitle=\ifdef{\@course}{\@course}{\@title}}
}
\AtEndPreamble{
__PACKAGE_MACRO__(exec)
}

View File

@ -1,5 +1,4 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{castel-incfig}[2021-09-06 - Figure support for inkscape figures by Gilles Castell]
__HEADER__(Figure support for inkscape figures by Gilles Castell)
%%%%%%%%
% This is just a small package bundling the figure support for the inkscape figures by Gilles Castel. The setup can be originally found in the preamble

41
packages/vocab.pysty Normal file
View File

@ -0,0 +1,41 @@
__HEADER__(Package for emphasizing vocabulary)
%%Provides a \vocab<[name in index]>{vocabulary} command to print vocabulary in bold blue and automatically index it.
\RequirePackage{xkeyval}
__LANGUAGE_OPTIONS__
__NEW_IF__(index,false)
\DeclareOption{index}{__SET_IF__(index,true)}
\DeclareOption{noindex}{__SET_IF__(index,false)}
__END_OPTIONS_X__
%%%%Management of vocabulary and corresponding index
\RequirePackage{xparse}
\RequirePackage{xcolor}
__IF__(index)
\RequirePackage{imakeidx}
\makeindex[name=vocabindex, columns=2, title=__IF__(english) Index\else Stichwortverzeichnis\fi, intoc]
%Emphasize \vocabulary
\RequirePackage{expl3}
\ExplSyntaxOn
\NewDocumentCommand{\vocab}{O{} m}{
\textbf{\color{blue} #2}%
\if\relax\detokenize{#1}\relax%
\index[vocabindex]{\text_titlecase_first:n{#2}} % true branch: #1 was empty
\else
\index[vocabindex]{#1} % false branch: #1 was supplied
\fi
}
\ExplSyntaxOff
\newcommand\printvocabindex{
\printindex[vocabindex]
}
\else
\NewDocumentCommand{\vocab}{O{} m }{
\textbf{\color{blue} #2}
}
\fi