Closed Udi-Fogiel closed 1 year ago
fbox
package provides a similar flexibility, by redefining \fbox
.
\documentclass{article}
\usepackage{fbox}
% \usepackage{xcolor} % already loaded by fbox
\makeatletter
% set color for all lines. Default "black"
\define@key{fbox}{framecolor}[black]{%
\def\fbox@bcolor{#1}\def\fbox@tcolor{#1}%
\def\fbox@lcolor{#1}\def\fbox@rcolor{#1}}
\makeatother
\def\offset{\hskip\dimexpr\fboxsep+\fboxrule\relax}
\begin{document}
content content\offset\llap{\fbox{abc abc}}
content content\offset\llap{\fbox[framecolor=blue]{abc abc}}
content content\offset\llap{\fcolorbox{blue!20}{red!20}{abc abc}}
\end{document}
Such a simple package, only about 100 lines! I love it. Thanks!
It would be nice to have a version of
\fcolorbox
that does not have background. For example we can define with something similar toThis is just an example, of curse it can be somehow use the already existing commands with some hack to shorten the code...