TiKZ & exceltex

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

TiKZ & exceltex

by Walter Cazzola :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear TiKZ experts,
I'm trying to get some data from an excel file and use them as a
parameter for the \draw command but I got this message:

   [Loading MPS to PDF converter (version 2006.09.02).]
   ) ABD: EveryShipout initializing macros
   ! Missing \endcsname inserted.
   <to be read again>
                      \csname\endcsname
   l.13     }

   ?

and no pdf is generated and in worst case I also get an infinite loop.

The following is a short example of the problem:

   \documentclass[10pt,svgnames]{article}
   \usepackage{color} % used by exceltex
   \usepackage{exceltex}

   \usepackage{tikz}
   \usepackage{pgffor}

   \begin{document}

   \begin{tikzpicture}[]
      \foreach \x/\y/\step in {0.5/0.5/1, 10/0.5/2, 19.5/0.5/3}{
         \draw[{\inccell{dati.xls!ECOOP09!C1}}, line width=.2cm, rounded corners=7pt] (\x cm+.25cm,\y cm+.25cm) rectangle +(8.5,5.5) ;
      }
   \end{tikzpicture}

   \end{document}

in this case the content of the excel is a color name such as Gold Teal
and so on.

Any idea? Any help is really appreciated.

Thank you in Advance for the help

Cheers
Walter

--
Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
· · · ---------------------------- · · · ---------------------------- · · ·
                ... recursive: adjective, see recursive ...
· · · ---------------------------- · · · ---------------------------- · · ·
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: TiKZ & exceltex

by Mark Wibrow-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I really don't know exceltex, but simply by looking at the internals
of \inccell using \show, I predict with some confidence that the
approach you are trying will never work.

Essentially you are trying to input file contents `on-line' whilst the
key is being processed which can't be done.

Sorry

Mark


2009/6/20 Walter Cazzola <cazzola@...>:

> Dear TiKZ experts,
> I'm trying to get some data from an excel file and use them as a
> parameter for the \draw command but I got this message:
>
>  [Loading MPS to PDF converter (version 2006.09.02).]
>  ) ABD: EveryShipout initializing macros
>  ! Missing \endcsname inserted.
>  <to be read again>
>                     \csname\endcsname
>  l.13     }
>
>  ?
>
> and no pdf is generated and in worst case I also get an infinite loop.
>
> The following is a short example of the problem:
>
>  \documentclass[10pt,svgnames]{article}
>  \usepackage{color} % used by exceltex
>  \usepackage{exceltex}
>
>  \usepackage{tikz}
>  \usepackage{pgffor}
>
>  \begin{document}
>
>  \begin{tikzpicture}[]
>     \foreach \x/\y/\step in {0.5/0.5/1, 10/0.5/2, 19.5/0.5/3}{
>        \draw[{\inccell{dati.xls!ECOOP09!C1}}, line width=.2cm, rounded
> corners=7pt] (\x cm+.25cm,\y cm+.25cm) rectangle +(8.5,5.5) ;
>     }
>  \end{tikzpicture}
>
>  \end{document}
>
> in this case the content of the excel is a color name such as Gold Teal
> and so on.
>
> Any idea? Any help is really appreciated.
>
> Thank you in Advance for the help
>
> Cheers
> Walter
>
> --
> Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
> E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
> · · · ---------------------------- · · · ---------------------------- · · ·
>               ... recursive: adjective, see recursive ...
> · · · ---------------------------- · · · ---------------------------- · · ·
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge
> conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference:
> $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> pgf-users mailing list
> pgf-users@...
> https://lists.sourceforge.net/lists/listinfo/pgf-users
>
>

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: TiKZ & exceltex

by Walter Cazzola-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Mark
thanks for your reply.

On Mon, 22 Jun 2009, Mark Wibrow wrote:

> I really don't know exceltex, but simply by looking at the internals
> of \inccell using \show,

this sounds interesting, could you explain me how to use \show? just a
small example will help.

> I predict with some confidence that the approach you are trying will
> never work.

> Essentially you are trying to input file contents `on-line' whilst the
> key is being processed which can't be done.

