LaTeX forum ⇒ Graphics, Figures & TablesBig Head in long Table Topic is solved

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

Big Head in long Table

Postby barnarasta » Wed Oct 09, 2013 11:47 pm

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:

  1. \documentclass[a4paper] {article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[spanish]{babel}
  4. \usepackage[latin9]{inputenc}
  5. \usepackage[left=0.5cm,top=1cm,right=0.5cm,bottom=1cm]{geometry}
  6. \usepackage{longtable}
  7.  
  8. \renewcommand{\baselinestretch}{0.5}
  9.  
  10. \begin{document}
  11. \begin{longtable}{|c|c|c|l|c|c|c|}
  12. \multicolumn{7}{|l|}{\Huge{EMPRESA}} \\
  13. \multicolumn{7}{|l|}{\normalsize{Direccion EMPRESA}} \\
  14. \multicolumn{7}{|l|}{\normalsize{Poblacion EMPRESA}} \\
  15. \multicolumn{7}{|l|}{\normalsize{Cod.Postal y Provincia EMPRESA}} \\
  16. \multicolumn{7}{|l|}{\normalsize{NIF:}} \\ \hline
  17. \multicolumn{3}{|l}{\normalsize{FACTURA: 178.256}} &
  18. \multicolumn{4}{|l|}{\normalsize{CLIENTE: CORDERO REUNIDOS S.L.}} \\
  19. \multicolumn{3}{|l|}{\normalsize{FECHA..: 12/09/2013}} &
  20. \multicolumn{4}{|l|}{\normalsize{DIRECCION CLIENTE }} \\
  21. \multicolumn{3}{|l|}{\normalsize{COD.CLIENTE: 10.000}} &
  22. \multicolumn{4}{|l|}{\normalsize{COD.POSTAL y POBLACION }} \\
  23. \multicolumn{3}{|l|}{\normalsize{NIF.CLIENTE: A08220220 }} &
  24. \multicolumn{4}{|l|}{\normalsize{PROVINCIA }} \\ \hline
  25. \multicolumn{1}{|c|}{{FECHA}} &
  26. \multicolumn{1}{c|}{{ALBARAN}} &
  27. \multicolumn{1}{c|}{{ARTICULO}} &
  28. \multicolumn{1}{l|}{{DESCRIPCION}} &
  29. \multicolumn{1}{c|}{{CANTIDAD}} &
  30. \multicolumn{1}{c|}{{PRECIO}} &
  31. \multicolumn{1}{c|}{{IMPORTE}} \\ \hline
  32. \endhead
  33. 14.10.13 & 145.248 & 45878 & REF: Tuercas 20x12 & 16 & 1.23 & 23.23 \\
  34. 14.10.13 & 145.248 & 45878 & REF: Tuercas 20x12 & 16 & 1.23 & 23.23 \\
  35. 14.10.13 & 145.248 & 45238 & REF: Arandelas 12x13 & 23 & 1.23 & 21.34 \\
  36. 14.10.13 & 145.248 & 45238 & ======= ULTIMA LINEA ===== & 23 & 1.23 & 21.34\\
  37. % ======================== 150 lines more =================================
  38. \end{longtable}
  39. \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 120 times
latex3a.tex
(1.6 KiB) Downloaded 167 times

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Oct 10, 2013 9:13 am

The \multicolumn command expects the aligning in the second argument, a c will center the cell.
  1. \multicolumn{4}{|c|}{\normalsize{PROVINCIA }}

You could also insert a space in front of every entry, please see below.
  1. \documentclass[a4paper]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[spanish]{babel}
  4. \usepackage{selinput}
  5. \SelectInputMappings{
  6. eacute={é},
  7. ntilde={ñ}
  8. }% semi-automatic detection of encoding
  9. \usepackage[left=0.5cm,top=1cm,right=0.5cm,bottom=1cm]{geometry}
  10. \usepackage{longtable}
  11.  
  12. \renewcommand{\baselinestretch}{0.5}
  13. \newcommand{\tabspace}{\hspace{8em}}% the space to be inserted in front of the entries
  14.  
  15. \begin{document}
  16. \begin{longtable}{|c|c|c|l|c|c|c|}
  17. \multicolumn{7}{|l|}{\Huge{EMPRESA}} \\
  18. \multicolumn{7}{|l|}{\normalsize{Direccion EMPRESA}} \\
  19. \multicolumn{7}{|l|}{\normalsize{Poblacion EMPRESA}} \\
  20. \multicolumn{7}{|l|}{\normalsize{Cod.Postal y Provincia EMPRESA}} \\
  21. \multicolumn{7}{|l|}{\normalsize{NIF:}} \\ \hline
  22. \multicolumn{3}{|l}{\normalsize{FACTURA: 178.256}} &
  23. \multicolumn{4}{|l|}{\normalsize{\tabspace CLIENTE: CORDERO REUNIDOS S.L.}} \\
  24. \multicolumn{3}{|l|}{\normalsize{FECHA..: 12/09/2013}} &
  25. \multicolumn{4}{|l|}{\tabspace \normalsize{ DIRECCION CLIENTE }} \\
  26. \multicolumn{3}{|l|}{\normalsize{COD.CLIENTE: 10.000}} &
  27. \multicolumn{4}{|l|}{\normalsize{\tabspace COD.POSTAL y POBLACION }} \\
  28. \multicolumn{3}{|l|}{\normalsize{NIF.CLIENTE: A08220220 }} &
  29. \multicolumn{4}{|l|}{\normalsize{\tabspace PROVINCIA }} \\ \hline
  30. \multicolumn{1}{|c|}{{FECHA}} &
  31. \multicolumn{1}{c|}{{ALBARAN}} &
  32. \multicolumn{1}{c|}{{ARTICULO}} &
  33. \multicolumn{1}{l|}{{DESCRIPCION}} &
  34. \multicolumn{1}{c|}{{CANTIDAD}} &
  35. \multicolumn{1}{c|}{{PRECIO}} &
  36. \multicolumn{1}{c|}{{IMPORTE}} \\ \hline
  37. \endhead
  38. 14.10.13 & 145.248 & 45878 & REF: Tuercas 20x12 & 16 & 1.23 & 23.23\\
  39. 14.10.13 & 145.248 & 45878 & REF: Tuercas 20x12 & 16 & 1.23 & 23.23\\
  40. 14.10.13 & 145.248 & 45238 & REF: Arandelas 12x13 & 23 & 1.23 & 21.34\\
  41. 14.10.13 & 145.248 & 45238 & ======= ULTIMA LINEA ===== & 23 & 1.23 & 21.34\\
  42. % ======================== 150 lines more =================================
  43. \end{longtable}
  44. \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

Postby barnarasta » Thu Oct 10, 2013 9:37 am

Thank you!
It's a great solution!

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Oct 10, 2013 11:03 am

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Oct 10, 2013 11:11 am

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

Postby barnarasta » Fri Oct 11, 2013 1:55 pm

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.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests