Text FormattingDefine Another Command Like Aboxed but with a Different Colorbox

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Kareem
Posts: 9
Joined: Sat Aug 04, 2012 2:28 pm

Define Another Command Like Aboxed but with a Different Colorbox

Post by Kareem »

The following commands define Aboxed but with a yellow coloured box.

Code: Select all

\def\@Aboxed#1&#2&#3\ENDDNE{%
  \ifnum0=`{}\fi \setbox \z@
    \hbox{$\displaystyle#1{}\m@th$\kern\fboxsep \kern\fboxrule }%
    \edef\@tempa {\kern  \wd\z@ &\kern -\the\wd\z@ \fboxsep
        \the\fboxsep \fboxrule \the\fboxrule }\@tempa 
        \fcolorbox{black}{yellow}{$\displaystyle #1#2$}% changed
}
Now, how can I define another command, say AboxedG, with a green coloured box?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Define Another Command Like Aboxed but with a Different Colorbox

Post by Bartman »

Please link your crossposts.
Post Reply