Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am currently trying to show the domain of variables in a simple equation:

\[\begin{matrix}
    x & \cdot & W_{1,2} & = & o\\
    \in & & \in & & \in\\
    \mdr^{1\times n} & & \mdr^{n \times m} & & \mdr^{1 \times m}
\end{matrix}\]

enter image description here

There are some more issues with this way to show the domain of variables, but this question is mainly about the rotated \in.

Failed tries

I've tried \usepackage{rotating}:

\[\begin{matrix}
    x & \cdot & W_{1,2} & = & o\\
    \text{\begin{rotate}{-90}$\in$\end{rotate}} & & \in & & \in\\
    \mdr^{1\times n} & & \mdr^{n \times m} & & \mdr^{1 \times m}
\end{matrix}
\]

The result looks like this:

enter image description here

share|improve this question
    
Related: tex.stackexchange.com/questions/51109/… –  egreg Jun 12 at 15:13
2  
You can \def\rin{\rotatebox[origin=c]{-90}{$\in$}} and use \rin instead of \in in your formula. Requires package graphicx –  JLDiaz Jun 12 at 15:18
    
Is this for a presentation with slides or for a paper? –  Bordaigorl Jun 12 at 15:27

3 Answers 3

up vote 13 down vote accepted

The result is really ugly:

\documentclass{article}
\usepackage{graphicx,amssymb}
\newcommand{\vin}{\rotatebox[origin=c]{-90}{$\in$}}
\begin{document}
\[
\begin{array}{@{}c@{\;}c@{\;}c@{\;}c@{\;}c@{}}
x & \cdot & W_{1,2} & = & o \\
\vin && \vin && \vin \\
\mathbb{R}^{1\times n} && \mathbb{R}^{n\times m} && \mathbb{R}^{1\times m}
\end{array}
\]
\end{document}

enter image description here

I'd simply avoid such visual description in print; I often use something like that on the blackboard, but it's a completely different situation. I'd prefer something like

\[
x\cdot W_{1,2} = o
\]
where $x\in\mathbb{R}^{1\times n}$ and $W_{1,2}\in\mathbb{R}^{n\times m}$.

in a printed document.

share|improve this answer

You could try the \usepackage{rotating} package and use the \begin{rotate}{30}...\end{rotate} environment.

Untested - I have to the possibility right now.

Or use the approach described in Rotated $\ltimes$ symbol (\rotatebox command from the graphicx package).

share|improve this answer
    
I've tried it and it looks ugly (see updated question) –  moose Jun 12 at 15:21
    
rotating is not the best approach. –  egreg Jun 12 at 15:22

Here's an idea for annotating an equation without affecting the spacing and with a clean way of rotating the \in:

\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}

\def\mdr{\mathbb{R}}

\tikzset{m/.style={inner sep=0, outer sep=0,remember picture}}
\begin{document}
\noindent
      $x_0\cdot A^n = o$
      \\[1em]
      $\tikz[m] \node (x) {$x_0$};\cdot \tikz[m] (a) \node {$A^n$}; = \tikz[m] \node (w) {$o$};$
      \begin{tikzpicture}[remember picture,overlay, node distance=.5]
        \node[shape=circle, draw=blue,minimum size=1.5em] (xc) at (x) {};
        \node[below=of x] (xd) {$\mdr^{1\times n}$};
        \path (xc) -- node[sloped] {$\in$} (xd);
      \end{tikzpicture}
\end{document}

preview

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.