Graphics, Figures & TablesBig Head in long Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
barnarasta
Posts: 5
Joined: Wed Oct 09, 2013 11:40 pm

Big Head in long Table

Post by barnarasta »

Hello,

I'm with a wheezy looking to create a PDF with PDFLaTeX for sending by email with 'mutt'. The result of filtering the output of the 'runreport' is saved in a 'tex' is processed later.

The code used is as follows:

Code: Select all

\documentclass[a4paper] {article}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage[latin9]{inputenc}
\usepackage[left=0.5cm,top=1cm,right=0.5cm,bottom=1cm]{geometry}
\usepackage{longtable}

\renewcommand{\baselinestretch}{0.5}

\begin{document}
  \begin{longtable}{|c|c|c|l|c|c|c|}
    \multicolumn{7}{|l|}{\Huge{EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{Direccion EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{Poblacion EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{Cod.Postal y Provincia EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{NIF:}} \\ \hline 
    \multicolumn{3}{|l}{\normalsize{FACTURA: 178.256}}  &
    \multicolumn{4}{|l|}{\normalsize{CLIENTE: CORDERO REUNIDOS S.L.}} \\
    \multicolumn{3}{|l|}{\normalsize{FECHA..: 12/09/2013}} &
    \multicolumn{4}{|l|}{\normalsize{DIRECCION CLIENTE }} \\
    \multicolumn{3}{|l|}{\normalsize{COD.CLIENTE:  10.000}} & 
    \multicolumn{4}{|l|}{\normalsize{COD.POSTAL y POBLACION }} \\
    \multicolumn{3}{|l|}{\normalsize{NIF.CLIENTE: A08220220 }} & 
    \multicolumn{4}{|l|}{\normalsize{PROVINCIA }} \\ \hline 
    \multicolumn{1}{|c|}{{FECHA}} & 
    \multicolumn{1}{c|}{{ALBARAN}} & 
    \multicolumn{1}{c|}{{ARTICULO}} & 
    \multicolumn{1}{l|}{{DESCRIPCION}} & 
    \multicolumn{1}{c|}{{CANTIDAD}} & 
    \multicolumn{1}{c|}{{PRECIO}} &
    \multicolumn{1}{c|}{{IMPORTE}} \\ \hline 
    \endhead
    14.10.13 & 145.248 & 45878  & REF: Tuercas 20x12 & 16 & 1.23 & 23.23 \\
    14.10.13 & 145.248 & 45878  & REF: Tuercas 20x12 & 16 & 1.23 & 23.23 \\
    14.10.13 & 145.248 & 45238  & REF: Arandelas 12x13 & 23 & 1.23 & 21.34 \\
    14.10.13 & 145.248 & 45238  & ======= ULTIMA LINEA ===== & 23 & 1.23 & 21.34\\
% ======================== 150 lines more =================================
  \end{longtable}
\end{document}
The output is good, but I would like to put the group "CLIENTE - DIRECCION - COD.POSTAL - PROVICIA" right in the middle of "DESCRIPCION" to be more aesthetic.

Is that possible? Thanks
Attachments
latex3a.pdf
(28.05 KiB) Downloaded 364 times
latex3a.tex
(1.6 KiB) Downloaded 400 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Big Head in long Table

Post by Johannes_B »

The \multicolumn command expects the aligning in the second argument, a c will center the cell.

Code: Select all

\multicolumn{4}{|c|}{\normalsize{PROVINCIA }}
You could also insert a space in front of every entry, please see below.

Code: Select all

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{selinput}
\SelectInputMappings{
  eacute={é},
  ntilde={ñ}
}% semi-automatic detection of encoding
\usepackage[left=0.5cm,top=1cm,right=0.5cm,bottom=1cm]{geometry}
\usepackage{longtable}

\renewcommand{\baselinestretch}{0.5}
\newcommand{\tabspace}{\hspace{8em}}% the space to be inserted in front of the entries

\begin{document}
  \begin{longtable}{|c|c|c|l|c|c|c|}
    \multicolumn{7}{|l|}{\Huge{EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{Direccion EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{Poblacion EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{Cod.Postal y Provincia EMPRESA}} \\
    \multicolumn{7}{|l|}{\normalsize{NIF:}} \\ \hline
    \multicolumn{3}{|l}{\normalsize{FACTURA: 178.256}} &
    \multicolumn{4}{|l|}{\normalsize{\tabspace CLIENTE: CORDERO REUNIDOS S.L.}} \\
    \multicolumn{3}{|l|}{\normalsize{FECHA..: 12/09/2013}} &
    \multicolumn{4}{|l|}{\tabspace \normalsize{ DIRECCION CLIENTE }} \\
    \multicolumn{3}{|l|}{\normalsize{COD.CLIENTE: 10.000}} &
    \multicolumn{4}{|l|}{\normalsize{\tabspace COD.POSTAL y POBLACION }} \\
    \multicolumn{3}{|l|}{\normalsize{NIF.CLIENTE: A08220220 }} &
    \multicolumn{4}{|l|}{\normalsize{\tabspace PROVINCIA }} \\ \hline
    \multicolumn{1}{|c|}{{FECHA}} &
    \multicolumn{1}{c|}{{ALBARAN}} &
    \multicolumn{1}{c|}{{ARTICULO}} &
    \multicolumn{1}{l|}{{DESCRIPCION}} &
    \multicolumn{1}{c|}{{CANTIDAD}} &
    \multicolumn{1}{c|}{{PRECIO}} &
    \multicolumn{1}{c|}{{IMPORTE}} \\ \hline
    \endhead
    14.10.13 & 145.248 & 45878 & REF: Tuercas 20x12 & 16 & 1.23 & 23.23\\
    14.10.13 & 145.248 & 45878 & REF: Tuercas 20x12 & 16 & 1.23 & 23.23\\
    14.10.13 & 145.248 & 45238 & REF: Arandelas 12x13 & 23 & 1.23 & 21.34\\
    14.10.13 & 145.248 & 45238 & ======= ULTIMA LINEA ===== & 23 & 1.23 & 21.34\\
    % ======================== 150 lines more =================================
  \end{longtable}
\end{document}
Is this what you meant?

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
barnarasta
Posts: 5
Joined: Wed Oct 09, 2013 11:40 pm

Re: Big Head in long Table

Post by barnarasta »

Thank you!
It's a great solution!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Big Head in long Table

Post by localghost »

Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX where it also has got an answer. Please read what our administrator thinks about that.
Board Rules wrote:A crossposting is always contra-productive. But there is nothing really against it as long as it is mentioned. This means that a direct link has to be added. So other users who want to help are preserved from double efforts and waste of time.
This kind of x-posting represents a direct violation of our rules and has to be prevented in future questions.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Big Head in long Table

Post by Johannes_B »

Thanks for the information Thorsten.
Would I have known, that somebody with much more experience answered the question before me, i wouldn't have wasted my time for a quick hack. Please look at Davids answer carefully, as it looks very good. I wasn't paying any attention on how improve the looks of your table.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
barnarasta
Posts: 5
Joined: Wed Oct 09, 2013 11:40 pm

Big Head in long Table

Post by barnarasta »

localghost wrote: Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX where it also has got an answer. Please read what our administrator thinks about that.
Johhanes_B regret the incident may both desire forums and have not any problem for this.
I put the question in different forums that I was told are the best because I had the problem for several days without solving thinking it's better learning different ways to do different opinions give more culture.

Again I thank you for your contribution, I'm working the bottom of the document, but I'll have a problem with the final position "endlastfoot" of absolute page.
If not fix'll throw back an SOS.
Post Reply