Jacques ROPERS | 19 Mar 17:10
Picon

FPU bug ?

Hi,
While playing with the arithmetic libraries FPU and FP, I think I stumbled upon a bug in FPU arithmetic library which seems to be related to an interaction between FPU library and shadings.
It is illustrated in the minimal example below (this is with a recent CVS version under win XP) :
 
%###############################
\makeatletter\let\ifGm <at> compatii\relax\makeatother
\documentclass{beamer}
\usepackage{tikz}

%\usepackage{fp}
%\usetikzlibrary{fixedpointarithmetic}
%\pgfkeys{/pgf/fixed point arithmetic}
%\pgfkeys{/pgf/number format/.cd , fixed, precision=3}

\usetikzlibrary{fpu}
\pgfkeys{/pgf/fpu, /pgf/fpu/output format=fixed}

\begin{document}

\begin{frame}
\begin{tikzpicture}

\fill [top color = blue, bottom color=white] (0,0) rectangle (1,0.5);
%%% The above line gives the error message below with FPU library. There is no issue with FP.

\fill  (0,0) rectangle (1,0.5);  %%%        No problem with this rectangle without shading

\end{tikzpicture}
\end{frame}

\end{document}

%################################################
 


! Package PGF Math Error: Sorry, an internal routine of the floating point unit
 got an ill-formatted floating point number `0.0'. The unreadable part was near
 '0.0'..

See the PGF Math package documentation for explanation.
Type  H <return>  for immediate help.

 

 

 

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users
Steven Woody | 18 Mar 10:21
Picon

Put Label on joins of shapes in a Chain

Hi,

When I use chain,  I can draw edges between shapes with the 'join'
option.  But how do I put labels on these edges as well?  Thanks.

--

-- 
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 (narkewoody <at> gmail.com)

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Alain Matthes | 17 Mar 18:55
Picon

bug in pgfmath 2.00 and 2.00 CVS

Hi

I would like to know if it's only with me but

\pgfmathparse{30+100.2*(120-50)/200.4}
\pgfmathresult 

gives 33.5

\pgfmathparse{30+100*(120-50)/200}
\pgfmathresult 

gives 65

it's not very fun  and I have the same 
result with pgf 2 and pgf 2 CVS

A solution is 

\pgfmathparse{30+100.2/200.4*(120-50)}
  \pgfmathresult  

But it's a really problem because 
I have to change all my codes

Best Regards

Alain Matthes

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Martin Scharrer | 16 Mar 20:04
Picon

Incorrect placed labels for inplicite positioned nodes


Hi,

I recently run into this:
Draw a line from one coordinate to another and place a node N between them
and a label L above it.

\draw (0,0) -- (1,0) node [midway,label=above:L] (N) {N}; % :-)

works fine! However the implicit positioning (see pgf manual, section "15.9
Placing Nodes on a Line or Curve Implicitly"), which I normally use, places
the label in the wrong position (too low).

\draw (0,0) -- node [label=above:L] (N) {N} (1,0);  % labels incorrectly
placed :-(

Here a minimal example of this issue. I used the example code from the above
mentioned manual section 15.9 as base and only added labels and a little
more distance:

%&pdflatex
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[near end,L/.style={label={above:{.}}}]
  \draw (0cm,4cm) -- (3cm,4cm) node[L]{A};
  \draw (0cm,3cm) -- node[L]{B} (3cm,3cm);
  \draw (0cm,2cm) -- node[midway,L] {C} (3cm,2cm);
  \draw (0cm,1cm) -- (3cm,1cm) node[midway,L] {D} ;
\end{tikzpicture}
\end{document}

Nodes (A) and (D) have correctly placed labels (because of the explicit
coordinates). The label of node (B) is too low and the one of (C) is also
too low and at the wrong position along the line.

It seems to me that the wrong labels are (vertical) placed according to the
line, not the node!
It's not an issue with a wrong/different 'node distance' value. I tested
this.

The way I understand the PGF docu it should work also for the implicit case.
Is my understanding wrong or is this a bug in PGF/TikZ? 

--

-- 
View this message in context: http://old.nabble.com/Incorrect-placed-labels-for-inplicite-positioned-nodes-tp27923042p27923042.html
Sent from the pgf-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Henning Haida | 16 Mar 13:05
Picon

Node with clipped background image and arbitrary shape

Hi all,

I'd like to set a node with a background image (external graphic file)
and the image should be clipped to the fit the node's shape and size.
Basically it works, unfortunately I can not fit the shape of the node.

Here's an example, sorry, one has to add an image file to get it working:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds,fit}
\begin{document}
\begin{tikzpicture}
\node[draw, tape] (p1) {Text};
\begin{pgfonlayer}{background}
    \clip (p1.south east) rectangle (p1.north west);
    %\path[clip] node[shape=tape, fit=(p1.south east) (p1.north west)]
at (p1) {};
    \node at (p1) {\includegraphics{bg}};
\end{pgfonlayer}
\end{tikzpicture}
\end{document}

Any hints are appreciated.

Regards,
 Henning

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users
Lane Schwartz | 15 Mar 19:50
Picon

Trouble creating custom shape

Hi,

I'm new here. :) I'm having trouble drawing paths based on coordinates calculated from a user-specified
parameter. 

Here's what I have successfully done:
* Create a new shape using \pgfdeclareshape
* Inherit saved anchors, anchors, anchor border, and background path from rectangle
* Drawn lines to create extra rectangle in \foregroundpath. This will represent a bit vector.

Here's what I can't do:
* Draw cells within the bit-vector rectangle.

I want the user to specify, via parameters, the number of cells in the bit vector, and which cells should be
filled in.

For reference, I work in machine translation, and this shape is for use in a paper. The shape is essentially a
rectangle node (text inside the rectangle), plus a short bit-vector rectangle directly above the
primary node. The bit-vector rectangle should be the same width as the primary rectange, and the top edge
of the primary rectangle is also the bottom edge of the bit-vector rectangle. The bit vector rectangle
should be divided into a number of cells (based on a user-specified parameter), any of which might be
filled in (again, specified by the user).

Here's roughly what it should look like (use a fixed-width font to view the shape). In this example, the
first and third cells of the bit vector are filled in.

 -------------------
| X |   | X |   |   |
 -------------------
|                   |
|                   |
|                   |
|                   |
 -------------------

Here's the code I've used so far:

\pgfdeclareshape{hypothesis}{

	% Inherit anchors from rectangle
	\inheritsavedanchors[from=rectangle] 
	\inheritanchorborder[from=rectangle] 
	\inheritanchor[from=rectangle]{center} 
	\inheritanchor[from=rectangle]{north} 
	\inheritanchor[from=rectangle]{south} 
	\inheritanchor[from=rectangle]{west} 
	\inheritanchor[from=rectangle]{east}

	% Draw primary rectangle
	\inheritbackgroundpath[from=rectangle]

	% Draw the bit vector
	\foregroundpath{ 
		% store lower right in xa/ya and upper right in xb/yb
		\southwest \pgf <at> xa=\pgf <at> x \pgf <at> ya=\pgf <at> y 
		\northeast \pgf <at> xb=\pgf <at> x \pgf <at> yb=\pgf <at> y
		
		% Store top of bit vector rectangle in yc
		\pgf <at> yc=\pgf <at> yb \advance\pgf <at> yc by+10pt
				
		% Draw bit vector rectangle outline
		\pgfpathmoveto{\pgfpoint{\pgf <at> xb}{\pgf <at> yb}}
		\pgfpathlineto{\pgfpoint{\pgf <at> xb}{\pgf <at> yc}} 
		\pgfpathlineto{\pgfpoint{\pgf <at> xa}{\pgf <at> yc}} 
		\pgfpathlineto{\pgfpoint{\pgf <at> xa}{\pgf <at> yb}} 
		\pgfpathclose

		% Draw bit vector cells
		% ---------------------
		% 
		% This is the part where 
		%   I'm having a lot of trouble.
	}

}

Any guidance or tips would be greatly appreciated. So far I've read though much of the TikZ-PGF manual and
studied the source code for pgflibraryshapes.geometric.code.tex and
tikzlibrarycircuits.code.tex. Below is the current (broken) state of what I have to draw the bit vector cells:

		\def\totalwidth=\numexpr\pgf <at> xa-\pgf <at> xb
		\def\bitincrement=\numexpr1/\totalwidth
		\def\bitstartX=\pgf <at> xb
		\def\bitnextX=\numexpr\bitstartX+\bitincrement
		\def\bitfinalX=\numexpr\pgf <at> xa-\bitincrement

		\foreach \bitx in {\bitstartX,\bitnextX,...\bitfinalX } {
			\def\myq=10
			
			\pgfpathmoveto{\pgfpoint{\myq}{\pgf <at> yb}}
			\pgfpathclose
			%\let\myxval=\pgf <at> xb+\bitx
			%\pgf <at> xc=\pgf <at> xb \advance\pgf <at> xc by+\bitx
			%\pgfpathlineto{\pgfpoint{\myxval}{\pgf <at> yc}} 
		}

Thanks,
Lane

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Marc van Dongen | 15 Mar 11:09
Picon
Favicon

Problem with Scopes and To Paths

Dear all,

I can't see why to path styles `rectangle 1' and `rectangle 2',
which are included below, behave differently.