Well, from the little I can understand of LaTeX/TeX pdflatex just mark
in .aux file which cells are necessary and a perl script extract the
data from the excel, write them one for a file that will be input in the
second pdlatex run. So the data are not extracted on-the-fly. I hope
this gives me some more hope.

In the meanwhile I tracked down the problem as an incompatibility of
(x)color (that should be used by \draw) and exceltex since if I put the
data extracted from the excel file somewhere else it works. For example

   \documentclass[10pt,svgnames]{article}
   \usepackage{color} % used by exceltex
   \usepackage{exceltex}

   \usepackage{tikz}
   \usepackage{pgffor}

   \begin{document}

     \begin{tikzpicture}[] {
             \draw[Gold, line width=.2cm, rounded corners=7pt] (.25cm,.25cm) rectangle +(8.5,5.5) node {{\inccell{dati.xls!ECOOP09!C1}}};
       }
     \end{tikzpicture}
     \textcolor{{\inccell{dati.xls!ECOOP09!C1}}}{Hello World!!!}
   \end{document}

the first occurrence of \inccel works smootly but the second one crashes
with the message:

   [Loading MPS to PDF converter (version 2006.09.02).]
   ) ABD: EveryShipout initializing macros (./crap-excltx/c-1)
   ! Missing \endcsname inserted.
   <to be read again>
                      \csname\endcsname
   l.14 ...ell{dati.xls!ECOOP09!C1}}}{Hello World!!!}

   ?

any more idea?

Cheers

Walter

--
Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
· · · ---------------------------- · · · ---------------------------- · · ·
                ... recursive: adjective, see recursive ...
· · · ---------------------------- · · · ---------------------------- · · ·
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: TiKZ & exceltex

by Mark Wibrow-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

\show\inccell

then look in the log file.

What you get is a definition like this

