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.

Over at academia.sx we are trying to create a community ad to try and get us promoted out of beta. We are looking to create a university type coat of arms/seal. I have seen some really great artwork on tex.sx, so I thought I would ask ...

share|improve this question
2  
Can you give us a target to aim at? This would seem to divide into two parts: a design part and an implementation part. The design would be best done by someone knowledgeable of your site. The design wouldn't have to be complete: maybe you could indicate the heraldic parts you'd like to know how to do. –  Loop Space Oct 26 '12 at 9:36
    
Presumably instead of LaTeX, you want to ask about either TikZ or asymptote or psTricks? Wouldn't it be easier to just do this in Adobe Illustrator? –  Willie Wong Oct 26 '12 at 10:34
    
@WillieWong since I want it to be compilable with latex or xetex, but don't care if the answer uses TikZ or psTricks (which I am guessing they will), I thought LaTeX was a reasonable description. As to whether it is easier in Illustrator, it might be, but I wanted to see what could be done in LaTeX. –  StrongBad Oct 26 '12 at 10:48
    
@AndrewStacey good point, I will have a think about the design. –  StrongBad Oct 26 '12 at 10:49
add comment

2 Answers 2

up vote 34 down vote accepted

Disclaimer

This should be considered as a start of an answer.


Actually this could be seen an answer to the title of the question, Draw a coat of arms in LaTeX, rather than an answer to what is really asked in the question: university type coat of arms/seal. Indeed, when I saw the title I thought that with TikZ should be possible to provide a way to draw heraldic shields; perhaps not those ones very complicated, but at least the simpler ones.

The reference took is: http://simple.wikipedia.org/wiki/Heraldry; notice that in heraldry colors should be respect rules (and execptions) as per http://en.wikipedia.org/wiki/Rule_of_tincture, but for the moment I did not considered them.

Technically speaking, this is the first time I created a custom pgf shape, thus the reference shape could (I'd say must) be improved. Another thing to be improved is how the cross lines join the border of the shield.

The code:

% version 1/12/2012 with clipping

\documentclass[svgnames]{article}
\usepackage{tikz}
\usetikzlibrary{calc, backgrounds}

\makeatletter    

\pgfkeys{/tikz/.cd,
  corner radius/.initial=1.5075cm,
  height shield/.initial=2.25cm,
  minimum width=3cm,
  minimum height=1.5cm,
}


\pgfdeclareshape{heraldic shield}{% taken and modified from page 631 of the manual
  \inheritsavedanchors[from=rectangle] %  this is nearly a rectangle
  \inheritanchorborder[from=rectangle]
  \inheritanchor[from=rectangle]{center}
  \inheritanchor[from=rectangle]{north}
  \inheritanchor[from=rectangle]{north west}
  \inheritanchor[from=rectangle]{north east}
  \inheritanchor[from=rectangle]{south}
  \inheritanchor[from=rectangle]{south west}
  \inheritanchor[from=rectangle]{south east}
  \inheritanchor[from=rectangle]{west}
  \inheritanchor[from=rectangle]{east}

   \savedmacro\cornerradius{%
    \edef\cornerradius{\pgfkeysvalueof{/tikz/corner radius}}%
  }

   \savedmacro\heightshield{%
    \edef\heightshield{\pgfkeysvalueof{/tikz/height shield}}%
  }

  \savedmacro\posarc{%
    \edef\posarc{1.75cm*\heightshield}%
  }

  \backgroundpath{%  this is new
    %  store lower right in xa/ya and upper right in xb/yb
    \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
    \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
    %  construct main path
    \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
    \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
    \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}
    \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
     \pgfpatharc{360}{270}{\cornerradius}%
     \pgfpatharc{270}{180}{\cornerradius}%
     \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@ya}}
    \pgfpathclose
 }

  \savedanchor{\bottom}{
    \pgf@y=-\heightshield%
    \pgf@x=0cm %
    }

    \savedanchor{\arcleft}{
    \pgf@y=-\posarc%
    \pgf@x=0.9cm %
    }
    \savedanchor{\arcright}{
    \pgf@y=-\posarc%
    \pgf@x=-0.9cm %
    }
 \anchor{bottom}{\bottom}
 \anchor{arc left}{\arcleft}
 \anchor{arc right}{\arcright}
}
\makeatother


