General ⇒ table/figure background and border
-
paulvanderheijden
- 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
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
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