6

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

4
  • 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}.
    – user31729
    Aug 28, 2014 at 15:34
  • \stackunder{}{} from stackengine could be a solution, replacing \blacktriangle with \blacktriangleup
    – user31729
    Aug 28, 2014 at 15:39
  • There are many possibilities. One is $\substack{\blacktriangle \\ \blacktriangledown}$ from the amsmath package.
    – Scz
    Aug 28, 2014 at 15:41
  • @ChristianHupfer Oh, sorry. Will add a MWE for the next question. Thanks anyways!! Aug 28, 2014 at 16:06

3 Answers 3

9

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

8

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.

6

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .