how to change color of frames around graphics using framed package
Lars Madsen
daleif at math.au.dk
Wed Mar 22 09:06:00 CET 2023
You might want to have a look at the tcolorbox package instead of frames. It has a ton of more features and an extensive manual.
The framed package is very old and limited
Lars Madsen
Programmør
Institut for Matematik
Aarhus Universitet
person.au.dk/daleif at math<https://person.au.dk/daleif@math>
________________________________
From: texhax <texhax-bounces+daleif=imf.au.dk at tug.org> on behalf of Christopher Ryan via texhax <texhax at tug.org>
Sent: 21 March 2023 18:16
To: TeXHaX List <texhax at tug.org>
Subject: how to change color of frames around graphics using framed package
Trying to put frames/boxes, of varying color, around my graphics and their associated captions. Using MikTeX on Win 10, and experimenting with the framed package.
The code below puts a black box around the graphic, despite my efforts, in the preamble, to make that frame red. Uncommenting the \definecolor{framecolor} line within the framed environment itself doesn't help.
\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage[margin=0.75in]{geometry}
\usepackage{framed}
\usepackage{xcolor}
\definecolor{framecolor}{named}{red}
\definecolor{shadecolor}{named}{blue}
\begin{document}
\begin{figure}\centering
\begin{framed}
% \definecolor{framecolor}{named}{red}
\includegraphics{emsdailyscatterplotsmoother}
\end{framed}
\end{figure}
\end{document}
In contrast, the code below does indeed set the background color of a shaded region blue, as I'd expect.
\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage[margin=0.75in]{geometry}
\usepackage{framed}
\usepackage{xcolor}
\definecolor{framecolor}{named}{red}
\definecolor{shadecolor}{named}{blue}
\begin{document}
\begin{figure}\centering
\begin{shaded}
\includegraphics{emsdailyscatterplotsmoother}
\end{shaded}
\end{figure}
\end{document}
I have not found any instructions in the framed package documentation about how to change or set color of the frame. Grateful for any advice.
-Chris Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20230322/4e393a0e/attachment.html>
More information about the texhax
mailing list.