From c6f68a8d673deb3603d5bf6ca11b3a0d65428e21 Mon Sep 17 00:00:00 2001
From: niepra01 <rolf.niepraschk@ptb.de>
Date: Wed, 16 May 2018 09:07:22 +0200
Subject: [PATCH] "nameref"

---
 arbeitsanweisung/vl-arbeitsanweisung.cls | 44 +++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/arbeitsanweisung/vl-arbeitsanweisung.cls b/arbeitsanweisung/vl-arbeitsanweisung.cls
index 71918e2..a6f47ce 100644
--- a/arbeitsanweisung/vl-arbeitsanweisung.cls
+++ b/arbeitsanweisung/vl-arbeitsanweisung.cls
@@ -19,7 +19,8 @@
 \RequirePackage[%
 paper=a4paper,
 headheight=16mm,
-marginparwidth=5mm,
+marginparsep=2mm,
+marginparwidth=12mm,
 left=22mm,
 right=16mm,
 textheight=228mm,
@@ -254,10 +255,51 @@ footskip=25mm,
 ,tocnumwidth=3.5em
 ]{section}
 
+\RequirePackage{marginnote}
+\DeclareRobustCommand\note{%
+  % Normalform = Horizontale Notiz;
+  %   #1 = vertikale Verschiebung (ohne Einheit: Anzahl Zeilen)
+  % Sternform = Um 90 Grad gedrehte Notiz;
+  %   #1 = Breite (ohne Einheit: Anzahl mm, ohne Angabe: 3\marginparwidth)
+  \@ifstar{\@tempswatrue\note@i}{\@tempswafalse\note@i}%
+}
+
+\newcommand*\note@i[1][\z@]{%
+  \note@ii[#1]%
+}
+
+\newcommand*\note@ii{}
+\def\note@ii[#1]#2{%
+  \begingroup{}
+    \if@tempswa
+      \unitlength=1mm\relax
+    \else
+      \unitlength=\baselineskip
+    \fi
+    \@ovro#1\unitlength
+    \if@tempswa
+      \@ovri=\ifdim\@ovro=\z@ 3\marginparwidth\else\@ovro\fi
+      \@ovro=\z@
+      \def\x{\rotatebox[origin=c]{90}{\makebox[0pt][c]{%
+        \parbox{\@ovri}{\baselineskip=0pt\RaggedRight\hspace{0pt}#2}}}}%
+    \else
+      \def\x{\baselineskip=0pt\RaggedRight\hspace{0pt}#2}%
+    \fi
+    \overfullrule=\z@
+    \marginnote{\x}[\@ovro]%
+  \endgroup
+  \ignorespaces% problematisch!
+}
+% Für Parameter #1 Angabe mit und ohne Einheit ermöglichen.
+\picture@redefine\note@ii{[&1]}
+
+\renewcommand*\marginfont{\normalfont\normalsize\itshape\color{red}}
+
 \emergencystretch=3em % 
 
 \raggedbottom
 
+\RequirePackage{nameref}
 \RequirePackage[final]{hyperref}
 
 \endinput
-- 
GitLab