\tikzset{pale/.style={
        heraldic shield,    
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb] \node [heraldic shield]{};
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \draw[#1, line width=15pt,line cap=rect](\tikzlastnode.north)--(\tikzlastnode.bottom);
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }    
    },
    fess/.style={
        heraldic shield,
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb] \node [heraldic shield]{};
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \draw[#1, line width=15pt](\tikzlastnode.south west)--(\tikzlastnode.south east);
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }
    }   
}

\tikzset{bend/.style={
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb]  \node  [heraldic shield]{};
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \draw[#1, line width=10pt,line cap=rect](\tikzlastnode.north west)--(\tikzlastnode.arc left);
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}              
             }
        }    
    },
    bend right/.style={
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb]  \node  [heraldic shield]{}; 
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \draw[#1, line width=10pt,line cap=rect](\tikzlastnode.north east)--(\tikzlastnode.arc right);
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }    
    },
}
\tikzset{chief/.style={
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb]  \node  [heraldic shield]{}; 
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \fill[#1](\tikzlastnode.west)--(\tikzlastnode.north west)--(\tikzlastnode.north east)--(\tikzlastnode.east)--cycle;
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }    
    },
    cross/.style={
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb]  \node  [heraldic shield]{}; 
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}             
                \draw[#1, line width=15pt,line cap=rect](\tikzlastnode.north)--(\tikzlastnode.bottom);
                \draw[#1, line width=15pt,line cap=rect](\tikzlastnode.south west)--(\tikzlastnode.south east);
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }    
    },
    pile/.style={
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb]  \node  [heraldic shield]{}; 
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \filldraw[#1,line cap=rect]($(\tikzlastnode.north west)!0.5!(\tikzlastnode.north)$)--($(\tikzlastnode.north east)!0.5!(\tikzlastnode.north)$)--(\tikzlastnode.bottom)--cycle;
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }    
    },
}
\tikzset{party per fess/.style args={superior color #1 and inferior color #2}{
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb]  \node  [heraldic shield]{}; 
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \fill[#1](\tikzlastnode.west)--(\tikzlastnode.north west)--(\tikzlastnode.north east)--(\tikzlastnode.east)--cycle;
                \fill[#2]($(\tikzlastnode.south west)!0.5!(\tikzlastnode.west)$)-- (\tikzlastnode.south west)arc(180:270:\pgfkeysvalueof{/tikz/corner radius}) arc(270:360:\pgfkeysvalueof{/tikz/corner radius})--(\tikzlastnode.south east) --($(\tikzlastnode.south east)!0.5!(\tikzlastnode.east)$) --cycle;
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }    
    },
    party per pale/.style args={left color #1 and right color #2}{
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \begin{scope}
                    [local bounding box=bb]  \node  [heraldic shield]{}; 
                \end{scope}
                \begin{pgfonlayer}{background}
                \pgfnode{heraldic shield}{center}{}{nodename}{\pgfusepath{stroke,clip}}
                \fill[#1] (\tikzlastnode.north)--(\tikzlastnode.north west)--(\tikzlastnode.south west)arc(180:270:\pgfkeysvalueof{/tikz/corner radius})--cycle;
                \fill[#2] (\tikzlastnode.north)--(\tikzlastnode.north east)--(\tikzlastnode.south east)arc(360:270:\pgfkeysvalueof{/tikz/corner radius})--cycle;
                \end{pgfonlayer}
                \pgfresetboundingbox
                \useasboundingbox (bb.south west) rectangle  (bb.north east);
                \end{pgfinterruptpath}
             }
        }    
    },
}   

