diff --git a/documentation.tex b/documentation.tex index 00bd5af..0762046 100644 --- a/documentation.tex +++ b/documentation.tex @@ -59,7 +59,7 @@ framexleftmargin=2.4em, showstringspaces=false, language=TeX, - morekeywords={\documentclass,\begin,\end,\usepackage,\makeinvoice,\setinvoicetitle,\setinvoicenumber,\setreceivername,\setreceiveraddress,\setname,\setaddress,\setphonenumber,\setemail,\setyourref,\setourref,\setinvoicedate,\setdeadline,\additem,\setsubtotal,\setvat,\settotal,\setaccountnumber, \setsummary, \setcurrency, \setvattext, \setaccounttext}, + morekeywords={\documentclass,\begin,\end,\usepackage,\makeinvoice,\setinvoicetitle,\setlogo,\setinvoicenumber,\setreceivername,\setreceiveraddress,\setname,\setaddress,\setphonenumber,\setemail,\setyourref,\setourref,\setinvoicedate,\setdeadline,\additem,\setsubtotal,\setvat,\settotal,\setaccountnumber, \setsummary, \setcurrency, \setvattext, \setaccounttext}, commentstyle=\color{source_brown}\ttfamily, keywordstyle=\color{source_blue}\ttfamily, stringstyle=\color{source_orange}, @@ -161,6 +161,13 @@ \subsection{{\textbackslash}setinvoicetitle} \setinvoicetitle{My invoice} \end{lstlisting} +\subsection{{\textbackslash}setlogo} +Sets a logo filename to be read from the current directory. Optional command. Takes one argument: the logo filename without extension. +Example (if filename was logo.png): +\begin{lstlisting} +\setlogo{logo} +\end{lstlisting} + \subsection{{\textbackslash}setinvoicenumber} \label{par:setinvoicenumber} Sets the invoice number for the invoice. This command must be present, if not the text ``{\color{red}No number}'' is printed in place of an invoice number. Takes one argument: the invoice number. Example: \begin{lstlisting} @@ -324,6 +331,7 @@ \chapter{Example invoices} \setcurrency{USD} \setinvoicetitle{My Invoice} +\setlogo{logo} \setinvoicenumber{42} \setreceivername{Person McNameface} diff --git a/simpleinvoice.sty b/simpleinvoice.sty index c9cff07..d1a38a4 100644 --- a/simpleinvoice.sty +++ b/simpleinvoice.sty @@ -185,10 +185,12 @@ \newcommand{\setcurrency}[1]{\def \INV@text@currency {\ #1}} \newcommand{\setvattext}[1]{\def \INV@text@vat {#1}} \newcommand{\setaccounttext}[1]{\def \INV@text@accountnum {#1}} +\newcommand{\setlogo}[1]{\def \INV@content@logo} {#1}} % Make invoice function \def \makeinvoice { \begin{minipage}[b]{0.5\textwidth} + \ifdef{\INV@content@logo}{\begin{flushleft}\includegraphics{\INV@content@logo}\end{flushleft}}{} {\large \textbf{\INV@content@toname}} \\ \INV@content@toaddr \end{minipage}