Browse Source

Update preamble.sty

pull/1/head
Erik Römmelt 5 years ago
parent
commit
fb36d85745
1 changed files with 72 additions and 54 deletions
  1. 72
    54
      latex-files/defaultPreamble.sty

+ 72
- 54
latex-files/defaultPreamble.sty View File

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% defaultPreamble.sty %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% Setup a preamble for document class: article %%
%% 1.Pagesettings: %%
%% - DIN A4 Paper %%
%% - Margin: Top = 20mm %%
%% Right = 20mm %%
%% Bottom = 30mm %%
%% Left = 30mm %%
%% - Header Separation = 10mm %%
%% - Footer Separation = 10mm %%
%% - Paragraph Spacing = 1.5 * line height %%
%% %%
%% 2.Redefine Pagelayout %%
%% - Remove printed page numbers on page 1+2. %%
%% - Page 1+2 counts for the table of content. %%
%% - Print the page numbering like "Seite" a "von" lastpage %%
%% to the right bottom corner. %%
%% %%
%% 3.Load Packages %%
%% - geometry = Set page settings. %%
%% - setspace = Set linespacing, prevent math formula %%
%% streching. %%
%% - lastpage = Get last page number. %%
%% - fancyhr = Set header, footer and page layout. %%
%% - babel = Set hyphenation rules to [ngerman]. %%
%% - inputenc = Set input encoding to UTF-8 (Umlaute etc.). %%
%% - fontenc = Set font encoding to 8bit (support <,=,>,"). %%
%% - csquotes = Provide support to use " " in tex-document. %%
%% - helvet = Set fontfamily to Helvetica (sans serif). %%
%% - xcolor = Provides support of font colors. %%
%% - hyperref = Provides support of links (pdf anchor), URL. %%
%% - graphicx = Provides support to add images. %%
%% - pdfpages = Provides support to include pdf pages. %%
%% - amsmath = Provides advanced math typesetting support. %%
%% - amsfonts = Provides advanced font typesetting support. %%
%% - amssymb = Provides advanced symbol typesetting support. %%
%% - blindtext = Provides support to use Lorem Ipsum text. %%
%% - biblatex = Set biblatex for citation and bibliography %%
%% with biber as backend and the %%
%% bibliography style 'ieee'. %%
%% %%
%% 4.Defines New Commands %%
%% - \bibfilename{file.bib} = Set bib file. %%
%% - \printbib = Print bibliography. %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% defaultPreamble.sty %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% Setup a preamble for document class: article %%
%% 1.Pagesettings: %%
%% - DIN A4 Paper %%
%% - Margin: Top = 20mm %%
%% Right = 20mm %%
%% Bottom = 30mm %%
%% Left = 30mm %%
%% - Header Separation = 10mm %%
%% - Footer Separation = 10mm %%
%% - Paragraph Spacing = 1.5 * line height %%
%% %%
%% 2.Redefine Pagelayout %%
%% - Remove printed page numbers on page 1+2. %%
%% - Page 1+2 counts for the table of content. %%
%% - Print the page numbering like "Seite" a "von" lastpage %%
%% to the right bottom corner. %%
%% %%
%% 3.Load Packages %%
%% - geometry = Set page settings. %%
%% - setspace = Set linespacing, prevent math formula %%
%% streching. %%
%% - lastpage = Get last page number. %%
%% - fancyhr = Set header, footer and page layout. %%
%% - babel = Set hyphenation rules to [ngerman]. %%
%% - inputenc = Set input encoding to UTF-8 (Umlaute etc.). %%
%% - fontenc = Set font encoding to 8bit (support <,=,>,"). %%
%% - csquotes = Provide support to use " " in tex-document. %%
%% - helvet = Set fontfamily to Helvetica (sans serif). %%
%% - xcolor = Provides support of font colors. %%
%% - hyperref = Provides support of links (pdf anchor), URL. %%
%% - graphicx = Provides support to add images. %%
%% - pdfpages = Provides support to include pdf pages. %%
%% - amsmath = Provides advanced math typesetting support. %%
%% - amsfonts = Provides advanced font typesetting support. %%
%% - amssymb = Provides advanced symbol typesetting support. %%
%% - blindtext = Provides support to use Lorem Ipsum text. %%
%% - biblatex = Set biblatex for citation and bibliography %%
%% with biber as backend and the %%
%% bibliography style 'ieee'. %%
%% - enumitem = Provides support change enum type in options. %%
%% %%
%% 4.Defines New Commands %%
%% - \includePdf{filename} = Include a PDF file. %%
%% - \bibfilename{file.bib} = Set bib file. %%
%% - \printbib = Print bibliography. %%
%% - \b{text} = Set text to bold format. %%
%% - \mono{text} = Set text to monospace. %%
%% - \minsep = Set item spacing to minimum. %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
\NeedsTeXFormat{LaTeX2e}% \NeedsTeXFormat{LaTeX2e}%
\ProvidesPackage{defaultPreamble}[2019/01/15 v1.0 DefaultPreamble Package from Erik Roemmelt]% \ProvidesPackage{defaultPreamble}[2019/01/15 v1.0 DefaultPreamble Package from Erik Roemmelt]%
\ProcessOptions\relax% \ProcessOptions\relax%
%%% Packages %%% %%% Packages %%%
% ___Document___ % ___Document___
\RequirePackage[a4paper, left=30mm, right=20mm, top=20mm, bottom=30mm, headsep=10mm, footskip=10mm]{geometry} % Set page settings
\RequirePackage[a4paper, left=20mm, right=20mm, top=20mm, bottom=30mm, headsep=10mm, footskip=10mm]{geometry} % Set page settings
\RequirePackage[nodisplayskipstretch]{setspace} % Set linespacing and prevent math formula streching \RequirePackage[nodisplayskipstretch]{setspace} % Set linespacing and prevent math formula streching
\setstretch{1.5} % Change typeset line spacing by multiplicator 1.5
\setstretch{1.0} % Change typeset line spacing by multiplicator 1.5
\RequirePackage{lastpage} % Get last page number with \pageref{LastPage} \RequirePackage{lastpage} % Get last page number with \pageref{LastPage}
\RequirePackage{fancyhdr} % Set header, footer and page layout. \RequirePackage{fancyhdr} % Set header, footer and page layout.
\pagestyle{fancy} % Set the pagestyle to fancyhdr settings \pagestyle{fancy} % Set the pagestyle to fancyhdr settings
\renewcommand{\footrulewidth}{0pt} % Set footer ruler hidden \renewcommand{\footrulewidth}{0pt} % Set footer ruler hidden
\fancypagestyle{plain}{% Redefine plain style \fancypagestyle{plain}{% Redefine plain style
\fancyhf{} % Clear all header and footer fields \fancyhf{} % Clear all header and footer fields
\fancyfoot[R]{\ifnum\value{page}<3\relax\else{Seite \thepage \hspace{1pt} von \pageref{LastPage}}\fi} % Set page numbering "n / last" in the right field of footer, skip page numbering on page 1+2
\fancyfoot[R]{\ifnum\value{page}<2\relax\else{Seite \thepage \hspace{1pt} von \pageref{LastPage}}\fi} % Set page numbering "n / last" in the right field of footer, skip page numbering on page 1+2
\renewcommand{\headrulewidth}{0pt} % Set header ruler hidden \renewcommand{\headrulewidth}{0pt} % Set header ruler hidden
\renewcommand{\footrulewidth}{0pt} % Set footer ruler hidden \renewcommand{\footrulewidth}{0pt} % Set footer ruler hidden
}% }%
\RequirePackage{amsfonts} % Advanced font typesetting \RequirePackage{amsfonts} % Advanced font typesetting
\RequirePackage{amssymb} % Advanced symoblic typesetting \RequirePackage{amssymb} % Advanced symoblic typesetting
\RequirePackage{blindtext} % Blindtext, Lorem Ipsum text \RequirePackage{blindtext} % Blindtext, Lorem Ipsum text
\usepackage[shortlabels]{enumitem} % Allows to change enumerate type easily
% __Bibliography___ % __Bibliography___
\RequirePackage[backend=biber,style=ieee]{biblatex} % Use biblatex package \RequirePackage[backend=biber,style=ieee]{biblatex} % Use biblatex package
%%% New Commands %%% %%% New Commands %%%
% New command for closer spacing in list
\newcommand{\minsep}{\topsep=0pt\itemsep=0pt\parsep=0pt\partopsep=0pt}%
% Add new command to include a pdf file
\newcommand*{\@includePdf}{%
\PackageWarning{defaultPreamble}{PDF-File does not exist}%
NoN%
}%
\newcommand{\includePdf}[1]{\includepdf[pages=-,fitpaper=true,frame=false,pagecommand=\thispagestyle{plain}]{#1}}% Insert the name of the pdf file
% Add new command to set file name for *.bib file % Add new command to set file name for *.bib file
\newcommand*{\@bibfilename}{% \newcommand*{\@bibfilename}{%
\PackageWarning{defaultPreamble}{Bib-File-Name undefined}% \PackageWarning{defaultPreamble}{Bib-File-Name undefined}%
\newcommand{\bibfilename}[1]{\addbibresource{#1}}% Insert the name of the BibLatex file \newcommand{\bibfilename}[1]{\addbibresource{#1}}% Insert the name of the BibLatex file
% Add new command to print the bibliography % Add new command to print the bibliography
\newcommand{\printbib}{\printbibliography[heading=bibintoc]}% Insert the name of the BibLatex file \newcommand{\printbib}{\printbibliography[heading=bibintoc]}% Insert the name of the BibLatex file
% Add new commant to shorten text format command: \textbf
\renewcommand{\b}{\textbf}%
% Add new commant to shorten text format command: \texttt
\newcommand{\mono}{\texttt}%
\endinput % Das ist das Ende von dieser .sty Datei \endinput % Das ist das Ende von dieser .sty Datei

Loading…
Cancel
Save