Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

defaultPreamble.sty 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %% %%
  3. %% defaultPreamble.sty %%
  4. %% %%
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. %% %%
  7. %% Setup a preamble for document class: article %%
  8. %% 1.Pagesettings: %%
  9. %% - DIN A4 Paper %%
  10. %% - Margin: Top = 20mm %%
  11. %% Right = 20mm %%
  12. %% Bottom = 30mm %%
  13. %% Left = 20mm %%
  14. %% - Header Separation = 10mm %%
  15. %% - Footer Separation = 10mm %%
  16. %% - Paragraph Spacing = 1.5 * line height %%
  17. %% %%
  18. %% 2.Redefine Pagelayout %%
  19. %% - Remove printed page numbers on page 1. %%
  20. %% - Page 1+2 counts for the table of content. %%
  21. %% - Print the page numbering like "Seite" a "von" lastpage %%
  22. %% to the right bottom corner. %%
  23. %% %%
  24. %% 3.Contain Packages %%
  25. %% - geometry = Set page settings. %%
  26. %% - setspace = Set linespacing, prevent math formula %%
  27. %% streching. %%
  28. %% - pageslts = Get last page number. %%
  29. %% - fancyhr = Set header, footer and page layout. %%
  30. %% - babel = Set hyphenation rules to [ngerman]. %%
  31. %% - inputenc = Set input encoding to UTF-8 (Umlaute etc.). %%
  32. %% - ClearSans = Provide fontfamily ClearSans. %%
  33. %% - helvet = Set fontfamily to Helvetica (sans serif). %%
  34. %% - fontenc = Set font encoding to 8bit (support <,=,>,"). %%
  35. %% - xcolor = Provides support of font colors. %%
  36. %% - upquote = Provides support quotes in verbatim and listings. %%
  37. %% - listings = Provides support of indention and code colering. %%
  38. %% - float = Provides support of fiqures and environment float.%%
  39. %% - hyperref = Provides support of links (pdf anchor), URL. %%
  40. %% - graphicx = Provides support to add images. %%
  41. %% - tabularx = Provides advanced tabular support. %%
  42. %% - pdfpages = Provides support to include pdf pages. %%
  43. %% - amsmath = Provides advanced math typesetting support. %%
  44. %% - amsfonts = Provides advanced font typesetting support. %%
  45. %% - amssymb = Provides advanced symbol typesetting support. %%
  46. %% - blindtext = Provides support to use Lorem Ipsum text. %%
  47. %% - enumitem = Provides support change enum type in options. %%
  48. %% - biblatex = Set biblatex for citation and bibliography %%
  49. %% with biber as backend and the %%
  50. %% bibliography style 'ieee'. %%
  51. %% %%
  52. %% 4.Defines New Commands %%
  53. %% - \includePdf{filename} = Include a PDF file. %%
  54. %% - \bibfilename{file.bib} = Set bib file. %%
  55. %% - \printbib = Print bibliography. %%
  56. %% - \b{text} = Set text to bold format. %%
  57. %% - \mono{text} = Set text to monospace. %%
  58. %% - \minsep = Set item spacing to minimum. %%
  59. %% - \clear = Set fontfamily to ClearSans. %%
  60. %% Default fontfamily is Helvetica. %%
  61. %% %%
  62. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  63. %
  64. \NeedsTeXFormat{LaTeX2e}%
  65. \ProvidesPackage{defaultPreamble}[2019/03/04 v1.4 DefaultPreamble Package from Erik Roemmelt]%
  66. \ProcessOptions\relax%
  67. %%% Packages %%%
  68. % ___Document___
  69. \RequirePackage[a4paper, left=20mm, right=20mm, top=20mm, bottom=30mm, headsep=10mm, footskip=10mm]{geometry} % Set page settings
  70. \RequirePackage[nodisplayskipstretch]{setspace} % Set linespacing and prevent math formula streching
  71. \setstretch{1.5} % Change typeset line spacing by multiplicator 1.0
  72. \RequirePackage[pagecontinue=false,alphMult=0,AlphMulti=0,fnsymbolmult=false,romanMult=false,RomanMulti=false]{pageslts} % Get last page number with \lastpageref{LastPage}
  73. \RequirePackage{fancyhdr} % Set header, footer and page layout.
  74. \pagestyle{fancy} % Set the pagestyle to fancyhdr settings
  75. %%% Fancyhdr Settings %%%
  76. \fancyhf{} % Clear all header and footer fields
  77. \fancyfoot[R]{\ifnum\value{page}<1\relax\else{Seite \thepage \hspace{1pt} von \lastpageref{VeryLastPage}}\fi} % Set page numbering "n / last" in the right field of footer
  78. \renewcommand{\headrulewidth}{0pt} % Set header ruler hidden
  79. \renewcommand{\footrulewidth}{0pt} % Set footer ruler hidden
  80. \fancypagestyle{plain}{% Redefine plain style
  81. \fancyhf{} % Clear all header and footer fields
  82. \fancyfoot[R]{\ifnum\value{page}<2\relax\else{Seite \thepage \hspace{1pt} von \lastpageref{VeryLastPage}}\fi} % Set page numbering "n / last" in the right field of footer, skip page numbering on page 1+2
  83. \renewcommand{\headrulewidth}{0pt} % Set header ruler hidden
  84. \renewcommand{\footrulewidth}{0pt} % Set footer ruler hidden
  85. }%
  86. % ___Font___
  87. \RequirePackage[ngerman]{babel} % Changes hyphenation rules
  88. \RequirePackage[utf8]{inputenc} % Input encoding: Unicode support (Umlaute etc.)
  89. \RequirePackage{ClearSans} % Provide fontfamily Clear Sans (sans serif) for title page
  90. \RequirePackage[scaled]{helvet} % Scales fontfamily Helvetica to .95 (sans serif)
  91. \renewcommand{\familydefault}{\sfdefault} % Changes default font to sans serif Helvetica
  92. %\RequirePackage[default]{sourcesanspro}
  93. %\RequirePackage[sfdefault]{FiraSans} % option 'sfdefault' activates Fira Sans as the default text font
  94. %\renewcommand*\oldstylenums[1]{{\firaoldstyle #1}}
  95. %\RequirePackage[sfdefault,light]{roboto} % Option 'sfdefault' only if the base font of the document is to be sans serif
  96. \RequirePackage[T1]{fontenc} % Font encoding: (8bit) Accents support (<,=,>,",...)
  97. \RequirePackage[dvipsnames]{xcolor} % Provides font coloring
  98. \definecolor{editorGray}{rgb}{0.95, 0.95, 0.95} % Defines a new Color: gray
  99. \definecolor{editorOcher}{rgb}{0.8, 0.4, 0} % #CC6600 -> rgb(204, 102, 0) % New Color Ocher
  100. \definecolor{editorGreen}{rgb}{0, 0.5, 0} % #007C00 -> rgb(0, 124, 0) % New Color Green
  101. \RequirePackage{upquote} % Allow quotes in verbatim and lstlisting
  102. \RequirePackage{listings} % Allow indention and code colering
  103. \lstdefinelanguage{JavaScript}{% Defines Javascript for lstlisting
  104. morekeywords={typeof,new,true,false,catch,function,return,null,catch,switch,var,if,in,while,do,else,case,break},morecomment=[s]{/*}{*/},morecomment=[l]//,morestring=[b]",morestring=[b]'}%
  105. \lstdefinelanguage{HTML5}{% Redefines HTML for lstlisting
  106. language=html,sensitive=true,alsoletter={<>=-},otherkeywords={% HTML tags
  107. <html>,<head>,<title>,</title>,<meta,/>,</head>,<body>,<canvas,\/canvas>,<script>,</script>,</body>,</html>,<!,html>,<style>,</style>,><},%
  108. ndkeywords={%
  109. % General
  110. =,%
  111. % HTML attributes
  112. charset=,id=,width=,height=,%
  113. % CSS properties
  114. border:,transform:,-moz-transform:,transition-duration:,transition-property:,transition-timing-function:},%
  115. morecomment=[s]{<!--}{-->},tag=[s]}%
  116. \newcommand{\lstsetdefault}{%
  117. \lstset{%
  118. % Basic design
  119. backgroundcolor=\color{editorGray},basicstyle={\small\ttfamily},frame=single,columns=fullflexible,%
  120. % Line numbers
  121. xleftmargin={0.75cm},numbers=left,stepnumber=1,firstnumber=1,numberfirstline=true,%
  122. % Code design
  123. keywordstyle=\color{blue}\bfseries,commentstyle=\color{darkgray}\ttfamily,ndkeywordstyle=\color{editorGreen}\bfseries,stringstyle=\color{editorOcher},%
  124. % Code
  125. language=HTML5,alsolanguage=JavaScript,alsodigit={.:;},tabsize=4,showtabs=false,showspaces=false,showstringspaces=false,extendedchars=true,breaklines=true,%
  126. % Support for German umlauts
  127. literate=%
  128. {Ö}{{\"O}}1%
  129. {Ä}{{\"A}}1%
  130. {Ü}{{\"U}}1%
  131. {ß}{{\ss}}1%
  132. {ü}{{\"u}}1%
  133. {ä}{{\"a}}1%
  134. {ö}{{\"o}}1%
  135. }}%
  136. \lstsetdefault%
  137. % ___Other___
  138. \RequirePackage{float} % Allow fiqures and enviroments to float
  139. \RequirePackage[hidelinks,pdfpagelabels=true]{hyperref} % Add a link to your document
  140. \RequirePackage{graphicx} % Add pictures to your document
  141. \RequirePackage{tabularx} % Advanced tabular support
  142. \RequirePackage{pdfpages} % Allows to include pdf pages
  143. \RequirePackage{amsmath} % Advanced math typesetting
  144. \RequirePackage{amsfonts} % Advanced font typesetting
  145. \RequirePackage{amssymb} % Advanced symoblic typesetting
  146. \RequirePackage{blindtext} % Blindtext, Lorem Ipsum text
  147. \RequirePackage[shortlabels]{enumitem} % Allows to change enumerate type easily
  148. % __Bibliography___
  149. \RequirePackage[backend=biber,style=ieee,sorting=nyt]{biblatex} % Use biblatex package
  150. %%% New Commands %%%
  151. % New command for closer spacing in list
  152. \newcommand{\minsep}{\topsep=0pt\itemsep=0pt\parsep=0pt\partopsep=0pt}%
  153. % Add new command to include a pdf file
  154. \newcommand*{\@includePdf}{%
  155. \PackageWarning{defaultPreamble}{PDF-File does not exist}%
  156. NoN%
  157. }%
  158. \newcommand{\includePdf}[1]{\includepdf[pages=-,fitpaper=true,frame=false,pagecommand=\thispagestyle{plain}]{#1}}% Insert the name of the pdf file
  159. % Add new command to set file name for *.bib file
  160. \newcommand*{\@bibfilename}{%
  161. \PackageWarning{defaultPreamble}{Bib-File-Name undefined}%
  162. NoN%
  163. }%
  164. \newcommand{\bibfilename}[1]{\addbibresource{#1}}% Insert the name of the BibLatex file
  165. % Add new command to print the bibliography
  166. \newcommand{\printbib}{\printbibliography[heading=bibintoc]}% Insert the name of the BibLatex file
  167. % Add new commant to shorten text format command: \textbf
  168. \renewcommand{\b}{\textbf}%
  169. % Add new commant to shorten text format command: \texttt
  170. \newcommand{\mono}{\texttt}%
  171. \endinput % Das ist das Ende von dieser .sty Datei