Sébastien Barthélemy | 1 Feb 01:51 2008

problem using a tikz matrix within beamer

Hello everybody,

I get some "Package pgfbasematrix Error: Single ampersand used with
wrong catcode." error message when using a tikz matrix within beamer.

Some simple example file is attached (uncomment the line to get the error).

I found a solution there :
http://groups.google.com/group/de.comp.text.tex/browse_thread/thread/a9460cca4711da30
that is: replace & by \pgfmatrixnextcell. But I was wondering if there
were a better way to fix it.

Thanks for any help

--

-- 
Sébastien Barthélemy
Attachment (beamer-tikz-ampersand.tex): application/x-tex, 571 bytes
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users
Matthew Leingang | 1 Feb 04:08 2008
Picon

Re: problem using a tikz matrix within beamer

Dear Sébastien,

You can use another control sequence instead of \pgfmatrixnextcell by  
using the "ampersand replacement" option.

  \begin{tikzpicture}[auto]
       \tikzstyle{frame} = [rectangle, draw=blue, thick, fill=blue!20];

       \matrix [column sep=0.5cm,ampersand replacement=\&]
       {
         \node [frame] {$P_0$}; \& %<-- note the \ in front of the %
         \node [frame] {$P_1$}; \&
         \node [frame] {$P_2$}; \\
       };
     \end{tikzpicture}

I've also read that you can use the fragile option but I haven't  
tried that.

Yours,
Matthew Leingang

On Jan 31, 2008, at 7:51 PM, Sébastien Barthélemy wrote:

> Hello everybody,
>
> I get some "Package pgfbasematrix Error: Single ampersand used with
> wrong catcode." error message when using a tikz matrix within beamer.
>
> Some simple example file is attached (uncomment the line to get the  
(Continue reading)

Till Tantau | 1 Feb 09:58 2008
Picon

Re: problem using a tikz matrix within beamer

Hi!

actually, just add the "fragile" option to beamer frames that contain  
a matrix. That will fix the problem.

Till

Am 01.02.2008 um 04:08 schrieb Matthew Leingang:

> Dear Sébastien,
>
> You can use another control sequence instead of \pgfmatrixnextcell by
> using the "ampersand replacement" option.
>
>   \begin{tikzpicture}[auto]
>        \tikzstyle{frame} = [rectangle, draw=blue, thick, fill=blue! 
> 20];
>
>        \matrix [column sep=0.5cm,ampersand replacement=\&]
>        {
>          \node [frame] {$P_0$}; \& %<-- note the \ in front of the %
>          \node [frame] {$P_1$}; \&
>          \node [frame] {$P_2$}; \\
>        };
>      \end{tikzpicture}
>
> I've also read that you can use the fragile option but I haven't
> tried that.
>
> Yours,
(Continue reading)

Sébastien Barthélemy | 1 Feb 11:30 2008

Re: problem using a tikz matrix within beamer

2008/2/1, Till Tantau <tantau <at> tcs.uni-luebeck.de>:
> Hi!
>
> actually, just add the "fragile" option to beamer frames that contain
> a matrix. That will fix the problem.

Thanks to both of you

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
msu79 | 1 Feb 11:47 2008
Picon

Alignment/overlay of images and rectangles using TikZ in beamer


Hi there!

I'm - meanwhile rather desperately - trying to solve the following task:
I've defined an image to be 0.8\paperwidth. Now I want to display this image
on a slide and then overlay some rectangles for clarification.

One way I tried to accomplish this was:
  \begin{tikzpicture}{remember picture,overlay}
    \pgfuseimage{precrbias}
  \end{tikzpicture}
  \only <2> {  \begin{tikzpicture}{remember picture,overlay}
    \draw[red,overlay] (1,1) rectangle (1.5,1.5);
    \draw[blue,overlay] (2.5,2.5) rectangle (1,1);
    \draw[green,overlay] (5,5) rectangle (2.5,2.5);
  \end{tikzpicture}}

(don't wonder about the coordinates, I'm just playing around so far)

With that I ended up having the image aligned at the center of the frame,
and the rectangles were where I wanted to have them.

In a second try, I put the image into a node, so "\node {
\pgfuseimage{precrbias} };". Now, the image was properly aligned, but the
rectangles show up next to it.

Putting the image outside any tikzpicture environment did not work either!

Any suggestions on what to do next?

(Continue reading)

Hans Meine | 1 Feb 12:04 2008
Picon

Off-Topic: Problem with TeX expansion - help needed (capitalize words)

Hi,

I am sorry for abusing this list for a (difficult) TeX problem, but this is 
the only list I know that is read by TeX wizards - please tell me if you know 
a good place for such questions (that preferably does not require Usenet 
access).

I am trying to solve a problem which I have had a lot of times already, and I 
could absolutely not find any solution in the WWW so far:  I am using 
prettyref for styled references (i.e. \prettyref{eq:foo} gets expanded to 
equation~\eqref{eq:foo}), which I want to capitalize at the beginning of 
sentences.

After reading the TeXbook, I became brave and tried the following macro def:

  \def\capitalize#1{\uppercase{#1}}
  \capitalize simple text works.

