From 9dc6ead6e93d36e1aa898c649920e5b23c7d91ac Mon Sep 17 00:00:00 2001 From: mirabilos <t.glaser@tarent.de> Date: Sat, 17 Feb 2018 15:49:31 +0100 Subject: [PATCH] add first version of helper macros for LeoCAD-Bauanleitungs --- teckidsfdanleitung.sty | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 teckidsfdanleitung.sty diff --git a/teckidsfdanleitung.sty b/teckidsfdanleitung.sty new file mode 100644 index 0000000..a46411e --- /dev/null +++ b/teckidsfdanleitung.sty @@ -0,0 +1,77 @@ +% -*- mode: tex -*- +%- +% Copyright © 2018 +% mirabilos <thorsten.glaser@teckids.org> +% +% Provided that these terms and disclaimer and all copyright notices +% are retained or reproduced in an accompanying document, permission +% is granted to deal in this work without restriction, including un†+% limited rights to use, publicly perform, distribute, sell, modify, +% merge, give away, or sublicence. +% +% This work is provided “AS IS†and WITHOUT WARRANTY of any kind, to +% the utmost extent permitted by applicable law, neither express nor +% implied; without malicious intent or gross negligence. In no event +% may a licensor, author or contributor be held liable for indirect, +% direct, other damage, loss, or other issues arising in any way out +% of dealing in the work, even if advised of the possibility of such +% damage or existence of a defect, except proven that it results out +% of said person’s immediate fault when using the work as intended. + +\NeedsTeXFormat{LaTeX2e}% +\ProvidesPackage{teckidsfdanleitung}[2018/02/17 1.0 Freedroidz-Bauanleitungsmakros]% +\RequirePackage{marginnote}% + +% From Bernd Raichle via http://www.gust.org.pl/projects/pearls/2006p/index_html +\def\tbifdef#1#2#3{% + \begingroup \expandafter \endgroup \expandafter% + \ifx\csname#1\endcsname\undefined#3\else#2\fi% +}% + +\geometry{includemp,marginparwidth=1cm}% +\setlength{\fboxsep}{2ex}% + +\newcommand{\tbVorher}{}% +\newcommand{\tbNachTeilen}{}% +\newcommand{\tbHinterher}{}% +\newcommand{\vorher}[1]{% + \renewcommand{\tbVorher}{#1}% +}% +\newcommand{\nachteilen}[1]{% + \renewcommand{\tbNachTeilen}{#1}% +}% +\newcommand{\hinterher}[1]{% + \renewcommand{\tbHinterher}{#1}% +}% + +\newcommand{\schritt}[2]{% + \tbifdef{tbS#1}{% + \PackageError{teckidsfdanleitung}% + {Schritt \##1 bereits definiert!}{}% + }{}% + \expandafter\newcommand\csname tbS#1\endcsname{#2}% +}% +\newcommand{\tbSchritt}[2]{% + \fbox{\parbox{\linewidth-3.5ex}{% + \marginnote{\Huge\ttfamily\color[HTML]{444444}#2}% + {% + \centering% + \includegraphics[width=.8\linewidth]{\jobname.LEO/\jobname-#1.png}% + + }% + + \tbifdef{tbS#2}{% + \csname tbS#2\endcsname% + }{% + \textbf{ACHTUNG: Schritt \##2 nicht definiert ⚠}% + }% + + }}% + +}% + +\newcommand{\tbTeileliste}{% + \textit{TODO: pieces}% +}% + +\endinput -- GitLab