\newcommand{\army}[2]{
\tikz[baseline=-0.5ex,remember picture]\node[#1=#2] (x) {};
\tikz[baseline=-0.5ex,remember picture,overlay]\node[font=\Large,yshift=0.5cm] at (x.north){#1};
\hspace{1cm}
}

\begin{document}
\noindent
\army{fess}{red}
\army{pale}{blue}
\army{bend}{Purple}\\[7ex]
\army{bend right}{red}
\army{chief}{Green}
\army{cross}{Gold}\\[7ex]
\army{pile}{Silver}
\army{party per fess}{superior color white and inferior color blue}
\army{party per pale}{left color Silver and right color Green}
\end{document}

The result:

enter image description here


An example with the famous duck by Paulo:

\documentclass[svgnames]{article}
\usepackage{tikz}
\usetikzlibrary{calc, backgrounds}
\input{pc-duck} 
% tikz and colors of the duck from
% http://tex.stackexchange.com/questions/63732/cute-document-in-latex/63759#63759
\makeatletter    

\pgfkeys{/tikz/.cd,
  corner radius/.initial=1.5075cm,
  height shield/.initial=2.25cm,
  minimum width=3cm,
  minimum height=1.5cm,
}


\pgfdeclareshape{heraldic shield}{% taken and modified from page 631 of the manual
  \inheritsavedanchors[from=rectangle] %  this is nearly a rectangle
  \inheritanchorborder[from=rectangle]
  \inheritanchor[from=rectangle]{center}
  \inheritanchor[from=rectangle]{north}
  \inheritanchor[from=rectangle]{north west}
  \inheritanchor[from=rectangle]{north east}
  \inheritanchor[from=rectangle]{south}
  \inheritanchor[from=rectangle]{south west}
  \inheritanchor[from=rectangle]{south east}
  \inheritanchor[from=rectangle]{west}
  \inheritanchor[from=rectangle]{east}

   \savedmacro\cornerradius{%
    \edef\cornerradius{\pgfkeysvalueof{/tikz/corner radius}}%
  }

   \savedmacro\heightshield{%
    \edef\heightshield{\pgfkeysvalueof{/tikz/height shield}}%
  }

  \savedmacro\posarc{%
    \edef\posarc{1.75cm*\heightshield}%
  }


  %  ... and possibly more
  \backgroundpath{%  this is new
    %  store lower right in xa/ya and upper right in xb/yb
    \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
    \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
    %  construct main path
    \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
    \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
    \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}
    \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
     \pgfpatharc{360}{270}{\cornerradius}%
     \pgfpatharc{270}{180}{\cornerradius}%
     \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@ya}}
    \pgfpathclose
 }

  \savedanchor{\bottom}{
    \pgf@y=-\heightshield%
    \pgf@x=0cm %
    }

    \savedanchor{\arcleft}{
    \pgf@y=-\posarc%
    \pgf@x=0.9cm %
    }
    \savedanchor{\arcright}{
    \pgf@y=-\posarc%
    \pgf@x=-0.9cm %
    }
 \anchor{bottom}{\bottom}
 \anchor{arc left}{\arcleft}
 \anchor{arc right}{\arcright}
}
\makeatother
\def\duckinarm{\resizebox{5.5em}{!}{\drawduck}}

\tikzset{party per fess with traversing duck/.style args={superior color #1 and inferior color #2}{
        heraldic shield,        
        draw=black,
        line width=0.4pt,
        append after command={
            \pgfextra{
                \begin{pgfinterruptpath}
                \node[above=5ex] at ([xshift=0.25em]\tikzlastnode.bottom) {\duckinarm};
                \begin{pgfonlayer}{background}
                \fill[#1](\tikzlastnode.west)--(\tikzlastnode.north west)--(\tikzlastnode.north east)--(\tikzlastnode.east)--cycle;
                \fill[#2]($(\tikzlastnode.south west)!0.5!(\tikzlastnode.west)$)-- (\tikzlastnode.south west)arc(180:270:\pgfkeysvalueof{/tikz/corner radius}) arc(270:360:\pgfkeysvalueof{/tikz/corner radius})--(\tikzlastnode.south east) --($(\tikzlastnode.south east)!0.5!(\tikzlastnode.east)$) --cycle;
                \end{pgfonlayer}
                \end{pgfinterruptpath}
             }
        }    
    }
}   

\newcommand{\army}[2]{
\tikz[baseline=-0.5ex]\node[#1=#2, label={[label distance=0.1cm,font=\Large]90:#1}] {};
}
\begin{document}
\army{party per fess with traversing duck}{superior color white and inferior color blue}
\end{document}

Result:

enter image description here

share|improve this answer
1  
Great answer, Claudio! :) –  Paulo Cereda Oct 27 '12 at 10:19
2  
@PauloCereda: thanks! I'll probably send you soon a duck-based arm... –  Claudio Fiandrino Oct 27 '12 at 15:25
    
@PauloCereda: and finally.. here it is! :) –  Claudio Fiandrino Oct 29 '12 at 10:56
    
OMG! Love it! <3 –  Paulo Cereda Oct 29 '12 at 12:55
    
Looks nice but the bend and bend right versions in the graphic aren't clipped correctly. It would be nice if you could fix this. –  Marc van Dongen Oct 29 '12 at 13:09
show 3 more comments

I though that I would make a contribution to this rather open question, although Claudio has already provided a great answer.

When making a coats of arms for yourself or your community (which I imaging that you do quite often ;-)), I think it's nice to add a ring or a banner on which you can write something (your name "Academia StackExchange", your motto "we're closing soon, but we would like to stay a little longer" or whatever). I apologize for the motto, I just though that it was funny ^_^.

