1

I have the below invoice table but it does not fill the whole with of the page. How is it possible to span the invoice table across whole page width and respecting the margin so more content could fit in the cell?

\begin{invoice}{Euro}{0}
  \ProjectTitle{Example Project}%
  \Fee{Development gjgjgj bkgkub kgkugk jhgjgj jkhkjgjkb lhkhkjhjk khh} {1000.00} {1}
\end{invoice}

enter image description here

1

Here is a very rough solution to the problem. Probably this can be seriously simplified using patching tools, hopefully someone will do.

The problem with the invoice package is that it defines the width of the activity field as 5cm:

    \begin{longtable}{p{5cm}lrrr}%

and doesn't seem to give an option to change this. In the following code, I've added another argument to the invoice environment to adjust this width. You can find the new invoice.sty here (select the invoice.sty file), just save it with the same name in your working folder. Now, the invoice environment will take a third argument for the width:

\documentclass{article}
\usepackage{invoice}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\begin{invoice}{Euro}{0}{6}
  \ProjectTitle{Example Project}%
  \Fee{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Ut purus elit,vestibulum ut, placerat ac, adipiscing vitae, felis} {1000.00} {1}
\end{invoice}
\end{document}

You will get: enter image description here You can adjust the width to fit the page.

  • invoice.sty -> "Restricted, sorry you don't have permission to load this page." – pds Dec 3 '18 at 5:03
  • Added the edit to invoice.sty in an answer below for future LaTeX'ers. – pds Dec 3 '18 at 5:51
0

Further to @jak123's answer - you can edit the invoice.sty file to pass in a width argument.

A typical location for installed packages via MikTex on Windows is at: Programs\MiKTeX 2.9\tex\latex\invoice\invoice.sty

Before: (invoice.sty)

%% Approx at line 228 %%

\newenvironment{\my@invoice}[2]{%

%%... various definitions ...

\begin{longtable}{p{5cm}lrrr}%

After: (invoice.sty)

%% Approx at line 228 %%

\newenvironment{\my@invoice}[3]{%

%%... various definitions ...

\begin{longtable}{p{#3cm}lrrr}%

The #3 refers to the third argument's value in the invoice environment. It's value replaces the #3 parameter directly, as when you pass 10 as the 3rd argument, #3cm becomes 10cm.

Usage: (myinvoice.tex)

\documentclass{article}
\usepackage{invoice}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
\begin{invoice}{Euro}{0}{10}
  \ProjectTitle{Example Project}%
  \Fee{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Ut purus elit,vestibulum ut, placerat ac, adipiscing vitae, felis} {1000.00} {1}
\end{invoice}
\end{document}
  • Please don't change files you do not own and don't have the right to change. – Johannes_B Dec 3 '18 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.