Am I missing something?

TIA for your help.

Rgards,

Marc van Dongen

\documentclass[12pt]{article}

\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{scopes}

\tikzset{side 1/.style={to path={%
    {[] let \p1=(\tikztostart), \p2=(\tikztotarget)
    in (\p1) -- (\p2) \tikztonodes}
}}}

\tikzset{rectangle 1/.style={to path={%
    let \p1=(\tikztostart), \p2=(\tikztotarget)
    in (\p1) to[side 1] (\p1 -| \p2)
             to[side 1] (\p2)
             to[side 1] (\p1 |- \p2)
             to[side 1] (\p1) \tikztonodes (\p1 -| \p2)}}}

\tikzset{side 2/.style={to path={%
    let \p3=(\tikztostart), \p4=(\tikztotarget)
    in (\p3) -- (\p4) \tikztonodes
}}}

\tikzset{rectangle 2/.style={to path={%
    let \p1=(\tikztostart), \p2=(\tikztotarget)
    in (\p1) to[side 2] (\p1 -| \p2)
             to[side 2] (\p2)
             to[side 2] (\p1 |- \p2)
             to[side 2] (\p1) \tikztonodes (\p1 -| \p2)}}}

\begin{document}
\begin{tikzpicture}
   \draw[red]  (0,0) to[rectangle 1] (2,2);
   \draw[blue] (3,0) to[rectangle 2] (5,2);
