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 need to combine \blacktriangle and \blacktriangledown so that I get the following result: Up Down Arrow

I already tried $\stackrel{\blacktriangle}{\blacktriangledown}$ but then the triangle pointing up is bigger than the one pointing down.

The combined symbols should have the same line height as my text, because I need a list like this (here the triangles are a little bit too big)

Up Down Arrow XXX
Up Down Arrow XXX
Up Down Arrow XXX

share|improve this question
    
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Christian Hupfer Aug 28 at 15:34
    
\stackunder{}{} from stackengine could be a solution, replacing \blacktriangle with \blacktriangleup –  Christian Hupfer Aug 28 at 15:39
    
There are many possibilities. One is $\substack{\blacktriangle \\ \blacktriangledown}$ from the amsmath package. –  Scz Aug 28 at 15:41
    
@ChristianHupfer Oh, sorry. Will add a MWE for the next question. Thanks anyways!! –  SailAvid Aug 28 at 16:06

3 Answers 3

up vote 8 down vote accepted

The following examples stacks the symbols and scales them to fit the line height:

\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{calc}

\newcommand*{\textdoubletriangle}{%
  \resizebox{!}{\heightof{X}}{%
    \vbox{%
      \hbox{$\blacktriangle$}%
      \nointerlineskip
      \kern.75ex
      \hbox{$\blacktriangledown$}%
    }%
  }%
}

\begin{document}
\textdoubletriangle XXX
\end{document}

Result

share|improve this answer

You were actually quite close with the idea

\stackrel{\blacktriangle}{\blacktriangledown}

To overcome the problem of the upper symbol being smaller than the lower one, all one needs to do is to insert \textstyle at the beginning of the first argument of \stackrel. To center the resulting symbol vertically on the math axis, you could place the instructions in a \vcenter{\hbox{$ ... $}} wrapper:

\newcommand\bigblacktriangleupdown{%
    \vcenter{\hbox{$\stackrel{\textstyle\blacktriangle}{\blacktriangledown}$}}}

Medium and small versions of the same construct could be defined via

\newcommand\mediumblacktriangleupdown{%
    \vcenter{\hbox{$\stackrel{\blacktriangle}{\scriptstyle\blacktriangledown}$}}}

\newcommand\smallblacktriangleupdown{%
    \vcenter{\hbox{$\stackrel{\scriptscriptstyle\blacktriangle}{%
                              \scriptscriptstyle\blacktriangledown}$}}}

This is what the three symbols look like:

enter image description here

\documentclass{article}
\usepackage{amssymb}

\newcommand\bigblacktriangleupdown{%
    \vcenter{\hbox{$\stackrel{\textstyle\blacktriangle}{\blacktriangledown}$}}}

\newcommand\mediumblacktriangleupdown{%
    \vcenter{\hbox{$\stackrel{\blacktriangle}{\scriptstyle\blacktriangledown}$}}}

\newcommand\smallblacktriangleupdown{%
    \vcenter{\hbox{$\stackrel{\scriptscriptstyle\blacktriangle}{\scriptscriptstyle\blacktriangledown}$}}}

\begin{document}
$\bigblacktriangleupdown$ XXXX

$\mediumblacktriangleupdown$ XXXX

$\smallblacktriangleupdown$ XXXX
\end{document}

If you don't want these symbols centered vertically on the math axis and, instead, want their lower tips to "rest" on the baseline, just leave off the \vcenter{\hbox{$ ... $}} wrappers.

share|improve this answer

Here is an alternative using the stackengine package.

enter image description here

\documentclass[letterpaper]{article}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{stackengine}
\usepackage{calc}

\newcommand{\updowntriangle}{%
    \resizebox{!}{\heightof{X}}{%
    \stackMath\Shortstack[c]{%
        {\blacktriangle}
        \blacktriangledown}%
    }%
}
\begin{document}
\updowntriangle XXXX
\end{document}
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.