[Tex/LaTex] How to typeset Triforce

funlogossymbols

What would be the best practice approach to typeset the Triforce symbol known from the Nintendo® Zelda™ series?

Best Answer

Here is a nice shaded TikZ version which you can draw in variable sizes.

You have to call the \triforce macro with one parameter, which is the width of the Triforce, e.g. \triforce{10cm}.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[svgnames]{xcolor}

\usepackage{tikz}
\usetikzlibrary{shadings, calc}

\colorlet{triforcefilloutercolor}{Gold!50!Yellow}
\colorlet{triforcefillinnercolor}{white!80!triforcefilloutercolor}
\colorlet{triforceoutlineinnercolor}{white}
\colorlet{triforceoutlineoutercolor}{Goldenrod}

\tikzset{%
    triforcefillshade/.style={%
        inner color=triforcefillinnercolor,%
        outer color=triforcefilloutercolor%
    },%
    triforceoutlineshade/.style={%
        inner color=triforceoutlineinnercolor,%
        outer color=triforceoutlineoutercolor%
    }%
}

\newcommand{\triforce}[1]{%
    \begin{tikzpicture}%
        \newdimen\triforcewidth%
        \newdimen\triforceheight%
        \triforcewidth=#1%
        \pgfmathparse{sqrt(3)}%
        \pgfmathsetlength{\triforceheight}{\pgfmathresult / 2 * \triforcewidth}%
        %
        \foreach \x / \y in {0 / 0, 0.5\triforcewidth / 0, 0.25\triforcewidth / 0.5\triforceheight}%
        {%
            \shade[triforcefillshade, xshift=\x, yshift=\y]%
                (0, 0)  -- +(.5\triforcewidth, 0) -- +(60:.5\triforcewidth) -- cycle;%
            \shade[triforceoutlineshade, xshift=\x, yshift=\y]%
                (0, 0)  -- +(.5\triforcewidth, 0) -- +(60:.5\triforcewidth) -- cycle%
                (30:.0175\triforcewidth) -- ($(60:.5\triforcewidth) + (-90:.0175\triforcewidth)$) -- ($(0.5\triforcewidth, 0) + (150:.0175\triforcewidth)$) -- cycle;%
        }%
    \end{tikzpicture}%
}

\begin{document}
\triforce{10cm}
\end{document}
Related Question