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 8.8KB

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