Forcing a newline in a node

View: New views
3 Messages — Rating Filter:   Alert me  

Forcing a newline in a node

by Daniel Dilts-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use the following to create a key for a plot in my paper.  
Unfortunately I can't figure out how to force a line break between the  
two \tikz commands.  How would I get it so that they line up  
vertically rather than horizontally?

\node[draw] at (17,27.5) [right=2em]
       {
         \tikz \draw[color=red] (0,0) -- (1,0) node[right,black]  
{Filtered Data};
         \tikz \draw[color=blue] (0,0) -- (1,0) node[right,black]  
{Model};
       };

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Forcing a newline in a node

by Zerothi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Daniel Dilts


All you need to do is add an "align=?" option such that tikz know how to align different lines.
Then you can use the normal "\\" to change lines.. Check the following:

\node[draw,align=left] at (17,27.5) [right=2em]
{
\tikz \draw[color=red] (0,0) -- (1,0) node[right,black]
{Filtered Data};\\
\tikz \draw[color=blue] (0,0) -- (1,0) node[right,black]
{Model};
};

Regards Nick

2009/10/22 Daniel Dilts <dilts.daniel@...>
I use the following to create a key for a plot in my paper.
Unfortunately I can't figure out how to force a line break between the
two \tikz commands.  How would I get it so that they line up
vertically rather than horizontally?

\node[draw] at (17,27.5) [right=2em]
      {
        \tikz \draw[color=red] (0,0) -- (1,0) node[right,black]
{Filtered Data};
        \tikz \draw[color=blue] (0,0) -- (1,0) node[right,black]
{Model};
      };

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Forcing a newline in a node

by Daniel Dilts-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When I put your code in I get the following error:
! Package pgfkeys Error: I do not know the key '/tikz/align' and I am going to 
ignore it. Perhaps you misspelled it.

I can't find align in the manual.  Do I have to add a tikz library to get them to work?


On Oct 23, 2009, at 2:22 AM, Nick Papior Andersen wrote:

Hi Daniel Dilts


All you need to do is add an "align=?" option such that tikz know how to align different lines.
Then you can use the normal "\\" to change lines.. Check the following:

\node[draw,align=left] at (17,27.5) [right=2em]
{
\tikz \draw[color=red] (0,0) -- (1,0) node[right,black]
{Filtered Data};\\
\tikz \draw[color=blue] (0,0) -- (1,0) node[right,black]
{Model};
};

Regards Nick

2009/10/22 Daniel Dilts <dilts.daniel@...>
I use the following to create a key for a plot in my paper.
Unfortunately I can't figure out how to force a line break between the
two \tikz commands.  How would I get it so that they line up
vertically rather than horizontally?

\node[draw] at (17,27.5) [right=2em]
      {
        \tikz \draw[color=red] (0,0) -- (1,0) node[right,black]
{Filtered Data};
        \tikz \draw[color=blue] (0,0) -- (1,0) node[right,black]
{Model};
      };

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users