Alignment outside tikz environment
S Barmeier <severinbarmeier <at> googlemail.com>
2010-07-09 10:07:51 GMT
Dear all,
I hope this is not a question I could have easily found in the manual,
but I've tried for a while now and haven't found a solution.
I would like to align the baseline of the text inside a node with the
surrounding text, like so:
+---+
| N | is a noun
+---+
Something like
\tikz{\node[rectangle,draw=black] {N};} is a noun
gives something like
+---+
| N |
+---+ is a noun
with the bottom of the framing rectangle being aligned with the
baseline of the "is a noun".
Is there a way of aligning the text inside the rectangle with the
surrounding text? I am planning on using the same symbols in more
involved diagrams as well, so I can't just use a well-tweaked
\colorbox, never mind the losses I would have to sustain regarding
design...
I'd be most grateful for any suggestions.
Many thanks.
Severin
On 7/7/10, pgf-users-request <at> lists.sourceforge.net
<pgf-users-request <at> lists.sourceforge.net> wrote:
> Send pgf-users mailing list submissions to
> pgf-users <at> lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/pgf-users
> or, via email, send a message with subject or body 'help' to
> pgf-users-request <at> lists.sourceforge.net
>
> You can reach the person managing the list at
> pgf-users-owner <at> lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of pgf-users digest..."
>
>
> Today's Topics:
>
> 1. wrong interaction between cvs-pgf and Beamer-3.08 (Ignasi Furi?)
> 2. Re: On the bounding box of an automaton (or: scaling nodes).
> ( Micha?l Cadilhac)
> 3. transform canvas problem (Holger Maune)
> 4. Re: transform canvas problem (Mark Wibrow)
> 5. Re: transform canvas problem (JL Diaz)
> 6. Re: Separate mailing list for pgfplots (Ralf Wildenhues)
> 7. Re: conflict: hyperref's pdfpagecrop with TIKZ/PGF/PGFplots
> externalization (Ivan Werning)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 29 Jun 2010 11:48:10 +0200
> From: Ignasi Furi? <ignasi.furio <at> uib.cat>
> Subject: [Pgf-users] wrong interaction between cvs-pgf and Beamer-3.08
> To: pgf-users <at> lists.sourceforge.net
> Message-ID: <op.ve12ukrwec4w18 <at> tomir.uib.es>
> Content-Type: text/plain; delsp=yes; format=flowed;
> charset=iso-8859-15
>
> Hi all,
>
> next code works well with pgf-2.0 and Beamer-3.08 (or newer Hg version),
> but not with pgf-cvs.
>
> %-----------------------
> \documentclass{beamer}
>
> \setbeamercolor{structure}{bg=brown}
>
> \begin{document}
>
> \begin{frame}{Frame 1}
> \end{frame}
>
> \begin{frame}{Frame 2}
> \end{frame}
>
> \end{document}
> %---------------
>
> If you can test it you will see that second frame shows a white line on
> top of it
> which displaces all its contains. This displacement is maintained (not
> incremented)
> in third or successive frames. Could you confirm it?
>
> I thought the problem was introduced by Beamer's new versions but they
> work well with pgf-2.0.
> I'm using an updated version of MiKTeX 2.8.
>
> Thank you,
>
> Ignasi
>
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 30 Jun 2010 12:05:04 -0400
> From: michael <at> cadilhac.name ( Micha?l Cadilhac)
> Subject: Re: [Pgf-users] On the bounding box of an automaton (or:
> scaling nodes).
> To: pgf-users <at> lists.sourceforge.net
> Message-ID: <yvzgocespkun.fsf <at> cadilhac.name>
> Content-Type: text/plain; charset=iso-8859-1
>
> Any idea guys?? The short version is: I have a two-state automaton, the
> left state being initial, but I don't want the initial transition to be
> taken in the bounding box, i.e., I want my picture to be centered on the
> middle of the transition between the two states.
>
> Thanks!
>
> michael <at> cadilhac.name (Micha?l Cadilhac) writes:
>
>> Hi there everyone,
>>
>> I'm still at the very beginning of my journey with TikZ, so the
>> following may seem like a stupid question.
>>
>> I have a simple automaton with two states (a) and (b) aligned like
>> so?: ->a--b . I wanted to define the bounding box as being centered on
>> the middle point of the main transition (i.e., not including the
>> starting ->). I first explicitly wrote the coordinate of a rectangle to
>> give to \useasboundingbox, then read the tutorials, and wanted a cleaner
>> version.
>>
>> So I tried?:
>> \useasboundingbox (a.south west) rectangle (b.nort east)
>>
>> but this bounding box is a little too small, so I tried to /scale/ it.
>> This, with no effect. I guess my question reduces to the following?:
>> Why is this code not working as expected?:
>>
>> \begin{tikzpicture}[every node/.style={draw,fill=red}]
>> \node (a) {}; \node (b) [right of=a] {};
>> \draw[scale=2] (a)--(b);
>> \draw[yshift=1mm,scale=2] (0,0)--(1,0);
>> \end{tikzpicture}
>>
>> ?
>>
>> (I would have expected the two draw's to draw the same line.)
>>
>> I seached in the Manual, with no chance (can't find a way to make
>> "transform shape" do any good, for instance).
>>
>> Thanks a bunch for any explanation?!
>
> --
> Micha?l `Micha' Cadilhac (LITQ, U. de Montr?al) --
> http://michael.cadilhac.name
> || - Pourquoi il pleure le gamin, il a eu son histoire, non ?
> || - Ouais. Bamby. Bamby le nazi.
> || -- M. Barth?l?my
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 1 Jul 2010 10:10:37 +0200
> From: "Holger Maune" <maune <at> mwt.tu-darmstadt.de>
> Subject: [Pgf-users] transform canvas problem
> To: <pgf-users <at> lists.sourceforge.net>
> Message-ID: <735CF5EBF9F5453292FF9DB948629892 <at> pc180>
> Content-Type: text/plain; charset="us-ascii"
>
> Dear all,
>
> I tried to use the transform canvas option to scale the complete picture
> including the text. The bounding box for the scaled picture is calculated
> wrong. Is this a bug or a feature? Has anyone a fix?
>
> Minimal (not) working (as intended) example:
>
> \documentclass{article}
> \usepackage{tikz}
>
> \begin{document}
> \fbox{%
> \begin{tikzpicture}
> \draw[red] (0,0) rectangle (2,2);
> \end{tikzpicture}%
> }
> %
> \fbox{%
> \begin{tikzpicture}[transform canvas={scale=1}]
> \draw[red] (0,0) rectangle (2,2);
> \end{tikzpicture}%
> }
> \end{document}
>
>
> Best Regards
>
>
> Holger
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 01 Jul 2010 09:49:03 +0100
> From: Mark Wibrow <m.wibrow <at> gmail.com>
> Subject: Re: [Pgf-users] transform canvas problem
> To: pgf-users <at> lists.sourceforge.net
> Message-ID: <4C2C567F.4000109 <at> googlemail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> As stated in the manual, PGF does not keep track of picture sizes (or
> node positions) when canvas transformations are used in the current
> scope. In the example you give, you would have to manually provide a
> bounding box using \useasboundingbox.
>
> Regards
>
> Mark
>
> On 01/07/2010 09:10, Holger Maune wrote:
>> Dear all,
>>
>> I tried to use the transform canvas option to scale the complete picture
>> including the text. The bounding box for the scaled picture is calculated
>> wrong. Is this a bug or a feature? Has anyone a fix?
>>
>> Minimal (not) working (as intended) example:
>>
>> \documentclass{article}
>> \usepackage{tikz}
>>
>> \begin{document}
>> \fbox{%
>> \begin{tikzpicture}
>> \draw[red] (0,0) rectangle (2,2);
>> \end{tikzpicture}%
>> }
>> %
>> \fbox{%
>> \begin{tikzpicture}[transform canvas={scale=1}]
>> \draw[red] (0,0) rectangle (2,2);
>> \end{tikzpicture}%
>> }
>> \end{document}
>>
>>
>> Best Regards
>>
>>
>> Holger
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> pgf-users mailing list
>> pgf-users <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pgf-users
>>
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 1 Jul 2010 11:02:27 +0200
> From: JL Diaz <jldiaz <at> gmail.com>
> Subject: Re: [Pgf-users] transform canvas problem
> To: Mark Wibrow <m.wibrow <at> gmail.com>
> Cc: pgf-users <at> lists.sourceforge.net
> Message-ID:
> <AANLkTinna3B8XEEMUJNTTOHqk5_7SyT0VdjOqzhJ2oSA <at> mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Somehow, I don't trust canvas transforms
>
> I would suggest to create the figure in a separate document (using package
> preview to "extract" it with the appropiate size), and then include it in
> the main document via \includegraphics, to which scale factors or absolute
> dimensions can be given.
>
> Regards,
> --JL Diaz
>
>
> On Thu, Jul 1, 2010 at 10:49 AM, Mark Wibrow <m.wibrow <at> gmail.com> wrote:
>
>> Hi,
>>
>> As stated in the manual, PGF does not keep track of picture sizes (or
>> node positions) when canvas transformations are used in the current
>> scope. In the example you give, you would have to manually provide a
>> bounding box using \useasboundingbox.
>>
>> Regards
>>
>> Mark
>>
>> On 01/07/2010 09:10, Holger Maune wrote:
>> > Dear all,
>> >
>> > I tried to use the transform canvas option to scale the complete picture
>> > including the text. The bounding box for the scaled picture is
>> > calculated
>> > wrong. Is this a bug or a feature? Has anyone a fix?
>> >
>> > Minimal (not) working (as intended) example:
>> >
>> > \documentclass{article}
>> > \usepackage{tikz}
>> >
>> > \begin{document}
>> > \fbox{%
>> > \begin{tikzpicture}
>> > \draw[red] (0,0) rectangle (2,2);
>> > \end{tikzpicture}%
>> > }
>> > %
>> > \fbox{%
>> > \begin{tikzpicture}[transform canvas={scale=1}]
>> > \draw[red] (0,0) rectangle (2,2);
>> > \end{tikzpicture}%
>> > }
>> > \end{document}
>> >
>> >
>> > Best Regards
>> >
>> >
>> > Holger
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > This SF.net email is sponsored by Sprint
>> > What will you do first with EVO, the first 4G phone?
>> > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> > _______________________________________________
>> > pgf-users mailing list
>> > pgf-users <at> lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/pgf-users
>> >
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> pgf-users mailing list
>> pgf-users <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pgf-users
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 6
> Date: Sun, 4 Jul 2010 20:04:40 +0000 (UTC)
> From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
> Subject: Re: [Pgf-users] Separate mailing list for pgfplots
> To: pgf-users <at> lists.sourceforge.net
> Message-ID: <loom.20100704T220334-870 <at> post.gmane.org>
> Content-Type: text/plain; charset=us-ascii
>
> Hallo Christian,
>
> Christian Feuersaenger writes:
>> A new mailing list for pgfplots has been opened under
>> http://sourceforge.net/mailarchive/forum.php?forum_name=pgfplots-features
>>
>> I invite interested users to post comments, help requests, feature
>> requests,
> bug reports or suggestions
>> for improvements in this list. After all, pgf and pgfplots are currently
> separate development lines.
>
> this separate mailing list is not yet archived at <http://gmane.org>.
> Please consider doing so, it is an excellect mailing list to web and
> to news gateway, and provides good search facilities; it has tools
> against spam so you don't need to fear more noise from there.
> You can easily subscribe the list here <http://gmane.org/subscribe.php>
> but if you have archives of past messages it would be even better if you
> sent them there, <http://gmane.org/import.php>, that would make the list
> more complete.
>
> Cheers, and thanks for pgfplots!
> Ralf
>
>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Wed, 7 Jul 2010 10:55:20 -0400
> From: Ivan Werning <iwerning <at> economics.mit.edu>
> Subject: Re: [Pgf-users] conflict: hyperref's pdfpagecrop with
> TIKZ/PGF/PGFplots externalization
> To: Christian Feuersaenger <feuersaenger <at> ins.uni-bonn.de>
> Cc: TikZ & PGF Mailing List <pgf-users <at> lists.sourceforge.net>
> Message-ID: <3E765518-4970-48B8-AA5E-7AAF6679856B <at> economics.mit.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Thanks that did work! Somehow I'd missed your response until now but I'm
> very happy to have this solution. This externalization library rocks! Thanks
> for your work on it.
>
> -Ivan
>
> On Jun 9, 2010, at 2:26 AM, Christian Feuersaenger wrote:
>
>> Hi Ivan,
>>
>> If I am not mistaken, the problem is that 'pdfpagescrop' is applied to
>> the external graphics although it shouldn't. Thus, a solution is to
>> apply the option if and only if the *main document* is currently
>> generated, not the single graphics.
>>
>> The external library supports a switch to test that:
>> \tikzifexternalizing{ true code }{ false code },
>> in your example, it could be
>>
>> \tikzifexternalizing{%
>> % do nothing in case 'true'
>> }{%
>> % ok, the main document is being generated:
>> \hypersetup{pdfpagescrop={55 30 555 740}}.
>> }
>>
>> Does that fix the problem?
>>
>> Best regards
>>
>> Christian
>>
>>
>> Date: Thu, 3 Jun 2010 13:19:28 -0400
>> From: Ivan Werning
>> Subject: [Pgf-users] conflict: hyperref's pdfpagecrop with
>> TIKZ/PGF/PGFplots externalization \usepgfplots{external}
>> To: pgf-users <at> lists.sourceforge.net
>> Message-ID: <EB510C4A-2E15-4E31-B0C3-386BC3E5FD51 <at> economics.mit.edu>
>> Content-Type: text/plain; charset=us-ascii
>>
>> I use hyperref and I like to get my PDF cropped by the pdfpagecrop
>> setting, e.g. something like \hypersetup{pdfpagescrop={55 30 555 740}}.
>>
>> This conflicts with the automatic externalization production implemented
>> by \usetikzlibrary{external} or \usepgfplots{external}. That is, if I
>> have:
>> \usetikzlibrary{external}
>> \tikzexternalize
>> in addition to
>> \hypersetup{pdfpagescrop={55 30 555 740}}.
>> say, and then I run pdflatex -shell-execute foo.tex then my tikzpictures
>> get converted to PDF but they get cropped, which creates a problem.
>>
>> Any ideas? Is there an alternative way to crop that does not conflict?
>> Other workarounds? Is this problem known?
>>
>> Many thanks.
>>
>> -Ivan
>>
>>
>> --
>> Christian Feuersaenger
>> Institut fuer Numerische Simulation
>> Rheinische Friedrich-Wilhelms Universitaet Bonn
>> Wegelerstrasse 6
>> D-53115 Bonn
>> Germany
>>
>> Tel: +49 228 733430
>> URL: http://wissrech.ins.uni-bonn.de/people/feuersaenger.html
>
>
>
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>
> ------------------------------
>
> _______________________________________________
> pgf-users mailing list
> pgf-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pgf-users
>
>
> End of pgf-users Digest, Vol 49, Issue 1
> ****************************************
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first