Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion documentation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -324,6 +331,7 @@ \chapter{Example invoices}
\setcurrency{USD}

\setinvoicetitle{My Invoice}
\setlogo{logo}
\setinvoicenumber{42}

\setreceivername{Person McNameface}
Expand Down
2 changes: 2 additions & 0 deletions simpleinvoice.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an extra } at the end of \INV@content@logo which causes the error You can't use macro parameter character #' in vertical mode.`


% 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}
Expand Down