Zarko F. Cucej | 6 May 2012 23:30
Picon

tikz in-line picture in caption

Hi!
as part of caption I like to describe some symbols drawn by TikZ used in 
picture (see minimal exmple below), but for any in-line tikz picture i 
receive error:

! Use of \pgf <at> arrowsdeclarecombine <at> star doesn't match its definition.
\pgfutil <at> ifnextchar ...1\def \pgfutil <at> reserved <at> a {

#2}\def\pgfutil <at> reserved <at> ...

in preamble of document I have also declared

\pgfarrowsdeclarecombine[\pgflinewidth]
{hastype}{hastype}{triangle 45}{triangle 45}{triangle 45}{triangle 45}

for needs in driving some diagrams (there work fine as well in in-line 
tikz picture in text). if I comment above definition, then i receive error:

! Argument of \tikz <at> style <at> parseA has an extra }.

I wonder, if caption doesn't allow to use TikZ in-line pictures in 
caption text at all or I doing something wrong? Do anyone know a 
solution for my problem?

regards,     Zarko

minimal example:
     \documentclass{memoir}

     \usepackage{TikZ}
(Continue reading)

Mark Wibrow | 7 May 2012 07:52
Picon

Re: tikz in-line picture in caption

Hi,

I can't remember the exact reason why this happens, but the following 
fixes it:

\def\thistikzcaption{\tikz[arrow-1]\node[A=white]{};}

\caption{Sparse time-base. Sparse events \protect\thistikzcaption\ are 
only allowed to occur within the intervals $\pi$}

although I'm not sure what scope the protected macro should have (it 
works in this case with the local definition just before \caption).

Regards

Mark
On 06/05/12 22:30, Zarko F. Cucej wrote:
> \documentclass{memoir}
>
>       \usepackage{TikZ}
>       \usetikzlibrary{arrows,shapes}
>       \tikzset{arrow-1/.style = {
> A/.style = {shape=single arrow, sharp corners, draw, thin, rotate=-90,
>               fill=##1,
>               minimum height=5mm, minimum width=3mm, single arrow head
> extend=0.5mm,
>               inner sep=1pt, anchor=east},
>                                   }
>               }
> \pgfarrowsdeclarecombine[\pgflinewidth]
(Continue reading)


Gmane