diff --git a/Makefile b/Makefile index d3577ee83546627ff14357a063f08fc21a93a084..0f85f9ae7e5f3d31b20f59896bad5c1bd7871b7c 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,47 @@ # Makefile for Latex project +NAME = project +LATEX = pdflatex +BIBTEX = biber -NAME = project # Name of your file -LATEX = pdflatex # command you use +SUBDIRS = crc plt svg +OUTDIR = build +TEX_FLAGS = -file-line-error -interaction=nonstopmode +COM_FLAGS = -output-directory=$(OUTDIR) -quiet +GARBAGE_PATTERNS = *.aux *.bbl *.bcf *.blg *.idx *.ind *.lof *.lot *.log *.xml *.toc -OUTDIR = .\build # all latex-ggenerated files will be stored here +SUB_TEX_FILES = $(foreach D,$(SUBDIRS),$(wildcard $(D)/*.tex)) +SUB_PDF_FILES = $(join $(dir $(SUB_TEX_FILES)),$(addprefix $(OUTDIR)/,$(notdir $(SUB_TEX_FILES:tex=pdf)))) +SUB_SVG_FILES = $(foreach D,$(SUBDIRS),$(wildcard $(D)/*.svg)) +SUB_PDF_TEX_FILES = $(join $(dir $(SUB_SVG_FILES)),$(addprefix $(OUTDIR)/,$(notdir $(SUB_SVG_FILES:svg=pdf)))) +GARBAGE = $(foreach D,. $(SUBDIRS), $(wildcard $(addprefix $(D)/$(OUTDIR)/,$(GARBAGE_PATTERNS)))) -export TEXINPUTS:=.\src # edit env-variable for sub processes (only neede if not miktex) +export TEXINPUTS:=$(CURDIR)\src -pdf: $(NAME).tex - $(LATEX) -synctex=1 -interaction=nonstopmode -file-line-error -include-directory=.\src -output-directory=$(OUTDIR) $(NAME).tex +std: all tidy + +all: bib + $(LATEX) $(TEX_FLAGS) $(COM_FLAGS) $(NAME).tex + $(LATEX) -synctex=1 $(TEX_FLAGS) $(COM_FLAGS) $(NAME).tex + copy /Y $(OUTDIR)\$(NAME).pdf .\ + +bib: pdf $(OUTDIR)\$(NAME).bcf + $(BIBTEX) $(COM_FLAGS) $(NAME) + +pdf: $(SUB_PDF_FILES) $(SUB_PDF_TEX_FILES) + $(LATEX) -synctex=1 $(TEX_FLAGS) $(COM_FLAGS) $(NAME).tex + +$(SUB_PDF_FILES): $(SUB_TEX_FILES) + cd $(subst $(OUTDIR)/,,$(dir $@)) && $(LATEX) $(TEX_FLAGS) $(COM_FLAGS) $(notdir $(@:pdf=tex)) + +$(SUB_PDF_TEX_FILES): $(SUB_SVG_FILES) + cd $(subst $(OUTDIR)/,,$(dir $@)) && inkscape -C --export-latex $(notdir $(@:pdf=svg)) -o $(and $(OUTDIR),$(OUTDIR)\)$(notdir $@) clean: tidy - if exist $(OUTDIR)\$(NAME).pdf del $(OUTDIR)\$(NAME).pdf - if exist $(OUTDIR) rmdir $(OUTDIR) + for %%a in ($(foreach D,$(subst /,\,$(SUB_PDF_FILES) $(SUB_PDF_TEX_FILES)) $(subst pdf,synctex.gz,$(subst /,\,$(SUB_PDF_FILES))) $(subst pdf,pdf_tex,$(subst /,\,$(SUB_PDF_TEX_FILES))) $(OUTDIR)\$(NAME).pdf $(OUTDIR)\$(NAME).synctex.gz, "$(D)")) do if exist %%~a del /q %%~a + for %%a in ($(foreach D,. $(SUBDIRS),"$(D)\$(if $(subst .,,$(OUTDIR)),$(OUTDIR),build)")) do if exist %%~a rmdir /q %%~a +# if exist $(NAME).pdf del $(NAME).pdf tidy: - if exist $(OUTDIR)\$(NAME).aux del $(OUTDIR)\$(NAME).aux - if exist $(OUTDIR)\$(NAME).bbl del $(OUTDIR)\$(NAME).bbl - if exist $(OUTDIR)\$(NAME).bcf del $(OUTDIR)\$(NAME).bcf - if exist $(OUTDIR)\$(NAME).blg del $(OUTDIR)\$(NAME).blg - if exist $(OUTDIR)\$(NAME).idx del $(OUTDIR)\$(NAME).idx - if exist $(OUTDIR)\$(NAME).ind del $(OUTDIR)\$(NAME).ind - if exist $(OUTDIR)\$(NAME).lof del $(OUTDIR)\$(NAME).lof - if exist $(OUTDIR)\$(NAME).lot del $(OUTDIR)\$(NAME).lot - if exist $(OUTDIR)\$(NAME).out del $(OUTDIR)\$(NAME).out - if exist $(OUTDIR)\$(NAME).toc del $(OUTDIR)\$(NAME).toc - if exist $(OUTDIR)\$(NAME).acn del $(OUTDIR)\$(NAME).acn - if exist $(OUTDIR)\$(NAME).acr del $(OUTDIR)\$(NAME).acr - if exist $(OUTDIR)\$(NAME).alg del $(OUTDIR)\$(NAME).alg - if exist $(OUTDIR)\$(NAME).glg del $(OUTDIR)\$(NAME).glg - if exist $(OUTDIR)\$(NAME).glo del $(OUTDIR)\$(NAME).glo - if exist $(OUTDIR)\$(NAME).gls del $(OUTDIR)\$(NAME).gls - if exist $(OUTDIR)\$(NAME).ist del $(OUTDIR)\$(NAME).ist - if exist $(OUTDIR)\$(NAME).fls del $(OUTDIR)\$(NAME).fls - if exist $(OUTDIR)\$(NAME).log del $(OUTDIR)\$(NAME).log - if exist $(OUTDIR)\$(NAME).nav del $(OUTDIR)\$(NAME).nav - if exist $(OUTDIR)\$(NAME).snm del $(OUTDIR)\$(NAME).snm - if exist $(OUTDIR)\$(NAME).fdb_latexmk del $(OUTDIR)\$(NAME).fdb_latexmk - if exist $(OUTDIR)\$(NAME).synctex.gz del $(OUTDIR)\$(NAME).synctex.gz - if exist $(OUTDIR)\$(NAME).run.xml del $(OUTDIR)\$(NAME).run.xml - if exist $(OUTDIR)\$(NAME).bc del $(OUTDIR)\$(NAME).bc \ No newline at end of file + if exist $(or $(word 1, $(subst /,\,$(GARBAGE))), false) del /q $(subst /,\,$(GARBAGE)) diff --git a/README.md b/README.md index 300500627a6a48eb4cc139becfa3816be6fa9370..1fef9469e5fde3d7ebb1735740b7828bfd2d1cb4 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,14 @@ them with specifig configurations and presets as well as providing commonly need HsH-article (planed) HsH-report HsH-book (planed) - HsH-standalone (planed) + HsH-standalone -**Version:** BETA 0.1, 19.10.2020 +**Version:** BETA 0.1, 25.10.2020 # Quick start guide: +Use the wiki (here)[https://lab.it.hs-hannover.de/qxx-tul-u1/latex-template-hsh/-/wikis/home] + ## Quick and dirty To get started, create a new folder for your project somewhere on your PC and create your `.tex` file. Copy the classfile (`.cls`) you want to use and the `HsH-logo.pdf` from the src folder to your projectfolder. You can optionally copy the `config.tex` and the `personal.tex`, but you can also @@ -26,80 +28,5 @@ configure everything in your preamble. The projects also provides a recommendation for a subfolder structure, to keep things organized. Cloning the complete projekt into your projectfolder will allow you to use it easily. This has the downside of storing classfiles and other needed files in the *.\src* folder, which means it needs to be added to the path searched when -running your latex command. How to do that is explained later on. +running your latex command. How to do that is explained in the wiki. The provided Makefile demonstrates how to run a successful build, you might want to check it out. - -## writing your document - -Write your Latexdocument as usual, starting with: `\documentclass{HsH-report}` -You may provide all usual classoptions as well as specifying your fakultae (f1 to f5), so the correct logo can be picked. Here is a recommendation: - - \documentclass[11pt,a4paper,twoside,f1]{HsH-report} - -# Adding the .\src folder to the path - -The makefile shows how to do this via export of the `TEXINPUTS` variable or with the miktex option. - - -## using MIKTEX -Miktex makes this very easy by adding a option for that. Just add `-include-directory=.\src` to your call to `pdflatex`. - - -## using VScode with LaTex Workshop -in VS Code you can configure your launch to set environment variables. Just edit your settings, so that your pdflatex tool contains a `env:` - - "name": "pdflatex", - "command": "pdflatex", - "args": [...], - "env": { - "TEXINPUTS": "%DIR%/src" - } - -# What are the personal.tex and config.tex? - -These files are a easy way to configure your project in a single central location, so it can be used over multiple documents in the same project as -well as allowing easy reuse of configs for other projects. -The provide classes automatically check for these files and use them, if they are present. But they are completely optional, so you can just ditch them if -you want to. Keep in mind that the `config.tex` will be included right before the `\begin{document}`, so it overrides all settings you may have put in -your preamble. - -The `personal.tex` is internet for personal information displayed on the titlepage and elsewhere. For example the definitions of `\autor{}` and -`\title{}` are here. - -The `config.tex` is intendet for configurations. For example new- or redefinitions of commands should be put here. Also packages-specific configs are -loaded here. The `\@ifpackageloaded{pakagename}{true}{false}` Makro allows to check for the existenz of a package, so that you can reuse config files, -even if you don't use all the same packages. - -# Creating a titlepage - -The `\maketitel` command has bin changed from the standart implementation. It now provides a titlepage containing the HsH-logo as well as allowing for -some more stuff. -Standart KOMA commands (read also [KOMA-documentation](https://golatex.de//wiki/Titelseite_mit_KOMA-Script)): -`\titlehead{}` -`\subject{}` -`\title{}` -`\subtitle{}` -`\date{}` - -Custom Commands: -`\author{A,B,C}` needs to be a comma separated list, to make the declaration of autorship work properly, `\thanks{}` may still be used -`\publishers{}` has no effect - -It is very important, that the HsH-logo file can be found when using this command. The standart config looks on the environment path, but if you want to -customize it, you can use `\HsHlogoPath{path/to/logo}` to provide the path yourself. Note that the `\HsHlogoPage{num}` must also be set to point to the -correct page inside the provided file (standart is 1). - -# Declaration of autorship - -TODO - - \declarationAuthorship - - -# other providet commands - -`\abs{}` sets vertical lines left and right of the contained expression to mark an absolut value. Only works in mathmode - -# Für Beamer gibt es das schon: - -https://lab.it.hs-hannover.de/hit/latex-template-service \ No newline at end of file diff --git a/project.tex b/project.tex index 725d3dfd089b65b02cac543db633038190d7a7d9..8581e17abf4aa2152335eced0cce6a5584927b90 100644 --- a/project.tex +++ b/project.tex @@ -1,6 +1,86 @@ -\documentclass[11pt,a4paper]{HsH-report} -% preamble +\documentclass[ %----------------------Preamble---------------------------------------------------% + 11pt,a4paper, % fontsize and papersize + twoside, % double sided layout + english, % document language (also numberingsystem) + f1 % HsH facultie + ]{HsH-report} % documentclass +\usepackage{color} % for coloring stuff +\usepackage{siunitx} % units +\usepackage{biblatex} % bibiography +\addbibresource{src/localBibliography.bib} + +\usepackage{lipsum} % dummy text \begin{document} - % content goes here -\end{document} \ No newline at end of file + +\pagenumbering{Roman} % duífferent numbering until first chapter +\maketitle % using personal.tex +\declarationAuthorship + +\begin{abstract} + \lipsum[5-8] +\end{abstract} + +\tableofcontents + +\cleardoublepage % importand when using double sided layout +\pagenumbering{arabic} % numbering in normal numbers + +\chapter{Examples} + \label{chap: one} + {\color{red}red text} and {\color{blue}blue text} \\ + different subscripts: \normalsubscripts$R_t$ \upsubscripts$R_t$ \\ + using Units: $R=200\,\milli\ohm + \SI{0.34567453}{\volt\per\metre} - 5\,\si{\second\per\metre\squared}$ \\ + some information\cite{laboranleitung:physik}\\ + german number: $3,5$ english number: $3.5$\\ + \begin{figure} + \centering + \includegraphics[width=.6\textwidth]{img/lorem-ipsum.jpg} + \caption{test} + \end{figure} + + \begin{figure} + \centering + \includegraphics[width=0.6\textwidth, page=2]{plt/build/examplePlot.pdf} + \caption{a nice plot} + \end{figure} + + \begin{figure} + \centering + \includegraphics{crc/build/exampleCircuit.pdf} + \caption{a circuit diagramm} + \end{figure} + + \begin{figure} + \centering + \graphicspath{{svg/build/}} % double curly brackets needet for unknown reason + \input{svg/build/exampleSVG.pdf_tex} + \caption{made via inkscape} + \end{figure} + +\chapter{Using formulas} + \label{chap: theorie} + a numberd formula: + \begin{equation} + \label{eq: einhalb} % always lable your stuff + 0,5=\frac{1}{3} + \end{equation} + \autoref{eq: einhalb} is nice, but how about multiple lines: + \begin{equation} + \begin{split} % you need do nest this + x &= x^2+3 \\ + \Leftrightarrow 0 &= x^2-x+3 \\ + \end{split} + \end{equation} + and jow could you align formulas? + \begin{align} + x_1 &= 6 &&|\;\mbox{mit } x \in \mathbb{N} \\ + x_2 &= 33+\abs{\frac{1}{4}} &&|\;x_1+3 \\ + &= 33,25 &&\mbox{| warum alles numerieren?} \notag \\ + x_3 &= 10^{22} + \end{align} + + +\printbibliography +\listoffigures +\end{document} diff --git a/src/HsH-report.cls b/src/HsH-report.cls index eab5c048c49c0825b785ca46a2f1c665fa75d737..c16d1ec3aa0df9368f6e9d30862b80826a520d41 100644 --- a/src/HsH-report.cls +++ b/src/HsH-report.cls @@ -11,7 +11,12 @@ \providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro für Betragsstriche \newif\if@german% - +\DeclareOption{german}{% + \PassOptionsToPackage{ngerman}{babel} + \renewcaptionname{ngerman}{\figurename}{Abb.} %Figure + \renewcaptionname{ngerman}{\tablename}{Tab.} %Table + \@germantrue +} \DeclareOption{ngerman}{% \PassOptionsToPackage{\CurrentOption}{babel} \renewcaptionname{ngerman}{\figurename}{Abb.} %Figure @@ -53,9 +58,11 @@ \PassOptionsToPackage{utf8}{inputenc} \PassOptionsToPackage{T1}{fontenc} \PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry} -\PassOptionsToPackage{babel, german=quotes}{csquotes} \PassOptionsToPackage{headsepline}{scrlayer-scrpage} + +\PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex} \PassOptionsToPackage{free-standing-units}{siunitx} +\PassOptionsToPackage{babel, german=quotes}{csquotes} \PassOptionsToPackage{european,EFvoltages,straightvoltages}{circuitikz} %used packages: @@ -71,6 +78,8 @@ \if@german\RequirePackage{ziffer}\fi % german dezimal numbers % should these be in? +\RequirePackage{amsmath} +\RequirePackage{amssymb} \RequirePackage{subfigure} \RequirePackage{pdfpages} \RequirePackage{hyperref} @@ -86,6 +95,7 @@ \ihead{\@title} \ofoot*{\pagemark} + % typesetting indexes upright or standart \def\subinrm#1{\sb{\textnormal{#1}}} {\catcode`\_=13 \global\let_=\subinrm} @@ -106,7 +116,7 @@ {\rule{\textwidth}{0.1pt}} \vspace{0.5cm} - \renewcommand{\thanks}{\empty} + \renewcommand{\thanks}{\sbox0} \newcommand{\tempA}{ich} \newcommand{\tempB}{} \foreach \x [count=\i] in \@author{ @@ -255,7 +265,7 @@ \vskip 1.5em {\usekomafont{date}{\@date \par}}% \vskip \z@ \@plus3fill - {\usekomafont{publishers}{\@publishers \par}}% + %{\usekomafont{publishers}{\@publishers \par}}% \vskip 3em \end{center}\par \@thanks\global\let\@thanks\@empty @@ -457,7 +467,7 @@ \vskip 1em% {\usekomafont{date}{\@date \par}}% \vskip \z@ \@plus 1em - {\usekomafont{publishers}{\@publishers \par}}% + %{\usekomafont{publishers}{\@publishers \par}}% \ifx\@dedication\@empty \else \vskip 2em {\usekomafont{dedication}{\@dedication \par}}% diff --git a/src/config.tex b/src/config.tex index 380c9f74184965c3a562e08fbf8c613cf605affd..76508112bd5b7042c4cb39fd1bba335677d259c6 100644 --- a/src/config.tex +++ b/src/config.tex @@ -1,21 +1,22 @@ -\renewcaptionname{ngerman}{\abstractname}{Abstract} % Abstract +\renewcommand{\abstractname}{Abstract} %Abstract \@ifpackageloaded{biblatex}{ \ExecuteBibliographyOptions{ - sorting=nyt, bibwarn=true, isbn=false, - url=true + url=false } }{}% \@ifpackageloaded{csquotes}{ \MakeOuterQuote{"} }{}% \@ifpackageloaded{siunitx}{ + \if@german + \sisetup{output-decimal-marker={,}} + \fi \sisetup{ free-standing-units, tight-spacing=true, per-mode=symbol, - output-decimal-marker={,}, scientific-notation=engineering, round-mode = places, round-precision = 3, @@ -42,11 +43,12 @@ } }{}% \@ifpackageloaded{pgfplots}{ - \usepackage{pgfplotstable} \usepgfplotslibrary{fillbetween} % mark areas under or between graphs + \if@german + \pgfplotsset{/pgf/number format/use comma} + \fi \pgfplotsset{ compat=1.16, - /pgf/number format/use comma, /pgf/number format/read comma as period, every tick label/.append style={font=\tiny}, every axis legend/.append style={font=\footnotesize}, @@ -64,6 +66,8 @@ error mark options={mark size=1pt,rotate=90}}, } } +}{}% +\@ifpackageloaded{pgfplotstable}{ \pgfplotstableset{ col sep=semicolon, % global seperator for csv files } diff --git a/src/localBibliography.bib b/src/localBibliography.bib index e531bfc0b020838f50943800c68e0367450c2f5b..ff61b9e8eb9d7f086266caa8103f3afc9d047436 100644 --- a/src/localBibliography.bib +++ b/src/localBibliography.bib @@ -1,3 +1,39 @@ +@book{westermann:tabellenbuch, + author = {Dr. Michael Dzieia and Heinrich Hübscher and Dieter Jagla and Jürgen Klaue and Hans-Joachim Petersen and Harald Wickert}, + title = {Elektronik Tabellen: Betriebs- und Automatiesierungstechnik}, + year = {2016}, + edition = {2}, + publisher = {Westermann}, + isbn = {9-783142-450353}, + language = {GER}, +} +@manual{laboranleitung:physik, + author = {Fachschaft Physik}, + editor = {}, + title = {Laboranleitung für das Physiklabor}, + date = {2020-03-01}, + url = {https://docs.f1.hs-hannover.de/dl_fachgebiete/labore.php?id_fachgebiet=4}, + urldate = {2020-03-23}, + language = {GER} +} +@manual{laboranleitung:elektrotechnik, + author = {Fachschaft Grundlagen Elektrotechnik}, + title = {Laboranleitung für das Labor Elektrotechnische Grundlagen}, + date = {2016-06-07}, + url = {https://docs.f1.hs-hannover.de/dl_fachgebiete/labore.php?id_fachgebiet=3}, + urldate = {2020-03-30}, + language = {GER} +} +@manual{laboranleitung:messtechnik1, + author = {Prof. Dr.-Ing. S. Beißner and Prof. Dr.-Ing. M. Koch and Prof. Dr.-Ing. M. Kesting and + Prof. Dr.-Ing. M. Lassahn and Prof. Dr.-Ing. D. Hisseine and M.Sc. Brech and + M.Eng. Schwarze and Prof. Dr.-Ing. D. Stolle}, + title = {Laboranleitung für das Labor Grundlagen Messtechnik}, + date = {2019-08-12}, + url = {https://moodle.hs-hannover.de/pluginfile.php/359636/course/section/183463/LGM-Laboranleitung_EIT_20190812.pdf}, + urldate = {2019-08-11}, + language = {GER} +} %-----------------------Templates-------------------------------------------------------- % A single-volume book with one or more authors @book{1, @@ -46,7 +82,7 @@ version = {}, language = {} } -% technical or other documentation, not necessarily in printed form +% Technical or other documentation, not necessarily in printed form @manual{4, author = {}, editor = {}, @@ -57,7 +93,7 @@ urldate = {}, language = {} } -% websites which are intrinsically online resources +% web sites which are intrinsically online resources @online{5, author = {}, title = {}, @@ -67,7 +103,7 @@ urldate = {}, language = {} } -% a thesis found somewhere +% a Thesis @phdthesis{6, author = {}, title = {}, @@ -77,5 +113,4 @@ address = {}, month = {}, note = {}, -} -%-------------------------------------------------------------------------------------- \ No newline at end of file +} \ No newline at end of file diff --git a/src/personal.tex b/src/personal.tex index 16cf10906ba6395c494db46de79454f6b20ae2f3..b2caf145da5459bc6b9fe172d1e3f86541cdde91 100644 --- a/src/personal.tex +++ b/src/personal.tex @@ -6,4 +6,5 @@ \subject{Grund der Arbeit} \title{Mustertitel} \subtitle{Untertitle} -\date{\today} +\date{\today\\Zweite Abgabe: 123} +\publishers{HERAUSGEBER}