Generalcreate legend over symbols used

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
katjag
Posts: 1
Joined: Tue Sep 25, 2007 10:37 am

create legend over symbols used

Post by katjag »

I'd like to create a legend over symbols, e.g. containing boxes of different colors and diffent types of arrows. Next to the symbol the description what it means should be.
Is there a possibility to realize this in LaTeX? I thought about using a table or a minipage but I can't manage to include a figure.

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

create legend over symbols used

Post by gmedina »

I am not sure I understood your question. The following example uses the \overset command of the amsmath packages to place a box with some information above the usual functional symbol. The example looks ugly, but I only meant it as ... well, an example:

Code: Select all

\documentclass{article}
\usepackage{xcolor}
\usepackage{amsmath}

\begin{document}

text text text 
$\overset{\colorbox{blue}{\parbox{3.7cm}{\centering%
 $A$ is the domain of $f$\\%
 $B$ is the codomain of $f$\\[1em]%
 \colorbox{gray}{\textcolor{red}{Other notation:}}\\[0.5em]%
 $A\xrightarrow{f}B$}}}%
 {f:A\rightarrow B}$
text text text

\end{document}
Anyway, to have extensible arrows, harpoons, hookarrows and sophisticated boxing you can use the packages in the mh bundle. To be able to use color, use the xcolor package; and use the fancybox package for ornamental boxes.

Edit: I added the links to the packages.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply