Derivation tree not rendering The 2019 Stack Overflow Developer Survey Results Are In ...

How to pronounce 1ターン?

Semisimplicity of the category of coherent sheaves?

Sort list of array linked objects by keys and values

Can I visit the Trinity College (Cambridge) library and see some of their rare books

how can a perfect fourth interval be considered either consonant or dissonant?

Why not take a picture of a closer black hole?

Why did all the guest students take carriages to the Yule Ball?

Why can't devices on different VLANs, but on the same subnet, communicate?

University's motivation for having tenure-track positions

Python - Fishing Simulator

Chern class of a vector bundle and the associated projective space bundle

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

He got a vote 80% that of Emmanuel Macron’s

"... to apply for a visa" or "... and applied for a visa"?

Hopping to infinity along a string of digits

What's the point in a preamp?

Word for: a synonym with a positive connotation?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Why can't wing-mounted spoilers be used to steepen approaches?

Button changing its text & action. Good or terrible?

Does Parliament need to approve the new Brexit delay to 31 October 2019?

Take groceries in checked luggage

How to support a colleague who finds meetings extremely tiring?



Derivation tree not rendering



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Logic tree with tikz-tree — placing nodes on specific placesNumerical conditional within tikz keys?Align leaves of a treeTikZ/ERD: node (=Entity) label on the insideWhy do I get an extra white page before my TikZ picture?TikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of themLaTeX Error: environment tikzpicture undefined












1















I'm trying to draw a derivation tree for a simple grammar using tikz-qtree.



Here is my current code:



documentclass[11pt]{article}
usepackage{tikz}
usetikzlibrary{shapes,arrows,calc}
usepackage{tikz-qtree}

% ----------

