1

I'm a beginner at latex and I've been reading everything I found about curl braces. I managed to positioned it where I wanted it but now my curly brace appears as a straight line. When I write the code in a new different file with just this diagram, the curly brace shows, only in another position. what can I do to fix it? Thanks!!

 \documentclass{beamer}
 \usetheme{Frankfurt}
 \setbeamercovered{transparent}
 \usepackage{pgf,tikz}
 \usetikzlibrary{positioning, arrows, automata}

 \begin{document}
    \scalebox{1.1}
    {
    \begin{tikzpicture}
    [node distance= 1cm,auto,
    every node/.style={text=white,rounded corners=0.05cm},
    grande/.style={rectangle,  fill=green!60!blue, font=\large, minimum width= 7cm, minimum height=0.8cm},
    peque/.style={rectangle, fill=green!30!black, font=\large, minimum width=3.5cm, minimum height= 0.4cm}]

    \node[grande, xshift=1.5cm]  (oracion){Oración};
    \node[grande, below of=oracion] (evento) {Evento};
    \node[grande, below of=evento] (EPA) {EPA};

    \node[peque, below of= EPA, anchor=east, minimum width=3.5cm](syntax){Sintaxis};
    \node[peque, right=0.03cm of syntax,minimum width=3.5cm](semantics){Semántica};
    \node[peque, below of=syntax, yshift=0.4cm](funciones){\scriptsize F. sintácticas};
    \node[peque, right=0.03cm of funciones, minimum width=1.73cm, yshift=0cm](roles){\tiny R. temáticos};
    \node[peque, right=0.03cm of roles, minimum width=1.73cm](rasgos){\tiny R. semánticos};

    \draw [decorate,decoration={brace,amplitude=10pt},xshift=-0.5cm,yshift=-5cm] (-2,1.0) -- (-2,2.5) node [black,midway,xshift=-0.6cm, yshift=0cm]  {\footnotesize Diátesis};

    \end{tikzpicture}}
\end{document}
  • 2
    Welcome to the TeX.SE. Please, can you edit your code and can you add the \documentclass used? Thank you. – Sebastiano Apr 4 at 15:54
  • 1
    @Sebastiano Judging from the second line of the code, I think the OP is using beamer. – user156344 Apr 4 at 16:00
  • @JouleV I agree with you. I thinked that beamer could to contain also any options with the brackets []. – Sebastiano Apr 4 at 16:05
  • @JouleV Exactly , it is a beamer presentation. Sorry about that guys! I'll edit now – rociorm Apr 4 at 18:42
2

You need to load decorations.pathreplacing library to use the decoration.

\documentclass{beamer}
\usetheme{Frankfurt}
 \setbeamercovered{transparent}
 \usepackage{pgf,tikz}
 \usetikzlibrary{positioning, arrows, automata, decorations.pathreplacing}

 \begin{document}
    \scalebox{1.1}
    {
    \begin{tikzpicture}
    [node distance= 1cm,auto,
    every node/.style={text=white,rounded corners=0.05cm},
    grande/.style={rectangle,  fill=green!60!blue, font=\large, minimum width= 7cm, minimum height=0.8cm},
    peque/.style={rectangle, fill=green!30!black, font=\large, minimum width=3.5cm, minimum height= 0.4cm}]

    \node[grande, xshift=1.5cm]  (oracion){Oración};
    \node[grande, below of=oracion] (evento) {Evento};
    \node[grande, below of=evento] (EPA) {EPA};

    \node[peque, below of= EPA, anchor=east, minimum width=3.5cm](syntax){Sintaxis};
    \node[peque, right=0.03cm of syntax,minimum width=3.5cm](semantics){Semántica};
    \node[peque, below of=syntax, yshift=0.4cm](funciones){\scriptsize F. sintácticas};
    \node[peque, right=0.03cm of funciones, minimum width=1.73cm, yshift=0cm](roles){\tiny R. temáticos};
    \node[peque, right=0.03cm of roles, minimum width=1.73cm](rasgos){\tiny R. semánticos};

    \draw [decorate,decoration={brace,amplitude=10pt},xshift=-0.5cm,yshift=-5cm] (-2,1.0) -- (-2,2.5) node [black,midway,xshift=-0.6cm, yshift=0cm]  {\footnotesize Diátesis};

    \end{tikzpicture}}
\end{document}

enter image description here

1

off-topic (sine your main problem is solved by @JouleV answer), but it can be helpful:

  • image is enclosed in frame environment (since you use beamer document class
  • for positioning of nodes is used syntax from the positioning packages
  • used are only relative coordinates,
  • nodes are in two chains
  • in nodes are used only two different font sizes and their definition is moved inside nodes styles
  • for brace is used calligraphic brace defined in the package calligraphy

    \documentclass{beamer}
    \usetheme{Frankfurt}
    \setbeamercovered{transparent}
    \usepackage{tikz}
    \usetikzlibrary{arrows, automata,
                    calc, chains,
                    decorations.pathreplacing,
                    calligraphy,
                    positioning}
    
    \begin{document}
    \begin{frame}[fragile]
    \frametitle{My image}
        \begin{tikzpicture}[
         node distance = 2mm and 1mm,
           start chain = A going right,
           start chain = B going above,
           base/.style = {rounded corners=0.5mm, text=white},
         grande/.style = {base, fill=green!60!blue, font=\large,
                          minimum width=87mm, minimum height=8mm,
                          on chain=B},
     peque/.style args = {#1/#2}{base, fill=green!30!black,
                                 minimum width=#1, minimum height= 5mm,
                                 font=#2,
                                 on chain=A},
             BC/.style = {decorate,
                decoration={calligraphic brace, amplitude=5pt,
                pre =moveto, pre  length=1pt,
                post=moveto, post length=1pt,
                raise=5pt}, % for mirroring of brace
                very thick,
                pen colour=black},
                           ]
    \node[peque=43mm/\scriptsize]   (funciones) {F. sintácticas};
    \node[peque=21mm/\scriptsize]               {R. temáticos};
    \node[peque=21mm/\scriptsize]               {R. semánticos};
    \node[peque=43mm/\large,
          above=of funciones]       (syntax)    {Sintaxis};
    \node[peque=43mm/\large]        (semantics) {Semántica};
    \node[grande,
          above=of $(syntax.north)!0.5!(semantics.north)$]  {EPA};
    \node[grande]   {Evento};
    \node[grande]   {Oración};
    %
    \draw[BC]   (funciones.south west) --
              node[left=9pt,font=\footnotesize] {Diátesis}
                (syntax.north west);
        \end{tikzpicture}
    \end{frame}
    

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.