General ⇒ table/figure background and border
-
- Posts: 4
- Joined: Sun Feb 17, 2008 2:34 pm
table/figure background and border
I'd like my figures and tables to reside in a box. Just the content and not the title and caption. My primary colors will be, say, black and blue, so I'd like this box to have a 20% blue background and on the top and bottom a 100% blue border.
How do I do this? Should I make a class for this (never done that before).
A sideline question: I am feeling pretty comfortable with the typesetting part of Latex, but I would love to have some examples of beautifully typeset (color) books with sourcecode. Any source for that?
Thanks!
Paul
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
table/figure background and border
I can only offer you a partial solution using the xcolor package.paulvanderheijden wrote:[...] I'd like my figures and tables to reside in a box. Just the content and not the title and caption. My primary colors will be, say, black and blue, so I'd like this box to have a 20% blue background and on the top and bottom a 100% blue border. [...]
Code: Select all
\documentclass[BCOR13mm,DIV15]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{font=small,labelfont=bf]{caption}
\usepackage{xcolor}
\begin{document}
\begin{figure}[!ht]
\centering
\fcolorbox{blue}{blue!20}{
\rule{6.4cm}{3.6cm}
}
\caption{A figure in a colored box}\label{fig:colorboxfig}
\end{figure}
\end{document}
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10