Here is the code for shield + ring:

\documentclass{memoir}

\usepackage{fourier}
\usepackage[T1]{fontenc}

\usepackage{pgfplots}

\definecolor{paper}{RGB}{255,190,78} % A new color

\newcommand{\qmark}{\resizebox{50pt}{!}{\textcolor{yellow}?}} % Question mark

\begin{ducument}

\begin{tikzpicture}[x=1,y=1]
\filldraw[line width=2,fill=paper] (0,0) circle (76);  % Outer ring
\draw[line width=2,fill=white] (0,0) circle (60);  % Inner ring
\filldraw[line width=2pt,fill=red] (0,-60) .. controls (50,-40) .. (50,-20)     -- (50,50) -- % Shield
(-50,50) -- (-50,-20) .. controls (-50,-40) .. (0,-60) -- cycle;
\node at (0,0) {\qmark}; % Question mark
\end{tikzpicture}

\end{document}

What should be on the shield? Well I don't know. One could go for a duck and use Paolo's duck, but if we're talking academia.SE, then an owl would probably be a better bird. I tried to make an owl, but it turned out rather poorly (see below), and the code is very messy. Well, I'm a physicist not an artist, and it's not very often I draw owls in TikZ.

Code for the owl (it's not a moth):

\newcommand{\rfeather}{% Very bad macro
(40,24) .. controls (100,28) and (100,10) .. (74,10) .. controls (80,16) and (80,20) .. (40,24)}
\newcommand{\lfeather}{% Another very bad macro
(-40,24) .. controls (-100,28) and (-100,10) .. (-74,10) .. controls (-80,16) and (-80,20) .. (-40,24)}

\newcommand{\owl}{ %
\begin{tikzpicture}[x=1pt,y=1pt] %
\fill (0,50) .. controls (50,60) and (50,0) .. (0,-50) % Body
.. controls (-50,0) and (-50,60) .. (0,50) -- cycle; %
\draw[red,decorate,decoration=zigzag] (20,0) -- (-20,0); %
\draw[red,decorate,decoration=zigzag] (15,-10) -- (-15,-10); %
\draw[red,decorate,decoration=zigzag] (10,-20) -- (-10,-20); %
\draw[red,line width=2pt] (18,28) circle (5); % Eyes
\draw[red,line width=2pt] (-18,28) circle (5); %
\fill[red] (0,10) .. controls (12,25) and (-12,25) .. (0,10) -- cycle; %Beak
\draw[line width=2pt] (15,50) .. controls (20,58) .. (30,60) .. controls     (32,55) .. (30,40); % Ears
\filldraw[line width=2pt] (15,50) .. controls (20,58) .. (30,60) .. controls     (27,55) .. (25,40) -- cycle; %
\draw (27,40) .. controls (28,47) .. (29,50); %
\draw[line width=2pt] (-15,50) .. controls (-20,58) .. (-30,60) .. controls     (-32,55) .. (-30,40); %
\filldraw[line width=2pt] (-15,50) .. controls (-20,58) .. (-30,60) .. controls (-27,55) .. (-25,40) -- cycle; %
\draw (-27,40) .. controls (-28,47) .. (-29,50); %
\fill\rfeather; % Wings
\begin{scope}[xshift=-7,yshift=12] %
\fill[rotate=-20] \rfeather; %
\end{scope} %
\begin{scope}[xshift=-8,yshift=23] %
\fill[rotate=-40] \rfeather; %
\end{scope} %
\begin{scope}[xshift=-1,yshift=37] %
\fill[rotate=-65] \rfeather; %
\end{scope} %
\begin{scope}[xshift=12,yshift=43] %
\fill[rotate=-90] \rfeather; %
\end{scope} %
\fill\lfeather; %
\begin{scope}[xshift=7,yshift=12] %
\fill[rotate=20] \lfeather; %
\end{scope} %
\begin{scope}[xshift=8,yshift=23] %
\fill[rotate=40] \lfeather; %
\end{scope} %
\begin{scope}[xshift=1,yshift=37] %
\fill[rotate=65] \lfeather; %
\end{scope} %
\begin{scope}[xshift=-12,yshift=43] %
\fill[rotate=90] \lfeather; %
\end{scope} %
\end{tikzpicture} }

And finally the result:

It's a owl (not a moth)!

share|improve this answer
add comment

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.