Graphics, Figures & TablesHow to change the frame line thickness ?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to change the frame line thickness ?

Post by Cham »

I don't need anything fancy. Just to change the frame thickness in this MWE example :

Code: Select all

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}

	\begin{figure}
		\centering
		\frame{\includegraphics[height=6.5cm]{example-image}}
	\end{figure}

\end{document}
If possible, I don't want to use another package just to change the line thickness. Any suggestion ? Are there some options for the \frame command ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to change the frame line thickness ?

Post by Johannes_B »

Better use fbox.

Code: Select all

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}

\begin{figure}
\centering
\setlength{\fboxrule}{5pt}
\setlength{\fboxsep}{0pt}
\fbox{\includegraphics[height=6.5cm]{example-image}}
\end{figure}
\begin{figure}
\centering
\makeatletter
\@wholewidth5pt
\makeatother
\frame{\includegraphics[height=6.5cm]{example-image}}
\end{figure}

\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

How to change the frame line thickness ?

Post by Cham »

Indeed, fbox appears to solve my issue. Thanks a lot !
Post Reply