begin{document}
begin{tikzpicture}
tikzset{grow'=right}
tikzset{every tree node/.style={anchor=base west}}
Tree [.$SS$ [.$(S)$ $()$]
[.$(S)$
[.$((S))$ $(())$]
]
]
end{tikzpicture}
end{document}


My intended result looks like this:



                -(S)------------()                
-/
-/
-/
-/
-/
SS -
-
-
-
-
-
-(S)---------((S))----------(())


When I compile the document, I get a bunch of missing end brace complaints "./main.tex:21: Missing } inserted", but the square brackets in the Tree are balanced as far as I can see.



What am I doing wrong?










share|improve this question



























    1















    I'm trying to draw a derivation tree for a simple grammar using tikz-qtree.



    Here is my current code:



    documentclass[11pt]{article}
    usepackage{tikz}
    usetikzlibrary{shapes,arrows,calc}
    usepackage{tikz-qtree}

    % ----------

    begin{document}
    begin{tikzpicture}
    tikzset{grow'=right}
    tikzset{every tree node/.style={anchor=base west}}
    Tree [.$SS$ [.$(S)$ $()$]
    [.$(S)$
    [.$((S))$ $(())$]
    ]
    ]
    end{tikzpicture}
    end{document}


    My intended result looks like this:



                    -(S)------------()                
    -/
    -/
    -/
    -/
    -/
    SS -
    -
    -
    -
    -
    -
    -(S)---------((S))----------(())


    When I compile the document, I get a bunch of missing end brace complaints "./main.tex:21: Missing } inserted", but the square brackets in the Tree are balanced as far as I can see.



    What am I doing wrong?










    share|improve this question

























      1












      1








      1








      I'm trying to draw a derivation tree for a simple grammar using tikz-qtree.



      Here is my current code:



      documentclass[11pt]{article}
      usepackage{tikz}
      usetikzlibrary{shapes,arrows,calc}
      usepackage{tikz-qtree}

      % ----------

      begin{document}
      begin{tikzpicture}
      tikzset{grow'=right}
      tikzset{every tree node/.style={anchor=base west}}
      Tree [.$SS$ [.$(S)$ $()$]
      [.$(S)$
      [.$((S))$ $(())$]
      ]
      ]
      end{tikzpicture}
      end{document}


      My intended result looks like this:



                      -(S)------------()                
      -/
      -/
      -/
      -/
      -/
      SS -
      -
      -
      -
      -
      -
      -(S)---------((S))----------(())


      When I compile the document, I get a bunch of missing end brace complaints "./main.tex:21: Missing } inserted", but the square brackets in the Tree are balanced as far as I can see.



      What am I doing wrong?










      share|improve this question














      I'm trying to draw a derivation tree for a simple grammar using tikz-qtree.



      Here is my current code:



      documentclass[11pt]{article}
      usepackage{tikz}
      usetikzlibrary{shapes,arrows,calc}
      usepackage{tikz-qtree}

      % ----------

      begin{document}
      begin{tikzpicture}
      tikzset{grow'=right}
      tikzset{every tree node/.style={anchor=base west}}
      Tree [.$SS$ [.$(S)$ $()$]
      [.$(S)$
      [.$((S))$ $(())$]
      ]
      ]
      end{tikzpicture}
      end{document}


      My intended result looks like this:



                      -(S)------------()                
      -/
      -/
      -/
      -/
      -/
      SS -
      -
      -
      -
      -
      -
      -(S)---------((S))----------(())


      When I compile the document, I get a bunch of missing end brace complaints "./main.tex:21: Missing } inserted", but the square brackets in the Tree are balanced as far as I can see.



      What am I doing wrong?







      tikz-pgf tikz-qtree






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      Adam WilliamsAdam Williams

      21816




      21816






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Here are three different ways to draw the graph




          tikz-qtree solution



          Take care of the white space!



          documentclass[11pt]{article}
          usepackage{tikz}
          usetikzlibrary{shapes,arrows,calc}
          usepackage{tikz-qtree}

          % ----------

          begin{document}
          begin{tikzpicture}
          tikzset{grow'=right}
          tikzset{every tree node/.style={anchor=base west}}
          Tree [.$SS$ [.$(S)$ $()$ ] [.$(S)$ [.$((S))$ $(())$ ] ] ]
          end{tikzpicture}
          end{document}


          enter image description here



          Pure TikZ solution



          documentclass[tikz]{standalone}
          usetikzlibrary{positioning}
          begin{document}
          begin{tikzpicture}[node distance=0.5cm]
          node (ss) {$SS$};
          node[above right=of ss] (sa) {$(S)$};
          node[right=of sa] (br1) {$()$};
          node[below right=of ss] (sb) {$(S)$};
          node[right=of sb] (ssb) {$((S))$};
          node[right=of ssb] (br2) {$(())$};
          draw (br1) -- (sa) -- (ss) -- (sb) -- (ssb) -- (br2);
          end{tikzpicture}
          end{document}


          enter image description here




          tikzcd solution



          documentclass{standalone}
          usepackage{tikz-cd}
          begin{document}
          begin{tikzcd}[every arrow/.append style={dash}]
          & (S) arrow[r] & ()\
          SS arrow[ru]arrow[rd] & &\
          & (S) arrow[r] & ((S)) arrow[r] & (())
          end{tikzcd}
          end{document}


          enter image description here






          share|improve this answer


























          • Can you point out the difference? What did I mess up?

            – Adam Williams
            51 mins ago








          • 1





            @AdamWilliams There are difference: my [.$(S)$ $()$ ] is working but your [.$(S)$ $()$] is not working (take note of the white space)

            – JouleV
            50 mins ago











          • Thanks @jouleV - I was close!

            – Adam Williams
            38 mins ago






          • 1





            @AdamWilliams You are welcome! Although you were so close, but only one white space is a great deal for this package :) Unfortunately, the error message is not really clear.

            – JouleV
            35 mins ago



















          1














          I'd like to persuade you to switch to forest.



          documentclass{article}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={grow=east}
          [$SS$
          [$(S)$ $()$]
          [$(S)$
          [$((S))$ $(())$]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer
























          • A tempting proposition - I do prefer forest's syntax!

            – Adam Williams
            53 mins ago












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f484679%2fderivation-tree-not-rendering%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Here are three different ways to draw the graph




          tikz-qtree solution



          Take care of the white space!



          documentclass[11pt]{article}
          usepackage{tikz}
          usetikzlibrary{shapes,arrows,calc}
          usepackage{tikz-qtree}

          % ----------

          begin{document}
          begin{tikzpicture}
          tikzset{grow'=right}
          tikzset{every tree node/.style={anchor=base west}}
          Tree [.$SS$ [.$(S)$ $()$ ] [.$(S)$ [.$((S))$ $(())$ ] ] ]
          end{tikzpicture}
          end{document}


          enter image description here



          Pure TikZ solution



          documentclass[tikz]{standalone}
          usetikzlibrary{positioning}
          begin{document}
          begin{tikzpicture}[node distance=0.5cm]
          node (ss) {$SS$};
          node[above right=of ss] (sa) {$(S)$};
          node[right=of sa] (br1) {$()$};
          node[below right=of ss] (sb) {$(S)$};
          node[right=of sb] (ssb) {$((S))$};
          node[right=of ssb] (br2) {$(())$};
          draw (br1) -- (sa) -- (ss) -- (sb) -- (ssb) -- (br2);
          end{tikzpicture}
          end{document}


          enter image description here




          tikzcd solution



          documentclass{standalone}
          usepackage{tikz-cd}
          begin{document}
          begin{tikzcd}[every arrow/.append style={dash}]
          & (S) arrow[r] & ()\
          SS arrow[ru]arrow[rd] & &\
          & (S) arrow[r] & ((S)) arrow[r] & (())
          end{tikzcd}
          end{document}


          enter image description here






          share|improve this answer


























          • Can you point out the difference? What did I mess up?

            – Adam Williams
            51 mins ago








          • 1





            @AdamWilliams There are difference: my [.$(S)$ $()$ ] is working but your [.$(S)$ $()$] is not working (take note of the white space)

            – JouleV
            50 mins ago











          • Thanks @jouleV - I was close!

            – Adam Williams
            38 mins ago






          • 1





            @AdamWilliams You are welcome! Although you were so close, but only one white space is a great deal for this package :) Unfortunately, the error message is not really clear.

            – JouleV
            35 mins ago
















          2














          Here are three different ways to draw the graph




          tikz-qtree solution



          Take care of the white space!



          documentclass[11pt]{article}
          usepackage{tikz}
          usetikzlibrary{shapes,arrows,calc}
          usepackage{tikz-qtree}

          % ----------

          begin{document}
          begin{tikzpicture}
          tikzset{grow'=right}
          tikzset{every tree node/.style={anchor=base west}}
          Tree [.$SS$ [.$(S)$ $()$ ] [.$(S)$ [.$((S))$ $(())$ ] ] ]
          end{tikzpicture}
          end{document}


          enter image description here



          Pure TikZ solution



          documentclass[tikz]{standalone}
          usetikzlibrary{positioning}
          begin{document}
          begin{tikzpicture}[node distance=0.5cm]
          node (ss) {$SS$};
          node[above right=of ss] (sa) {$(S)$};
          node[right=of sa] (br1) {$()$};
          node[below right=of ss] (sb) {$(S)$};
          node[right=of sb] (ssb) {$((S))$};
          node[right=of ssb] (br2) {$(())$};
          draw (br1) -- (sa) -- (ss) -- (sb) -- (ssb) -- (br2);
          end{tikzpicture}
          end{document}


          enter image description here




          tikzcd solution



          documentclass{standalone}
          usepackage{tikz-cd}
          begin{document}
          begin{tikzcd}[every arrow/.append style={dash}]
          & (S) arrow[r] & ()\
          SS arrow[ru]arrow[rd] & &\
          & (S) arrow[r] & ((S)) arrow[r] & (())
          end{tikzcd}
          end{document}


          enter image description here






          share|improve this answer


























          • Can you point out the difference? What did I mess up?

            – Adam Williams
            51 mins ago








          • 1





            @AdamWilliams There are difference: my [.$(S)$ $()$ ] is working but your [.$(S)$ $()$] is not working (take note of the white space)

            – JouleV
            50 mins ago











          • Thanks @jouleV - I was close!

            – Adam Williams
            38 mins ago






          • 1





            @AdamWilliams You are welcome! Although you were so close, but only one white space is a great deal for this package :) Unfortunately, the error message is not really clear.

            – JouleV
            35 mins ago














          2












          2








          2







          Here are three different ways to draw the graph




          tikz-qtree solution



          Take care of the white space!



          documentclass[11pt]{article}
          usepackage{tikz}
          usetikzlibrary{shapes,arrows,calc}
          usepackage{tikz-qtree}

          % ----------

          begin{document}
          begin{tikzpicture}
          tikzset{grow'=right}
          tikzset{every tree node/.style={anchor=base west}}
          Tree [.$SS$ [.$(S)$ $()$ ] [.$(S)$ [.$((S))$ $(())$ ] ] ]
          end{tikzpicture}
          end{document}


          enter image description here



          Pure TikZ solution



          documentclass[tikz]{standalone}
          usetikzlibrary{positioning}
          begin{document}
          begin{tikzpicture}[node distance=0.5cm]
          node (ss) {$SS$};
          node[above right=of ss] (sa) {$(S)$};
          node[right=of sa] (br1) {$()$};
          node[below right=of ss] (sb) {$(S)$};
          node[right=of sb] (ssb) {$((S))$};
          node[right=of ssb] (br2) {$(())$};
          draw (br1) -- (sa) -- (ss) -- (sb) -- (ssb) -- (br2);
          end{tikzpicture}
          end{document}


          enter image description here




          tikzcd solution



          documentclass{standalone}
          usepackage{tikz-cd}
          begin{document}
          begin{tikzcd}[every arrow/.append style={dash}]
          & (S) arrow[r] & ()\
          SS arrow[ru]arrow[rd] & &\
          & (S) arrow[r] & ((S)) arrow[r] & (())
          end{tikzcd}
          end{document}


          enter image description here






          share|improve this answer















          Here are three different ways to draw the graph




          tikz-qtree solution



          Take care of the white space!



          documentclass[11pt]{article}
          usepackage{tikz}
          usetikzlibrary{shapes,arrows,calc}
          usepackage{tikz-qtree}

          % ----------

          begin{document}
          begin{tikzpicture}
          tikzset{grow'=right}
          tikzset{every tree node/.style={anchor=base west}}
          Tree [.$SS$ [.$(S)$ $()$ ] [.$(S)$ [.$((S))$ $(())$ ] ] ]
          end{tikzpicture}
          end{document}


          enter image description here



          Pure TikZ solution



          documentclass[tikz]{standalone}
          usetikzlibrary{positioning}
          begin{document}
          begin{tikzpicture}[node distance=0.5cm]
          node (ss) {$SS$};
          node[above right=of ss] (sa) {$(S)$};
          node[right=of sa] (br1) {$()$};
          node[below right=of ss] (sb) {$(S)$};
          node[right=of sb] (ssb) {$((S))$};
          node[right=of ssb] (br2) {$(())$};
          draw (br1) -- (sa) -- (ss) -- (sb) -- (ssb) -- (br2);
          end{tikzpicture}
          end{document}


          enter image description here




          tikzcd solution



          documentclass{standalone}
          usepackage{tikz-cd}
          begin{document}
          begin{tikzcd}[every arrow/.append style={dash}]
          & (S) arrow[r] & ()\
          SS arrow[ru]arrow[rd] & &\
          & (S) arrow[r] & ((S)) arrow[r] & (())
          end{tikzcd}
          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 43 mins ago

























          answered 52 mins ago









          JouleVJouleV

          13.1k22663




          13.1k22663













          • Can you point out the difference? What did I mess up?

            – Adam Williams
            51 mins ago








          • 1





            @AdamWilliams There are difference: my [.$(S)$ $()$ ] is working but your [.$(S)$ $()$] is not working (take note of the white space)

            – JouleV
            50 mins ago











          • Thanks @jouleV - I was close!

            – Adam Williams
            38 mins ago






          • 1





            @AdamWilliams You are welcome! Although you were so close, but only one white space is a great deal for this package :) Unfortunately, the error message is not really clear.

            – JouleV
            35 mins ago



















          • Can you point out the difference? What did I mess up?

            – Adam Williams
            51 mins ago








          • 1





            @AdamWilliams There are difference: my [.$(S)$ $()$ ] is working but your [.$(S)$ $()$] is not working (take note of the white space)

            – JouleV
            50 mins ago











          • Thanks @jouleV - I was close!

            – Adam Williams
            38 mins ago






          • 1





            @AdamWilliams You are welcome! Although you were so close, but only one white space is a great deal for this package :) Unfortunately, the error message is not really clear.

            – JouleV
            35 mins ago

















          Can you point out the difference? What did I mess up?

          – Adam Williams
          51 mins ago







          Can you point out the difference? What did I mess up?

          – Adam Williams
          51 mins ago






          1




          1





          @AdamWilliams There are difference: my [.$(S)$ $()$ ] is working but your [.$(S)$ $()$] is not working (take note of the white space)

          – JouleV
          50 mins ago





          @AdamWilliams There are difference: my [.$(S)$ $()$ ] is working but your [.$(S)$ $()$] is not working (take note of the white space)

          – JouleV
          50 mins ago













          Thanks @jouleV - I was close!

          – Adam Williams
          38 mins ago





          Thanks @jouleV - I was close!

          – Adam Williams
          38 mins ago




          1




          1





          @AdamWilliams You are welcome! Although you were so close, but only one white space is a great deal for this package :) Unfortunately, the error message is not really clear.

          – JouleV
          35 mins ago





          @AdamWilliams You are welcome! Although you were so close, but only one white space is a great deal for this package :) Unfortunately, the error message is not really clear.

          – JouleV
          35 mins ago











          1














          I'd like to persuade you to switch to forest.



          documentclass{article}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={grow=east}
          [$SS$
          [$(S)$ $()$]
          [$(S)$
          [$((S))$ $(())$]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer
























          • A tempting proposition - I do prefer forest's syntax!

            – Adam Williams
            53 mins ago
















          1














          I'd like to persuade you to switch to forest.



          documentclass{article}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={grow=east}
          [$SS$
          [$(S)$ $()$]
          [$(S)$
          [$((S))$ $(())$]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer
























          • A tempting proposition - I do prefer forest's syntax!

            – Adam Williams
            53 mins ago














          1












          1








          1







          I'd like to persuade you to switch to forest.



          documentclass{article}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={grow=east}
          [$SS$
          [$(S)$ $()$]
          [$(S)$
          [$((S))$ $(())$]
          ]
          ]
          end{forest}
          end{document}


          enter image description here






          share|improve this answer













          I'd like to persuade you to switch to forest.



          documentclass{article}
          usepackage[edges]{forest}
          begin{document}
          begin{forest}
          for tree={grow=east}
          [$SS$
          [$(S)$ $()$]
          [$(S)$
          [$((S))$ $(())$]
          ]
          ]
          end{forest}
          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 1 hour ago









          marmotmarmot

          117k6150283




          117k6150283













          • A tempting proposition - I do prefer forest's syntax!

            – Adam Williams
            53 mins ago



















          • A tempting proposition - I do prefer forest's syntax!

            – Adam Williams
            53 mins ago

















          A tempting proposition - I do prefer forest's syntax!

          – Adam Williams
          53 mins ago





          A tempting proposition - I do prefer forest's syntax!

          – Adam Williams
          53 mins ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f484679%2fderivation-tree-not-rendering%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Gersau Kjelder | Navigasjonsmeny46°59′0″N 8°31′0″E46°59′0″N...

          Nässjö kommun Tettstader | Kjelder | NavigasjonsmenyeVIAFISNIGeoNamesMusicBrainz (area)

          Kvitkval Innhaldsliste Taksonomi og utvikling | Utsjånad og levevis | Utbreiing | Åtferd |...