In a previous post entitled "Symbols for Outer Joins" a solution was given to produce outer join symbols.
However, this solution generates an error when, e.g., $R \leftouterjoin S$
is used in a caption.
Any solution for this ?
\documentclass[a4paper,10pt]{article}
\usepackage{latexsym}
% Definition of outer joins
\def\ojoin{\setbox0=\hbox{$\Join$}
\rule[0.10ex]{.3em}{.4pt}\llap{\rule[1.40ex]{.3em}{.4pt}}}
\def\leftouterjoin{\mathrel{\ojoin\mkern-6.5mu\Join}}
\def\rightouterjoin{\mathrel{\Join\mkern-6.5mu\ojoin}}
\def\fullouterjoin{\mathrel{\ojoin\mkern-6.5mu\Join\mkern-6.5mu\ojoin}}
\begin{document}
The outer join symbols work great in text: $R\rightouterjoin S$, $R\leftouterjoin S$, $R\fullouterjoin S$.
However, it generates the error \verb+Argument of \@caption has an extra }.+ when used in captions.
\begin{figure}
\centering
This a figure
\caption{$R\rightouterjoin S$}
\end{figure}
\end{document}
\protect
just before that command.\protect\rightouterjoin
. the\protect
must be immediately before the command (and it's always a command) that is causing the trouble. or you could define the command as "robust"; check this forum for how to do that.