LaTeX forum ⇒ Graphics, Figures & TablesVertical and horizontal centering of full size image

Information and discussion about graphics, figures & tables in LaTeX documents.
Pintu
Posts: 4
Joined: Tue Nov 08, 2011 7:48 pm

Vertical and horizontal centering of full size image

Postby Pintu » Tue Nov 08, 2011 8:34 pm

Hi,

Thanks to this Forum I have solved a whole bunch of problems, but I am unable to do one thing: I need to place a large figure on a page, nothing else. Because the Figure is larger then the text area I want to center it horizontally and vertically.

Here is an example how I've trying to achieve this. It is quite ugly and I don't think that the figure vertical center is perfect. Because I am using this command very often I am looking for something easier.

Thanks,
Pintu

  1. \documentclass[final,11pt,paper=a4]{scrartcl}
  2.  
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[T1]{fontenc}
  5. \usepackage{lmodern}
  6. \usepackage{mathtools}
  7. \usepackage{floatpag} % for figures allowing to overlap page numbers
  8. \floatpagestyle{plain}
  9. \rotfloatpagestyle{plain}
  10.  
  11. \usepackage[labelfont=bf,hang,singlelinecheck=false]{caption}
  12. \setlength{\captionmargin}{20pt}
  13. \captionsetup{justification=justified}
  14.  
  15. \usepackage{geometry}
  16. \geometry{
  17. centering,
  18. footskip=35pt,
  19. textheight=670pt,
  20. footnotesep=24pt plus 2pt minus 12pt,
  21. }
  22.  
  23. \begin{document}
  24.  
  25. \begin{table}[c]
  26. \begin{minipage}[c][\textheight]{\textwidth}
  27. \thisfloatpagestyle{empty}
  28. \caption{Full Size Table}
  29. \centerline{
  30. \includegraphics[angle=90]{table}}
  31. \label{table}
  32. \end{minipage}
  33. \end{table}
  34.  
  35. \end{document}

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

Postby localghost » Tue Nov 08, 2011 9:12 pm

I have two questions.

  • Which file format has the image file?
  • Is the table so complex that you can't do it in LaTeX?


Best regards and welcome to the board
Thorsten
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

Pintu
Posts: 4
Joined: Tue Nov 08, 2011 7:48 pm

Postby Pintu » Tue Nov 08, 2011 9:42 pm

Hi,

    The image is a PDF

    I have dozens of tables as vector graphics, converting them to tex would be a lot of work. But anyway, I require this for figures as well.

Thanks,
Pintu

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

Postby localghost » Tue Nov 08, 2011 10:23 pm

Pintu wrote:[…] The image is a PDF […]

The pdfpages package could help here.
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

Pintu
Posts: 4
Joined: Tue Nov 08, 2011 7:48 pm

Postby Pintu » Tue Nov 08, 2011 10:40 pm

pdfpages is not really an option, as I need page numbers on some pages where the figure does not overlap, but I require the figure to be vertically and horizontally centered.

User avatar
CDbile
Posts: 19
Joined: Mon Jan 31, 2011 6:48 pm

Postby CDbile » Thu Nov 10, 2011 4:21 pm

Is this code:

  1. \documentclass{article}
  2. \usepackage{graphicx}
  3. \usepackage{lipsum}
  4.  
  5. \begin{document}
  6.  
  7. \lipsum[1-2]
  8.  
  9. \begin{figure}[p]\centering
  10. \vfill
  11. \caption{Full Size Table}
  12. \includegraphics[angle=90]{img}
  13. \vfill
  14. \end{figure}
  15.  
  16. \lipsum[1-2]
  17.  
  18. \end{document}


the code that you are looking for?
(note that the package lipsum is only used to produce dummy text and is not part of the solution)
CDbile

Pintu
Posts: 4
Joined: Tue Nov 08, 2011 7:48 pm

Postby Pintu » Thu Nov 10, 2011 4:27 pm

No, that does not center the graph on the page, just within the text margins.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests