Graphics, Figures & Tables ⇒ centering of large figure
centering of large figure
it doesnt remain centered (inspite of the \begin{center} \end{center} command)
The figure moves a little to the right, not aligned with caption and text.
Is there a command that will allow the figure to use more space in the page while being aligned as i want to?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
centering of large figure
Code: Select all
\begin{figure}[!ht]
\makebox[\textwidth]{
\includegraphics{filename}
}
\caption{Wide figure}\label{fig:wide}
\end{figure}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
centering of large figure
Does the command:
Code: Select all
\begin{figure}
\includegraphics[width=\textwidth]{filename}
\end{figure}
This way, you would save the creation of a box.
Cheers
Re: centering of large figure
Can i do it somehow?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
centering of large figure
Just translate the suggestion from my last reply. Theoretically you can stretch the width of the figure to paper width without obtaining warnings.kth wrote:[...] Can i do it somehow?
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
centering of large figure
Code: Select all
\begin{figure}[h]
\makebox(3,3){
\includegraphics{filename}
}
\end{figure}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
centering of large figure
It goes without saying the you still can specify a width for the included graphics file in addition to my code example.
Code: Select all
\includegraphics[width=1.2\textwidth]{filename}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
centering of large figure
the syntax is:
Code: Select all
\makebox(width,height)[position]{ ... }
If I specify a width in the \includegraphics command shouldnt that be smaller than the box dimension?
Also my figure goes on the text...
Thanx for reading this
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
centering of large figure
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage{blindtext}
\setlength{\parindent}{0em}
\begin{document}
\blindtext
\makebox[\textwidth]{%
\rule{1.1\textwidth}{0.5\textheight}
}
\blindtext
\end{document}
[1] View topic: LaTeX Resources for Beginners
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
centering of large figure
Code: Select all
\begin{figure}[htbp]
\centering
\setlength{\unitlength}{\textwidth}
\begin{picture}(1,0.5)%in case your image is twice as wide as it is high.
\put(-0.1,0){\includegraphics[width=1.2\unitlength]{image.jpg}}
\end{picture}
\end{figure}