\stepcounter {exceltexCounterC}
\ifx \cellrefs \undefined \immediate \write 10{c:\theexceltexCounterC :#1}
\InputIfFileExists {\jobname -excltx/c-\theexceltexCounterC }{}{}
\else \immediate \write 10{c:#1}\InputIfFileExists {\jobname
-excltx/c-#1}{}{}\fi

This is fine in the normal course of LaTeX processing (which is what
you get inside a node as TikZ "escapes" to LaTeX for the node
contents). But when you throw all of that into the key parser, or as
an argument to the color macros, it is not (as far as I know) ever
going to work.

Regards

Mark

2009/6/22 Walter Cazzola <cazzola@...>:

> Dear Mark thanks for your reply.
>
> On Mon, 22 Jun 2009, Mark Wibrow wrote:
>
>> I really don't know exceltex, but simply by looking at the internals
>> of \inccell using \show,
>
> this sounds interesting, could you explain me how to use \show? just a
> small example will help.
>
>> I predict with some confidence that the approach you are trying will
>> never work.
>
>> Essentially you are trying to input file contents `on-line' whilst the
>> key is being processed which can't be done.
>
> Well, from the little I can understand of LaTeX/TeX pdflatex just mark
> in .aux file which cells are necessary and a perl script extract the
> data from the excel, write them one for a file that will be input in the
> second pdlatex run. So the data are not extracted on-the-fly. I hope
> this gives me some more hope.
>
> In the meanwhile I tracked down the problem as an incompatibility of
> (x)color (that should be used by \draw) and exceltex since if I put the
> data extracted from the excel file somewhere else it works. For example
>
>  \documentclass[10pt,svgnames]{article}
>  \usepackage{color} % used by exceltex
>  \usepackage{exceltex}
>
>  \usepackage{tikz}
>  \usepackage{pgffor}
>
>  \begin{document}
>
>    \begin{tikzpicture}[] {
>            \draw[Gold, line width=.2cm, rounded corners=7pt] (.25cm,.25cm)
> rectangle +(8.5,5.5) node {{\inccell{dati.xls!ECOOP09!C1}}};
>      }
>    \end{tikzpicture}
>    \textcolor{{\inccell{dati.xls!ECOOP09!C1}}}{Hello World!!!}
>  \end{document}
>
> the first occurrence of \inccel works smootly but the second one crashes
> with the message:
>
>  [Loading MPS to PDF converter (version 2006.09.02).]
>  ) ABD: EveryShipout initializing macros (./crap-excltx/c-1)
>  ! Missing \endcsname inserted.
>  <to be read again>
>                     \csname\endcsname
>  l.14 ...ell{dati.xls!ECOOP09!C1}}}{Hello World!!!}
>
>  ?
>
> any more idea?
>
> Cheers
>
> Walter
>
> --
> Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
> E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
> · · · ---------------------------- · · · ---------------------------- · · ·
>               ... recursive: adjective, see recursive ...
> · · · ---------------------------- · · · ---------------------------- · · ·

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: TiKZ & exceltex

by Walter Cazzola :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ouch, I see, do you know some trick to put it in something (I've already
tried to put it in a \newsavebox without success) that I can use later
in the color definition of \draw?

Cheers
Walter

On Mon, 22 Jun 2009, Mark Wibrow wrote:

> Hi,
>
> \show\inccell
>
> then look in the log file.
>
> What you get is a definition like this
>
> \stepcounter {exceltexCounterC}
> \ifx \cellrefs \undefined \immediate \write 10{c:\theexceltexCounterC :#1}
> \InputIfFileExists {\jobname -excltx/c-\theexceltexCounterC }{}{}
> \else \immediate \write 10{c:#1}\InputIfFileExists {\jobname
> -excltx/c-#1}{}{}\fi
>
> This is fine in the normal course of LaTeX processing (which is what
> you get inside a node as TikZ "escapes" to LaTeX for the node
> contents). But when you throw all of that into the key parser, or as
> an argument to the color macros, it is not (as far as I know) ever
> going to work.
>
> Regards
>
> Mark
>
> 2009/6/22 Walter Cazzola <cazzola@...>:
>> Dear Mark thanks for your reply.
>>
>> On Mon, 22 Jun 2009, Mark Wibrow wrote:
>>
>>> I really don't know exceltex, but simply by looking at the internals
>>> of \inccell using \show,
>>
>> this sounds interesting, could you explain me how to use \show? just a
>> small example will help.
>>
>>> I predict with some confidence that the approach you are trying will
>>> never work.
>>
>>> Essentially you are trying to input file contents `on-line' whilst the
>>> key is being processed which can't be done.
>>
>> Well, from the little I can understand of LaTeX/TeX pdflatex just mark
>> in .aux file which cells are necessary and a perl script extract the
>> data from the excel, write them one for a file that will be input in the
>> second pdlatex run. So the data are not extracted on-the-fly. I hope
>> this gives me some more hope.
>>
>> In the meanwhile I tracked down the problem as an incompatibility of
>> (x)color (that should be used by \draw) and exceltex since if I put the
>> data extracted from the excel file somewhere else it works. For example
>>
>>  \documentclass[10pt,svgnames]{article}
>>  \usepackage{color} % used by exceltex
>>  \usepackage{exceltex}
>>
>>  \usepackage{tikz}
>>  \usepackage{pgffor}
>>
>>  \begin{document}
>>
>>    \begin{tikzpicture}[] {
>>            \draw[Gold, line width=.2cm, rounded corners=7pt] (.25cm,.25cm)
>> rectangle +(8.5,5.5) node {{\inccell{dati.xls!ECOOP09!C1}}};
>>      }
>>    \end{tikzpicture}
>>    \textcolor{{\inccell{dati.xls!ECOOP09!C1}}}{Hello World!!!}
>>  \end{document}
>>
>> the first occurrence of \inccel works smootly but the second one crashes
>> with the message:
>>
>>  [Loading MPS to PDF converter (version 2006.09.02).]
>>  ) ABD: EveryShipout initializing macros (./crap-excltx/c-1)
>>  ! Missing \endcsname inserted.
>>  <to be read again>
>>                     \csname\endcsname
>>  l.14 ...ell{dati.xls!ECOOP09!C1}}}{Hello World!!!}
>>
>>  ?
>>
>> any more idea?
>>
>> Cheers
>>
>> Walter
>>
>> --
>> Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
>> E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
>> · · · ---------------------------- · · · ---------------------------- · · ·
>>               ... recursive: adjective, see recursive ...
>> · · · ---------------------------- · · · ---------------------------- · · ·
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> pgf-users mailing list
> pgf-users@...
> https://lists.sourceforge.net/lists/listinfo/pgf-users
>
--
Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
· · · ---------------------------- · · · ---------------------------- · · ·
                ... recursive: adjective, see recursive ...
