10

I know how to obtain a brace-decoration using TikZ. However, it has a style that does not match the braces in math-mode: while the latter comprise thicker and thinner line segments, the former is an evenly thick line.

Is it possible to obtain brace-decorations in TikZ that match the default CM braces?

Edit: the following shows the difference between the latex-brace and the TikZ-brace:LaTeX- and TikZ-curly brace

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
$\left\{
    \begin{tikzpicture}[baseline={(0,0)}]
        \draw[decoration={brace}, decorate] (0,-1) node {} -- (0,1);
    \end{tikzpicture}
    \right.$
\end{document}
  • @CarLaTeX sure, here you are – Bubaya Jun 1 '17 at 17:03
  • 1
    I have been wanting (and forgetting) to ask this question for more that a year ! Well done ;) and thank you ! – marsupilam Jun 1 '17 at 17:18
13

The calligraphic brace from the calligraphy TikZ library was designed for just this reason.

\documentclass{article}
%\url{https://tex.stackexchange.com/q/372776/86}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}
$\left\{
    \begin{tikzpicture}[baseline={(0,0)}]
        \draw[decoration={brace}, decorate] (0,-1) node {} -- (0,1);
        \draw[decoration={calligraphic brace,amplitude=5pt}, decorate, line width=1.25pt] (.2,-1) node {} -- (.2,1);
    \end{tikzpicture}
    \right.$
\end{document}

Produces:

Calligraphic braces

(On some pdf viewers, the ends of the brace look a bit fuzzy but they should print crisply.)

  • Thank you! Did you estimate the values for amplitude and line width, or are they somehow related to the normal brace? – Bubaya Jun 1 '17 at 19:50
  • @Bubaya I did it by eye, so if you have the time an inclination you may find better "magic numbers". If you do, feel free to edit them in to my answer. – Loop Space Jun 1 '17 at 20:49
  • @LoopSpace, instead of node{} -- shouldn't it be -- node{}? See, e.g. tex.stackexchange.com/questions/301888/… – Viesturs Dec 18 '17 at 13:47
  • 1
    @Viesturs The node{} parts actually have nothing to do with this question. They're only in my answer because they were in the question. Moreover, they are empty nodes so only affect the spacing. However, node{} -- and -- node{} place nodes at two different positions so which is correct depends on where you want the node. – Loop Space Dec 18 '17 at 15:57

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.