With macros (or LaTeX commands), I could get it to work by adding 
\expandafter:

  \def\simplemacro{a simple macro}
  \expandafter\capitalize \simplemacro{} works.

Question 1: Why does adding \expandafter to \capitalize's definition not work?

  \def\capitalize#1{\expandafter\uppercase{#1}}
  \capitalize \simplemacro{} does not work.

Obviously, this is because of the braces, but how can I solve this?
(Continue reading)

Kjell Magne Fauske | 1 Feb 12:33 2008
Picon

Re: Off-Topic: Problem with TeX expansion - help needed (capitalize words)

On Feb 1, 2008 12:04 PM, Hans Meine <meine <at> informatik.uni-hamburg.de> wrote:
> Hi,
>
> I am sorry for abusing this list for a (difficult) TeX problem, but this is
> the only list I know that is read by TeX wizards - please tell me if you know
> a good place for such questions (that preferably does not require Usenet
> access).
>

Unfortunately I can't help you with your other question.

I recommend posting to comp.text.tex, which is the largest forum for
TeX users.  It is a usenet group, but you can use Google groups to
both read and post to the group:

http://groups.google.com/group/comp.text.tex/topics

The only thing you'll need is a Google account. I think also you can
use Nabble to access usenet groups.

- Kjell Magne Fauske

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Pascal Wolkotte | 1 Feb 12:39 2008
Picon
Picon

Re: Off-Topic: Problem with TeX expansion - help needed (capitalize words)

Hans,

Not sure how to solve your problem, but you might consider the fancyref
package.

It uses two formats \Fref and \fref. You can use the former at the
beginning of the sentence and latter anywhere else. Depending on the
label name (e.g. chap:, sec:, fig:, eq: and others) and language it
chooses the correct style for the reference. It also can use the
varioref package for automatic reference to the page too (e.g. figure
2.1 on page 21, or Equation 5.2 on the following page).

Regards,
Pascal Wolkotte

On Fri, 2008-02-01 at 12:04 +0100, Hans Meine wrote:
> Hi,
> 
> I am sorry for abusing this list for a (difficult) TeX problem, but this is 
> the only list I know that is read by TeX wizards - please tell me if you know 
> a good place for such questions (that preferably does not require Usenet 
> access).
> 
> I am trying to solve a problem which I have had a lot of times already, and I 
> could absolutely not find any solution in the WWW so far:  I am using 
> prettyref for styled references (i.e. \prettyref{eq:foo} gets expanded to 
> equation~\eqref{eq:foo}), which I want to capitalize at the beginning of 
> sentences.
> 
> After reading the TeXbook, I became brave and tried the following macro def:
(Continue reading)

Matthew Leingang | 1 Feb 12:53 2008
Picon

Re: Off-Topic: Problem with TeX expansion - help needed (capitalize words)


On Feb 1, 2008, at 6:04 AM, Hans Meine wrote:

> Hi,
>
> I am sorry for abusing this list for a (difficult) TeX problem, but  
> this is
> the only list I know that is read by TeX wizards - please tell me  
> if you know
> a good place for such questions (that preferably does not require  
> Usenet
> access).

The TUG has a mailing list:

http://tug.org/mailman/listinfo/texhax

You have a good question and there are many TeXperts who can help.   
Make sure you follow the etiquette of explaining what you wanted to  
happen, what you tried, what actually happened, and minimal sample  
code.  There's a mini-flame war going on right now as to whether the  
experts on the list are gentle enough.  I think they are, but they  
don't suffer fools gladly.

--Matt

--
Matthew Leingang
Preceptor in Mathematics
Harvard University
(Continue reading)

Kjell Magne Fauske | 1 Feb 13:04 2008
Picon

Re: Alignment/overlay of images and rectangles using TikZ in beamer

On Feb 1, 2008 11:47 AM, msu79 <martin <at> suklitsch.at> wrote:
>
> Hi there!
>
>
> I'm - meanwhile rather desperately - trying to solve the following task:
> I've defined an image to be 0.8\paperwidth. Now I want to display this image
> on a slide and then overlay some rectangles for clarification.
>
> One way I tried to accomplish this was:
>   \begin{tikzpicture}{remember picture,overlay}
>     \pgfuseimage{precrbias}
>   \end{tikzpicture}
>   \only <2> {  \begin{tikzpicture}{remember picture,overlay}
>     \draw[red,overlay] (1,1) rectangle (1.5,1.5);
>     \draw[blue,overlay] (2.5,2.5) rectangle (1,1);
>     \draw[green,overlay] (5,5) rectangle (2.5,2.5);
>   \end{tikzpicture}}
>
> (don't wonder about the coordinates, I'm just playing around so far)
>
> With that I ended up having the image aligned at the center of the frame,
> and the rectangles were where I wanted to have them.
>
> In a second try, I put the image into a node, so "\node {
> \pgfuseimage{precrbias} };". Now, the image was properly aligned, but the
> rectangles show up next to it.
>
> Putting the image outside any tikzpicture environment did not work either!
>
(Continue reading)


Gmane