· · · ---------------------------- · · · ---------------------------- · · ·
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: TiKZ & exceltex

by Hans Meine-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Montag 22 Juni 2009, Walter Cazzola wrote:
> Ouch, I see, do you know some trick to put it in something (I've already
> tried to put it in a \newsavebox without success) that I can use later
> in the color definition of \draw?

AFAICS, you can simply use \def outside the figure, and then put everything
together inside TikZ.  But that might not be the best solution yet.

If you need many values, maybe you can even use PGF's lists for storing the
values.

HTH,
  Hans


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

signature.asc (204 bytes) Download Attachment

Re: TiKZ & exceltex

by Walter Cazzola :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Hans,
thanks for the reply

On Tue, 23 Jun 2009, Hans Meine wrote:

> On Montag 22 Juni 2009, Walter Cazzola wrote:
>> Ouch, I see, do you know some trick to put it in something (I've already
>> tried to put it in a \newsavebox without success) that I can use later
>> in the color definition of \draw?

> AFAICS, you can simply use \def outside the figure, and then put everything
> together inside TikZ.  But that might not be the best solution yet.

unfortunately something like

   \def\crap{\inccell{dati.xls!C1}}
   \tikz \draw[draw=\crap] (.25cm,.25cm) rectangle +(8.5,5.5) ;

doesn't work.

At last I've discovered that it isn't a TikZ issue but a (x)color issue:
the clash is related to the use of the data from the spreadsheet in a
color definition/usage.

Cheers
Walter

--
Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
· · · ---------------------------- · · · ---------------------------- · · ·
                ... recursive: adjective, see recursive ...
· · · ---------------------------- · · · ---------------------------- · · ·
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: TiKZ & exceltex

by Hans Meine-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My fault. I should have written \edef.

HTH

(The above has been typed using a small on-screen keyboard, which may  
account for any typos,  briefness or bad formatting.)

Am 23.06.2009 um 15:57 schrieb Walter Cazzola <cazzola@...>:

> Hi Hans,
> thanks for the reply
>
> On Tue, 23 Jun 2009, Hans Meine wrote:
>
>> On Montag 22 Juni 2009, Walter Cazzola wrote:
>>> Ouch, I see, do you know some trick to put it in something (I've  
>>> already
>>> tried to put it in a \newsavebox without success) that I can use  
>>> later
>>> in the color definition of \draw?
>
>> AFAICS, you can simply use \def outside the figure, and then put  
>> everything
>> together inside TikZ.  But that might not be the best solution yet.
>
> unfortunately something like
>
>  \def\crap{\inccell{dati.xls!C1}}
>  \tikz \draw[draw=\crap] (.25cm,.25cm) rectangle +(8.5,5.5) ;
>
> doesn't work.
>
> At last I've discovered that it isn't a TikZ issue but a (x)color  
> issue:
> the clash is related to the use of the data from the spreadsheet in a
> color definition/usage.
>
> Cheers
> Walter
>
> --
> Walter Cazzola, PhD - Assistant Professor, DICo, University of Milano
> E-mail cazzola@... Ph.: +39 02 503 16300  Fax: +39 02 503 16253
> · · · ---------------------------- · · ·  
> ---------------------------- · · ·
>               ... recursive: adjective, see recursive ...
> · · · ---------------------------- · · ·  
> ---------------------------- · · ·

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users