\end{tikzpicture}
\end{document}

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Bastian Sauert | 14 Mar 23:36
Picon

Base anchors do not work for nodes with text width

Hello,

I just discovered, that the base*-anchors of nodes with a text width set
do not behave the way they behave without a text width.
In the following example, all the texts should be on the same height
IMHO. However, they are not with an up-to-date TeXLive 2009.

Is this intended? Did I miss something? How can I convince a node with a
text width to have the correct baseline?

\documentclass{article}
\usepackage{tikz}
\begin{document}
  \begin{tikzpicture}
    \draw (0,0) -- (6,0);
    \node at (0,0) [anchor=base west] {Test};
    \node at (2,0) [anchor=base west,text width=2cm] {Test};
    \node at (4,0) [anchor=base west] {%
      \begingroup%
        \begin{minipage}[t]{2cm}%
          Test
        \end{minipage}%
      \endgroup};
  \end{tikzpicture}
\end{document}

As far as I understand tikz.code.tex, setting text width "just" wraps
the content of the node in a minipage. However, the same minipage in a
node without text width has the correct baseline. Unfortunately, my
knowledge about TeX or tikz's internals does not seem to be sufficient
to solve this problem.

Thank you for your help.
Yours,
Bastian

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Rouben Rostamian | 13 Mar 21:07
Favicon

Using pdfkeys to parse documentclass options

