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.

I'm using this code to draw curly brackets

\documentclass[]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{fit,calc,positioning,decorations.pathreplacing,matrix}
\begin{document}   
\begin{tikzpicture}[decoration={brace}][scale=2] 
   \node [draw] (A) {A}; 
   \node [fit=(A)] (fit) {};              
  \draw [decorate,line width=1pt] (fit.south west) -- (fit.north west);
\end{tikzpicture}

\end{document} 

How can I make this brace span the entire height of the "A" character ?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

You can apply a convenient shift to the coordinates used for the brace:

\documentclass[]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{fit,calc,positioning,decorations.pathreplacing,matrix}

\begin{document}   

\begin{tikzpicture}[decoration={brace}][scale=2] 
\node [draw] (A) {A}; 
\node [fit=(A)] (fit) {};              
\draw [decorate,line width=1pt] 
  ([yshift=-5pt]fit.south west) -- ([yshift=5pt]fit.north west);
\end{tikzpicture}

\end{document} 

enter image description here

Your settings for scale=2 won't have any effect since you are using a second optional argument which is not a correct syntax; tikzpicture only admits one optional argument:

\begin{tikzpicture}[<options>]
...
\end{tikzpicture}

where <options> is a comma separated list of options.

It is not clear to me why are you using the fit node; you can use something like this, without this node:

\documentclass[]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{fit,calc,positioning,decorations.pathreplacing,matrix}

\begin{document}   

\begin{tikzpicture}
\node [draw] (A) {A}; 
\draw[decoration={brace,raise=5pt},decorate,line width=1pt] 
  ([yshift=-5pt]A.south west) -- ([yshift=5pt]A.north west);
\end{tikzpicture}

\end{document} 

Also, notice that the option scale=2 is not having effect (you would need to add transform shape).

share|improve this answer

With simple LaTeX code:

\documentclass{scrartcl}
\begin{document}   

$ \left\{ \rule{0pt}{5mm}\fbox{A} \right. $
$ \left\{ \rule{0pt}{15mm}\fbox{A} \right. $
$ \left\{ \rule{0pt}{20mm}\fbox{A} \right. $

\end{document} 

enter image description here

share|improve this answer

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.