-
Notifications
You must be signed in to change notification settings - Fork 2
/
mysignature.sty
104 lines (95 loc) · 3.54 KB
/
mysignature.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
% A package, that provide a function to generate a nice looking signature
%
% (c) Arne Küderle
%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%
\NeedsTeXFormat{LaTeX2e} % required version of Latex
\ProvidesPackage{mysignature}
[2015/05/17 v0.01 LaTeX package to create a signature] % Package description
\RequirePackage{kvoptions} % allow key value options
\RequirePackage{graphicx} % for pictures
\RequirePackage{xstring} % for string comparison
\DeclareStringOption[default_signature]{signature} % select which signature-option-file should be used
\DeclareStringOption[\today]{date}[\@date] % select which date should be used as Sign date (not specified: today, specified without value: the \date used in the document)
\DeclareBoolOption{nolocation} % add the option to remove the location
\DeclareBoolOption{nojob} % add the option to remove the job
\DeclareBoolOption{empty} % add the option to remove the actual signature
\ProcessKeyvalOptions*
\def\SigDate{\mysignature@date} % assigns the date based on the option
\input{signatures/\mysignature@signature} % loads the respective settings file
% Removes the location based on the option
\ifmysignature@nolocation
\def\SigTopline{\small\SigDate}
\else
\def\SigTopline{\small\SigLocation, \SigDate}
\fi
%%
% Removes the job based on the option
\ifmysignature@nojob
\def\SigJobline{}
\else
\def\SigJobline{\\ \small\SigJob}
\fi
%%
% Removes the actual signature based on the option
\ifmysignature@empty
\def\SigPicture{}
\else
\def\SigPicture{\includegraphics[height=1.1cm]{\SigSource}}
\fi
%%
\newcommand{\mysignature}[2][right]{
\IfStrEqCase{#1}{
{left}{\def\Align{flushleft}}
{right}{\def\Align{flushright}}
{center}{\def\Align{center}}
}
\begin{\Align}
\IfStrEqCase{#2}{
{full}{
\begin{minipage}{6cm}
\begin{flushleft}
\SigTopline \\ % create the topline
\end{flushleft}
\vspace*{-0.75cm} % overlap between signature and topline
\hspace*{1cm} % default horizontal positioning of the signature
\begin{minipage}[t][1.1cm]{5cm} % inner minipage
\vskip\SigTransformY % move the signature picture based on the values specified in the settings file
\hspace*{\SigTransformX}
\SigPicture % insert the picture
\end{minipage}
\vskip-0.3cm % overlap between minipage and rule
\rule{\textwidth}{0.4mm} % create signature rule
\vspace*{-0.7cm} % reduced space between rule and Name
\begin{flushright}
\SigName % insert Name
\SigJobline %insert Job
\end{flushright}
\end{minipage}
}
{minimal}{
\begin{minipage}{5cm}
\hspace*{0.5cm}
\begin{minipage}[t][1.1cm]{4.5cm}
\vskip\SigTransformY
\hspace*{\SigTransformX}
\SigPicture
\end{minipage}
\vskip-0.3cm
\makebox[\textwidth]{\dotfill} % create dotted line
\vspace*{-0.5cm}
\begin{flushleft}
\SigName
\SigJobline
\end{flushleft}
\end{minipage}
}
}
\end{\Align}
}
\endinput
%%
%% End of file `mysignature.sty'.