Is it possible to use pgfkeys to parse documentclass options?

Specifically, I have written a documentclass, myclass.cls,
which admits a list of key=value options, as in:

    \documentclass[key1=opt1, key2=opt2]{myclass}

Currently I am using the xkeyval package to parse the options,
as in:

    \DeclareOptionX{key1}{whatever}
    \DeclareOptionX{key2}{whatever}
    \ProcessOptionsX

I would rather use pgfkeys, if possible.  I tried:

    \pgfkeys{/myclass/key1/.code=whatever}
    \pgfkeys{/myclass/key2/.code=whatever}
    \pgfkeys{/myclass/.cd, ???}

But I don't know what to put for ???.

--

-- 
Rouben Rostamian

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Alexis Wilhelm | 13 Mar 10:41
Picon

Fwd: how to access the node at the end of the pin?

OMG I'm such a noob.  I just realized I forgot to Cc the list.

---------- Forwarded message ----------
From: Alexis Wilhelm <alexiswilhelm <at> gmail.com>
Date: 2010/3/12
Subject: Re: [Pgf-users] how to access the node at the end of the pin?
To: Stefan Pinnow <Mo-Gul <at> gmx.net>

Hi,

I was able to do it using /tikz/after node path.  But it's dirty.

\documentclass{minimal}
\usepackage[paperheight=160cm, paperwidth=15cm, margin=2cm]{geometry}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
       test/.style 2 args={
               circle,
               draw,
               minimum size=#1,
               name=ThisNode,
               after node path={
                       (\tikzlastnode)
                       ++ (#2 : #1 / 2 + .5cm)
                       node [
                               draw,
                               anchor=west,
                               rotate=#2
                       ] {bla}
                       edge (ThisNode)
               },
       },
]

\foreach \i in {0, ..., 24} {
       \node[test={1cm}{\i * 15}] at (0, \i * -6cm) {};
       \node[test={5cm}{\i * 15}] at (0, \i * -6cm) {\i};
}

\end{tikzpicture}
\end{document}

Hope it can help.

2010/3/5 Stefan Pinnow <Mo-Gul <at> gmx.net>:
> Hello,
> is there a way to access the node at the end of a pin?
> As you can see from the attached example the "test2" pin nodes look a bit odd.
>
> I would like to use the "test1" style and then just rotate the text inside of
> this node.
>
>
> Best regards,
> Stefan Pinnow
>
> % ------- minimal -------
> \documentclass{article}
>    \usepackage{tikz}
> \begin{document}
>    \begin{tikzpicture}[
>        pin distance=5ex,
>        every node/.style={
>            circle,
>            draw,
>        },
>        test1/.style={
>            minimum size=#1,
>            pin={[
>            ]above right:blabla}
>        },
>        test2/.style={
>            minimum size=#1,
>            pin={[
>                red,
>                rotate=45,
>            ]right:blabla}
>        },
>    ]
>
>        \node[test1=1cm]  at (0,0) {};
>        \node[test1=5cm]  at (0,0) {};
>
>        \node[test2=1cm]  at (6,0) {};
>        \node[test2=5cm]  at (6,0) {};
>    \end{tikzpicture}
> \end{document}
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> pgf-users mailing list
> pgf-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pgf-users
>
>
Attachment (test.tex): application/x-tex, 553 bytes
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users
Udo Hortian | 12 Mar 22:14
Picon

tikz: Position of text wrong

Dear pgf/tikz users,

I am newbie in tikz and encounter problems using tikz while running the
following example from pgfmanual.pdf, page 33

\begin{tikzpicture}
  \foreach \x in {1,2,...,5,7,8,...,12}
    \foreach \y in {1,...,5}
    {
      \draw (\x,\y) +(-.5,-.5) rectangle ++(.5,.5);
      \draw (\x,\y) node{\x,\y};
    }
\end{tikzpicture}

The text is not printed in the rectangles but rather in at the bottom left of
the picture (looks like all the numbers over each other).

I use the LaTeX environment from openSUSE 11.1:

Do you have any idea what I am doing wrong?

Best regards
Udo

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

Gmane