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

better interaction with geometry

- settings are more relative, allowing it to adapt better to papersize
- loading is defered untill `AtBeginDocument`, allowing the user to load and
  modify the package if he chooses.
parent 62348a21
Branches
No related tags found
No related merge requests found
...@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. ...@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
## [Current] ## [Current]
### Changed
- the margins are now set using relative values, which makes them adapt to different paper sizes
## Fixed
- `geometry` is now deferred until `AtBeginDocument`, which allows the user to load and modify the package in his preamble
## [2.0] ## [2.0]
### Changed ### Changed
......
...@@ -104,13 +104,12 @@ ...@@ -104,13 +104,12 @@
% %
%<*article|report> %<*article|report>
% required for changing layout % required for changing layout
\PassOptionsToPackage{a4paper,vmargin=3cm,bindingoffset=1cm,textwidth=15.5cm}{geometry} \PassOptionsToPackage{vmargin=5\baselineskip,bindingoffset=0.08\paperwidth,textwidth=0.75\paperwidth}{geometry}
\if@todos \if@todos
\PassOptionsToPackage{paperwidth=1.2\paperwidth,left=2cm}{geometry} \PassOptionsToPackage{paperwidth=1.2\paperwidth,left=2cm}{geometry}
\else \else
\PassOptionsToPackage{nomarginpar}{geometry} \PassOptionsToPackage{nomarginpar}{geometry}
\fi \fi
\RequirePackage{geometry}
% %
% language specific localisation % language specific localisation
\if@german \if@german
...@@ -313,7 +312,8 @@ ...@@ -313,7 +312,8 @@
%% load config at beginning of document %% load config at beginning of document
\AtBeginDocument{ \AtBeginDocument{
\makeatletter \makeatletter
%<^*standalone> %<!standalone> \RequirePackage{geometry}
%<*!standalone>
% solve some common errors: % solve some common errors:
\@ifpackageloaded{biblatex}{ \@ifpackageloaded{biblatex}{
% solves fontype warning in San-Serif % solves fontype warning in San-Serif
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
\@ifpackageloaded{subfigure}{ \@ifpackageloaded{subfigure}{
\newcommand{\subfigureautorefname}{\figureautorefname} \newcommand{\subfigureautorefname}{\figureautorefname}
}{} }{}
%<^*standalone> %</!standalone>
\InputIfFileExists{config.tex}{ \InputIfFileExists{config.tex}{
\ClassInfo{\myClassName}{config.tex was found. Using it...} \ClassInfo{\myClassName}{config.tex was found. Using it...}
}{ }{
......
...@@ -82,13 +82,12 @@ ...@@ -82,13 +82,12 @@
\RequirePackage{graphicx} \RequirePackage{graphicx}
\RequirePackage{amsmath} \RequirePackage{amsmath}
\if@german\RequirePackage{ziffer}\fi \if@german\RequirePackage{ziffer}\fi
\PassOptionsToPackage{a4paper,vmargin=3cm,bindingoffset=1cm,textwidth=15.5cm}{geometry} \PassOptionsToPackage{vmargin=5\baselineskip,bindingoffset=0.08\paperwidth,textwidth=0.75\paperwidth}{geometry}
\if@todos \if@todos
\PassOptionsToPackage{paperwidth=1.2\paperwidth,left=2cm}{geometry} \PassOptionsToPackage{paperwidth=1.2\paperwidth,left=2cm}{geometry}
\else \else
\PassOptionsToPackage{nomarginpar}{geometry} \PassOptionsToPackage{nomarginpar}{geometry}
\fi \fi
\RequirePackage{geometry}
\if@german \if@german
\PassOptionsToPackage{ngerman}{babel} \PassOptionsToPackage{ngerman}{babel}
\else \else
...@@ -218,6 +217,7 @@ ...@@ -218,6 +217,7 @@
%% load config at beginning of document %% load config at beginning of document
\AtBeginDocument{ \AtBeginDocument{
\makeatletter \makeatletter
\RequirePackage{geometry}
\@ifpackageloaded{biblatex}{ \@ifpackageloaded{biblatex}{
\renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}} \renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}}
}{} }{}
......
...@@ -82,13 +82,12 @@ ...@@ -82,13 +82,12 @@
\RequirePackage{graphicx} \RequirePackage{graphicx}
\RequirePackage{amsmath} \RequirePackage{amsmath}
\if@german\RequirePackage{ziffer}\fi \if@german\RequirePackage{ziffer}\fi
\PassOptionsToPackage{a4paper,vmargin=3cm,bindingoffset=1cm,textwidth=15.5cm}{geometry} \PassOptionsToPackage{vmargin=5\baselineskip,bindingoffset=0.08\paperwidth,textwidth=0.75\paperwidth}{geometry}
\if@todos \if@todos
\PassOptionsToPackage{paperwidth=1.2\paperwidth,left=2cm}{geometry} \PassOptionsToPackage{paperwidth=1.2\paperwidth,left=2cm}{geometry}
\else \else
\PassOptionsToPackage{nomarginpar}{geometry} \PassOptionsToPackage{nomarginpar}{geometry}
\fi \fi
\RequirePackage{geometry}
\if@german \if@german
\PassOptionsToPackage{ngerman}{babel} \PassOptionsToPackage{ngerman}{babel}
\else \else
...@@ -234,6 +233,7 @@ ...@@ -234,6 +233,7 @@
%% load config at beginning of document %% load config at beginning of document
\AtBeginDocument{ \AtBeginDocument{
\makeatletter \makeatletter
\RequirePackage{geometry}
\@ifpackageloaded{biblatex}{ \@ifpackageloaded{biblatex}{
\renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}} \renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}}
}{} }{}
......
...@@ -91,12 +91,6 @@ ...@@ -91,12 +91,6 @@
%% load config at beginning of document %% load config at beginning of document
\AtBeginDocument{ \AtBeginDocument{
\makeatletter \makeatletter
\@ifpackageloaded{biblatex}{
\renewcommand*{\mkbibacro}[1]{\MakeUppercase{#1}}
}{}
\@ifpackageloaded{subfigure}{
\newcommand{\subfigureautorefname}{\figureautorefname}
}{}
\InputIfFileExists{config.tex}{ \InputIfFileExists{config.tex}{
\ClassInfo{\myClassName}{config.tex was found. Using it...} \ClassInfo{\myClassName}{config.tex was found. Using it...}
}{ }{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment