Can't get new line at tikz diagram text

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
7
down vote

favorite












Look at this:



begintikzpicture
path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
endtikzpicture


This is the result:
enter image description here



Do you have any idea why?



Here is the full file:



% Preview source code

%% LyX 2.3.0 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
documentclass[a4paper,english,hebrew]article
usepackagefontspec
usepackagefancyhdr
pagestylefancy
setlengthparindent0bp
usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder=0 0 1,backref=false,colorlinks=false]
hyperref

makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
pdfpageheightpaperheight
pdfpagewidthpaperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
usepackagetheorem
theorembodyfontupshape
newtheoremtheoremRמשפט[section]
AtBeginDocumentmake@lrthetheorem

% The following chunk fixes export with XeTeX.
% It is needed because polyglossia is used by default
% and make@lr is only defined by babel.
@ifundefinedmake@lr
defmake@lr#1begingroup
toks@=expandafter#1%
edefxendgroup
defnoexpand#1noexpand@numberthetoks@%
xrelax

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
newfontfamilyhebrewfont[Script=Hebrew]David CLM
newfontfamilyhebrewfonttt[Script=Hebrew]Miriam Mono CLM
newfontfamilyhebrewfontsf[Script=Hebrew]Yehuda CLM
AtBeginDocument
renewcommandfootnoterule%
kern -3pt
hbox to textwidthhfillvrule height 0.4pt width .4textwidth
kern 2.6pt

usepackagetikz

makeatother

usepackagepolyglossia
setdefaultlanguagehebrew
setotherlanguageenglish
begindocument
begintikzpicture
path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
endtikzpicture
enddocument


Thank you!!



(I planed to draw the line after I'll finish the nodes)







share|improve this question


























    up vote
    7
    down vote

    favorite












    Look at this:



    begintikzpicture
    path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
    endtikzpicture


    This is the result:
    enter image description here



    Do you have any idea why?



    Here is the full file:



    % Preview source code

    %% LyX 2.3.0 created this file. For more info, see http://www.lyx.org/.
    %% Do not edit unless you really know what you are doing.
    documentclass[a4paper,english,hebrew]article
    usepackagefontspec
    usepackagefancyhdr
    pagestylefancy
    setlengthparindent0bp
    usepackage[unicode=true,pdfusetitle,
    bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
    breaklinks=false,pdfborder=0 0 1,backref=false,colorlinks=false]
    hyperref

    makeatletter

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
    pdfpageheightpaperheight
    pdfpagewidthpaperwidth


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
    usepackagetheorem
    theorembodyfontupshape
    newtheoremtheoremRמשפט[section]
    AtBeginDocumentmake@lrthetheorem

    % The following chunk fixes export with XeTeX.
    % It is needed because polyglossia is used by default
    % and make@lr is only defined by babel.
    @ifundefinedmake@lr
    defmake@lr#1begingroup
    toks@=expandafter#1%
    edefxendgroup
    defnoexpand#1noexpand@numberthetoks@%
    xrelax

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
    newfontfamilyhebrewfont[Script=Hebrew]David CLM
    newfontfamilyhebrewfonttt[Script=Hebrew]Miriam Mono CLM
    newfontfamilyhebrewfontsf[Script=Hebrew]Yehuda CLM
    AtBeginDocument
    renewcommandfootnoterule%
    kern -3pt
    hbox to textwidthhfillvrule height 0.4pt width .4textwidth
    kern 2.6pt

    usepackagetikz

    makeatother

    usepackagepolyglossia
    setdefaultlanguagehebrew
    setotherlanguageenglish
    begindocument
    begintikzpicture
    path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
    endtikzpicture
    enddocument


    Thank you!!



    (I planed to draw the line after I'll finish the nodes)







    share|improve this question
























      up vote
      7
      down vote

      favorite









      up vote
      7
      down vote

      favorite











      Look at this:



      begintikzpicture
      path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
      endtikzpicture


      This is the result:
      enter image description here



      Do you have any idea why?



      Here is the full file:



      % Preview source code

      %% LyX 2.3.0 created this file. For more info, see http://www.lyx.org/.
      %% Do not edit unless you really know what you are doing.
      documentclass[a4paper,english,hebrew]article
      usepackagefontspec
      usepackagefancyhdr
      pagestylefancy
      setlengthparindent0bp
      usepackage[unicode=true,pdfusetitle,
      bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
      breaklinks=false,pdfborder=0 0 1,backref=false,colorlinks=false]
      hyperref

      makeatletter

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
      pdfpageheightpaperheight
      pdfpagewidthpaperwidth


      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
      usepackagetheorem
      theorembodyfontupshape
      newtheoremtheoremRמשפט[section]
      AtBeginDocumentmake@lrthetheorem

      % The following chunk fixes export with XeTeX.
      % It is needed because polyglossia is used by default
      % and make@lr is only defined by babel.
      @ifundefinedmake@lr
      defmake@lr#1begingroup
      toks@=expandafter#1%
      edefxendgroup
      defnoexpand#1noexpand@numberthetoks@%
      xrelax

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
      newfontfamilyhebrewfont[Script=Hebrew]David CLM
      newfontfamilyhebrewfonttt[Script=Hebrew]Miriam Mono CLM
      newfontfamilyhebrewfontsf[Script=Hebrew]Yehuda CLM
      AtBeginDocument
      renewcommandfootnoterule%
      kern -3pt
      hbox to textwidthhfillvrule height 0.4pt width .4textwidth
      kern 2.6pt

      usepackagetikz

      makeatother

      usepackagepolyglossia
      setdefaultlanguagehebrew
      setotherlanguageenglish
      begindocument
      begintikzpicture
      path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
      endtikzpicture
      enddocument


      Thank you!!



      (I planed to draw the line after I'll finish the nodes)







      share|improve this question














      Look at this:



      begintikzpicture
      path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
      endtikzpicture


      This is the result:
      enter image description here



      Do you have any idea why?



      Here is the full file:



      % Preview source code

      %% LyX 2.3.0 created this file. For more info, see http://www.lyx.org/.
      %% Do not edit unless you really know what you are doing.
      documentclass[a4paper,english,hebrew]article
      usepackagefontspec
      usepackagefancyhdr
      pagestylefancy
      setlengthparindent0bp
      usepackage[unicode=true,pdfusetitle,
      bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
      breaklinks=false,pdfborder=0 0 1,backref=false,colorlinks=false]
      hyperref

      makeatletter

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
      pdfpageheightpaperheight
      pdfpagewidthpaperwidth


      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
      usepackagetheorem
      theorembodyfontupshape
      newtheoremtheoremRמשפט[section]
      AtBeginDocumentmake@lrthetheorem

      % The following chunk fixes export with XeTeX.
      % It is needed because polyglossia is used by default
      % and make@lr is only defined by babel.
      @ifundefinedmake@lr
      defmake@lr#1begingroup
      toks@=expandafter#1%
      edefxendgroup
      defnoexpand#1noexpand@numberthetoks@%
      xrelax

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
      newfontfamilyhebrewfont[Script=Hebrew]David CLM
      newfontfamilyhebrewfonttt[Script=Hebrew]Miriam Mono CLM
      newfontfamilyhebrewfontsf[Script=Hebrew]Yehuda CLM
      AtBeginDocument
      renewcommandfootnoterule%
      kern -3pt
      hbox to textwidthhfillvrule height 0.4pt width .4textwidth
      kern 2.6pt

      usepackagetikz

      makeatother

      usepackagepolyglossia
      setdefaultlanguagehebrew
      setotherlanguageenglish
      begindocument
      begintikzpicture
      path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80]black \ box;
      endtikzpicture
      enddocument


      Thank you!!



      (I planed to draw the line after I'll finish the nodes)









      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 13 at 16:39









      Milo

      5,42821345




      5,42821345










      asked Aug 13 at 16:25









      heblyx

      684717




      684717




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          10
          down vote



          accepted










          Use align=center, or another option such as left or right.



          enter image description here



          documentclass[tikz,margin=0.5cm]standalone
          begindocument
          begintikzpicture
          path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80,align=center]black \ box;
          endtikzpicture
          enddocument





          share|improve this answer



























            up vote
            5
            down vote













            mostly off-topic (since you already got a solution), however some of suggestions can be useful to you:



            • most of you preamble is not related to your problem, please nesxt time try to reduce it to minimum, i.e. provide minimal working example (mwe)

            • for similar nodes is sensible to define style, for example rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center, which has free parameter for determining fill color

            • you can define default nodes color


            • give name to nodes (for simple drawings the lines between them)



              documentclass[a4paper,english,hebrew]article
              usepackagetikz

              begindocument
              begintikzpicture[
              rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center,
              rbox/.default = green!80,
              ]
              path (0, 1) node (p) [rbox]$P$
              (0,-1) node (q) [rbox]$Q$
              (2, 0) node (bb) [rbox=red!20]black\ box;
              draw[->] (p) -| (bb);
              draw[->] (q) -| (bb);
              endtikzpicture
              enddocument


            enter image description here






            share|improve this answer






















              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',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              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%2f445908%2fcant-get-new-line-at-tikz-diagram-text%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              10
              down vote



              accepted










              Use align=center, or another option such as left or right.



              enter image description here



              documentclass[tikz,margin=0.5cm]standalone
              begindocument
              begintikzpicture
              path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80,align=center]black \ box;
              endtikzpicture
              enddocument





              share|improve this answer
























                up vote
                10
                down vote



                accepted










                Use align=center, or another option such as left or right.



                enter image description here



                documentclass[tikz,margin=0.5cm]standalone
                begindocument
                begintikzpicture
                path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80,align=center]black \ box;
                endtikzpicture
                enddocument





                share|improve this answer






















                  up vote
                  10
                  down vote



                  accepted







                  up vote
                  10
                  down vote



                  accepted






                  Use align=center, or another option such as left or right.



                  enter image description here



                  documentclass[tikz,margin=0.5cm]standalone
                  begindocument
                  begintikzpicture
                  path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80,align=center]black \ box;
                  endtikzpicture
                  enddocument





                  share|improve this answer












                  Use align=center, or another option such as left or right.



                  enter image description here



                  documentclass[tikz,margin=0.5cm]standalone
                  begindocument
                  begintikzpicture
                  path (0,1) node[draw,rectangle,rounded corners,fill=green!80]$P$ (0,-1) node[draw,rectangle,rounded corners,fill=green!80]$Q$ (2,0) node[draw,rectangle,rounded corners,fill=green!80,align=center]black \ box;
                  endtikzpicture
                  enddocument






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 13 at 16:34









                  Milo

                  5,42821345




                  5,42821345




















                      up vote
                      5
                      down vote













                      mostly off-topic (since you already got a solution), however some of suggestions can be useful to you:



                      • most of you preamble is not related to your problem, please nesxt time try to reduce it to minimum, i.e. provide minimal working example (mwe)

                      • for similar nodes is sensible to define style, for example rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center, which has free parameter for determining fill color

                      • you can define default nodes color


                      • give name to nodes (for simple drawings the lines between them)



                        documentclass[a4paper,english,hebrew]article
                        usepackagetikz

                        begindocument
                        begintikzpicture[
                        rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center,
                        rbox/.default = green!80,
                        ]
                        path (0, 1) node (p) [rbox]$P$
                        (0,-1) node (q) [rbox]$Q$
                        (2, 0) node (bb) [rbox=red!20]black\ box;
                        draw[->] (p) -| (bb);
                        draw[->] (q) -| (bb);
                        endtikzpicture
                        enddocument


                      enter image description here






                      share|improve this answer


























                        up vote
                        5
                        down vote













                        mostly off-topic (since you already got a solution), however some of suggestions can be useful to you:



                        • most of you preamble is not related to your problem, please nesxt time try to reduce it to minimum, i.e. provide minimal working example (mwe)

                        • for similar nodes is sensible to define style, for example rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center, which has free parameter for determining fill color

                        • you can define default nodes color


                        • give name to nodes (for simple drawings the lines between them)



                          documentclass[a4paper,english,hebrew]article
                          usepackagetikz

                          begindocument
                          begintikzpicture[
                          rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center,
                          rbox/.default = green!80,
                          ]
                          path (0, 1) node (p) [rbox]$P$
                          (0,-1) node (q) [rbox]$Q$
                          (2, 0) node (bb) [rbox=red!20]black\ box;
                          draw[->] (p) -| (bb);
                          draw[->] (q) -| (bb);
                          endtikzpicture
                          enddocument


                        enter image description here






                        share|improve this answer
























                          up vote
                          5
                          down vote










                          up vote
                          5
                          down vote









                          mostly off-topic (since you already got a solution), however some of suggestions can be useful to you:



                          • most of you preamble is not related to your problem, please nesxt time try to reduce it to minimum, i.e. provide minimal working example (mwe)

                          • for similar nodes is sensible to define style, for example rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center, which has free parameter for determining fill color

                          • you can define default nodes color


                          • give name to nodes (for simple drawings the lines between them)



                            documentclass[a4paper,english,hebrew]article
                            usepackagetikz

                            begindocument
                            begintikzpicture[
                            rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center,
                            rbox/.default = green!80,
                            ]
                            path (0, 1) node (p) [rbox]$P$
                            (0,-1) node (q) [rbox]$Q$
                            (2, 0) node (bb) [rbox=red!20]black\ box;
                            draw[->] (p) -| (bb);
                            draw[->] (q) -| (bb);
                            endtikzpicture
                            enddocument


                          enter image description here






                          share|improve this answer














                          mostly off-topic (since you already got a solution), however some of suggestions can be useful to you:



                          • most of you preamble is not related to your problem, please nesxt time try to reduce it to minimum, i.e. provide minimal working example (mwe)

                          • for similar nodes is sensible to define style, for example rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center, which has free parameter for determining fill color

                          • you can define default nodes color


                          • give name to nodes (for simple drawings the lines between them)



                            documentclass[a4paper,english,hebrew]article
                            usepackagetikz

                            begindocument
                            begintikzpicture[
                            rbox/.style = rectangle, draw, rounded corners, fill=#1, align=center,
                            rbox/.default = green!80,
                            ]
                            path (0, 1) node (p) [rbox]$P$
                            (0,-1) node (q) [rbox]$Q$
                            (2, 0) node (bb) [rbox=red!20]black\ box;
                            draw[->] (p) -| (bb);
                            draw[->] (q) -| (bb);
                            endtikzpicture
                            enddocument


                          enter image description here







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Aug 13 at 17:10

























                          answered Aug 13 at 16:58









                          Zarko

                          111k861149




                          111k861149



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f445908%2fcant-get-new-line-at-tikz-diagram-text%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery