I was looking for a way to beautifully display UML stereotype titles including angle brackets like you can see here:

I like

What I came up with is $\mathtt{\ll metaclass\gg}$, however, as you can see here

don't like

the brackets are too pointy (I hope you know what I mean) and the spacing between brackets and expression is too big.

Short version: Does anyone know a command for according brackets?

  • Choose a different font? – meagar Feb 27 '12 at 22:15

Use the T1 font encoding to access \guillemotleft and \guillemotright:

enter image description here

\usepackage[T1]{fontenc}% http://ctan.org/pkg/fontenc
$\ll$~\texttt{metaclass}~$\gg$ \par
\guillemotleft~\texttt{metaclass}~\guillemotright \par
\guillemotleft$\;$\texttt{metaclass}$\;$\guillemotright \par
\guillemotleft\,\texttt{metaclass}\,\guillemotright \par

The above sequence lists some spacing options: ~, $\;$, \, and {} (none).

  • If you should get a pixelated font in your output when using \usepackage[T1]{fontenc}, have a look at tex.stackexchange.com/questions/1291/…. – doncherry Feb 28 '12 at 1:25
  • 2
    As ekk said the spacing between brackets and expression is to big, I'd remove the spaces altogether or suggest using \,. – doncherry Feb 28 '12 at 1:27
  • Brilliant, exactly what I was looking for. Thank you very much! – ekk Feb 28 '12 at 11:09
  • 3
    Why not listing also the possibity of doing \texttt{<<metaclass>>}? Notice that with T1-encoded fonts the combinations << and >> produce the guillemets. – egreg Feb 28 '12 at 11:16

Here is a TikZ-based solution:


    \begin{tikzpicture}[scale=.20,line width=.15ex,join=round,cap=round]
      \draw ( 0,0) -- +(-.5,.5) -- +(0,1);
      \draw (.5,0) -- +(-.5,.5) -- +(0,1);
    \begin{tikzpicture}[scale=.20,line width=.15ex,join=round,cap=round]
      \draw ( 0,0) -- +(.5,.5) -- +(0,1);
      \draw (.5,0) -- +(.5,.5) -- +(0,1);

  • 3
    I don't think it is good to use TikZ to emulate guillemets. It's an unnecessary complexity, it does not match the font style and can't be searched for/copied in the PDF. – Andrey Vihrov Feb 28 '12 at 8:51
  • 2
    I think it looks better than guillemets, but maybe that's just me. – Todd Lehman Feb 28 '12 at 9:23

I have come up with three solutions:



% These two packages contain the symbols I hacked (a bit) to get the desired effect:


% Here the symbols are hacked (rotated and shifted as needed):




% This is the first solution: just switch to typewriter font:


% Here's the solution with MnSymbol:


% Here's the skak-based solution:



As you can see the symbols from MnSymbol work only in math mode, while the skak symbols are text mode.

And here are the three solutions lined up:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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