Graphics, Figures & TablesRemoving extra white Space around Figure

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
hbaromega
Posts: 48
Joined: Mon Mar 07, 2011 8:21 pm

Removing extra white Space around Figure

Post by hbaromega »

We used to use clip format in normal documents with \includegraphics environment to get rid of the extra white space around a figure.

However, it does not work while using the beamer class. Could be there a way out?

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

tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am

Removing extra white Space around Figure

Post by tom »

I have no problems clipping a figure in beamer. Could you provide a MWE?

Code: Select all

\documentclass{beamer}

\begin{document}
\begin{frame}{Clip image}
\centering
\includegraphics[trim=2cm 2cm 2cm 2cm,clip=true,width=5cm]{figure1}
\end{frame}
\end{document}
hbaromega
Posts: 48
Joined: Mon Mar 07, 2011 8:21 pm

Removing extra white Space around Figure

Post by hbaromega »

Actually trim doesn't have any control. It cuts some non-white part of one figure and height of two figures don't match (see my MWE).

Like I used to do in dvi, clip is supposed to automatically remove the unnecessary white spaces around the figure. My MWE is given below.

Code: Select all

\documentclass[xcolor=svgnames,10pt]{beamer}
\usetheme{classic}
\usepackage{graphicx}

\begin{document}
\frame{
    \frametitle{Sample Title}	
	\begin{tabular}{l l}
	%
	\begin{minipage}{0.5\textwidth}	
	\begin{figure}
	\includegraphics[height=5cm,trim=.5cm .5cm .5cm .5cm,clip]{Fig1.png}
	\end{figure}
	\end{minipage}
	%
	\begin{minipage}{0.5\textwidth}
	\begin{figure}
	\includegraphics[height=5cm,trim=.5cm .5cm .5cm .5cm,clip]{Fig2.png}
	\end{figure}
	\end{minipage}
	\end{tabular}
    }

 \end{document}   

Do you need me to attach figures?

Thanks.
Post Reply