Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
104 lines (95 sloc) 3.54 KB
% 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.2pt} % 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'.