From bb26995d8d647faf2d72a391c998b5d168e1864a Mon Sep 17 00:00:00 2001 From: erichhasl Date: Tue, 7 Nov 2017 19:50:55 +0100 Subject: [PATCH] fix some issues --- texed/sasbase.cls | 59 ++++++++++++++++++++++++++++++++++++----------- texed/test.tex | 3 ++- 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/texed/sasbase.cls b/texed/sasbase.cls index 70438d2..aea954d 100644 --- a/texed/sasbase.cls +++ b/texed/sasbase.cls @@ -12,12 +12,29 @@ \RequirePackage[rm={lining,proportional},sf={lining, proportional},tt={lining, proportional, variable}]{cfr-lm} \RequirePackage[T1]{fontenc} \RequirePackage{indentfirst} +\RequirePackage{fancyhdr} +\RequirePackage{bm} +\RequirePackage{roboto} % SET PAGE GEOMETRY \geometry{ - left=12mm, - right=12mm, - top=8mm} + left=13mm, + right=13mm, + top=8mm, + includeheadfoot} + +% ENABLE FANCY HEADERS +\pagestyle{fancy} +\fancyhf{} + +% DISABLE HEADER RULE +\renewcommand{\headrulewidth}{0pt} + +% ADD PAGE NUMBER TO TOP RIGHT / LEFT (ODD / EVEN) +\fancyhead[R]{\sffamily\bfseries\large{\textbf{\thepage}} \ifodd\value{page}\else\hfill\fi} + +% SET COLUMN GAP OF TWOCOLUMN LAYOUT +\setlength{\columnsep}{6mm} % SET PLACE COMMAND \makeatletter @@ -33,6 +50,13 @@ } \makeatother +% SET NUMBER COMMAND (COLLIDES WITH BUILTIN) +\makeatletter +\newcommand{\edition}[1]{ + \def\@edition{#1} +} +\makeatother + % HELPER TO EXTRACT YEAR FROM DATE \newcommand*\TheLastWord[1]{\expandafter\xreverseit\expandafter{\expandafter}#1 \relax} \def\xreverseit#1#2 #3{% @@ -44,8 +68,6 @@ } \def\xthree#1#2#3{} -\renewcommand{\arraystretch}{2.5} - % ------------------ % SECTION FORMATTING % ------------------ @@ -69,7 +91,7 @@ % ----------------- % DISABLE BOLD -\renewcommand{\cftsecfont}{\normalfont} +\renewcommand{\cftsecfont}{\normalfont\ostyle} % ONLY SHOW SECTIONS IN TOC \setcounter{tocdepth}{1} @@ -77,9 +99,6 @@ % HIDE NUMBERING OF SECTIONS \setcounter{secnumdepth}{0} -% DEFINE OWN COLUMN TYPE -\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} - % DEFINE SPACING BETWEEN ITEMS \setlength{\cftbeforesecskip}{-3mm} @@ -89,8 +108,6 @@ % SET DOTS FOR SECTIONS \renewcommand{\cftsecdotsep}{\cftdotsep} -%\setlength{\cftsecnumwidth}{0mm} - % Redefinition of ToC command to remove heading \makeatletter \renewcommand\tableofcontents{% @@ -99,6 +116,7 @@ } \makeatother +% CUSTOM TOC COMMAND \newcommand{\mycontents}{% \ostyle \begin{tabular}{lp{.9\textwidth}} @@ -111,10 +129,19 @@ % TITLE (THIS IS WHERE THE MAGIC HAPPENS) % --------------------------------------- +% SET WIDTH OF RULES IN TABULAR \setlength{\arrayrulewidth}{.3mm} +% SET CELL HEIGHT +\renewcommand{\arraystretch}{2.5} + +% DEFINE OWN COLUMN TYPE +\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} +\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}} + \makeatletter \def\@maketitle{ + \vspace*{-10mm} \begin{center} \textbf{\ostyle{\HUGE{\@title}}} \end{center} @@ -123,11 +150,17 @@ \hline \large \ostyle{\TheLastWord{\@datum}} & \large \ostyle{Ausgegeben in {\@place} am {\@datum}} & - \large \ostyle{Nr. 1} + \large \ostyle{Nr. {\@edition}} \\ \hline - \multicolumn{3}{p{\textwidth}}{\mycontents} \\ \hline + \multicolumn{3}{p{\dimexpr\textwidth-2\tabcolsep}}{\mycontents} \\ \hline \end{tabular} \vspace{10mm} + %\thispagestyle{fancy} } \makeatother + +\newcommand{\mytitle}{ + \maketitle + \thispagestyle{fancy} +} diff --git a/texed/test.tex b/texed/test.tex index 7b2718d..9553cf0 100644 --- a/texed/test.tex +++ b/texed/test.tex @@ -7,8 +7,9 @@ \title{Bundesgesetzblatt} \place{Bonn} \datum{23. Mai 1949} +\edition{1} -\maketitle +\mytitle \section{Grundgesetz für die Bundesrepublik Deutschland vom 23. Mai 1949}