Guy Rutenberg

Keeping track of what I do

Equality-at and Relation-at LaTeX Macros.

without comments

These are two useful LaTeX macros for creating equality-at and (the more general) relation-at signs. These macros depend on the mathtools package. As with all other macros you should add them to you preamble in order to use.

The general macro is the \relat. It takes two arguments, the relation and an expression where the relation takes place (the “at”). The equality-at macro, \eqat is a specific case of \relat. I’ve created it because it is commonly used and only requires passing the “at” argument.

Here is the LaTeX code for the macros.

\newcommand{\relat}[2]{\mathrel{\bigg|_{\mathrlap{#2}}\mathrlap{#1}\hphantom{{}_{#2}}}}
\newcommand{\eqat}[1]{\mathrel{\bigg|_{\mathrlap{#1}}\mathrlap{=}\hphantom{{}_{#1}}}}

This is a basic example of how to use the macros. It should also give you an idea how they look.

documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}
 
\newcommand{\relat}[2]{\mathrel{\bigg|_{\mathrlap{#2}}\mathrlap{#1}\hphantom{{}_{#2}}}}
\newcommand{\eqat}[1]{\mathrel{\bigg|_{\mathrlap{#1}}\mathrlap{=}\hphantom{{}_{#1}}}}
 
\begin{document}
 
\[
\Delta=\left[\begin{array}{cc} P & Q\\ f' & g'\end{array}\right]
\eqat{\Gamma}
\left[\begin{array}{cc} -2t & 4t\\ 1 & -2\end{array}\right]
\]
\[
\cos x \relat{\leq}{x=\frac{\pi}{3}} \frac{\sqrt{@}}{2}
\]
 
\end{document}

And the output for the example is

Share and Enjoy:
  • del.icio.us
  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google Bookmarks
  • Simpy

Written by Guy

April 19th, 2008 at 8:36 am

Posted in LaTeX

Tagged with

Leave a Reply