ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Using a tikz package
@ 2009-06-15 18:35 Maurí­cio
  2009-06-15 18:48 ` Mojca Miklavec
  0 siblings, 1 reply; 4+ messages in thread
From: Maurí­cio @ 2009-06-15 18:35 UTC (permalink / raw)
  To: ntg-context

I would like to use this package for
drawing circuits:

http://home.dei.polimi.it/mredaelli/circuitikz/index.html

The examples are in Latex, but I imagine it
could be used in ConTeXt since it's written
using Tikz.

How can I do that? The recomended instalation
procedure at the website is to just uncompress
everything in texmf-local directory, but that
creates a 'latex' directory that I imagine
ConTeXt won't use.

Thanks,
Maurício

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using a tikz package
  2009-06-15 18:35 Using a tikz package Maurí­cio
@ 2009-06-15 18:48 ` Mojca Miklavec
  2009-06-15 19:52   ` Re : " Flavien Lambert
       [not found]   ` <1245092337.23064.72.camel@casa>
  0 siblings, 2 replies; 4+ messages in thread
From: Mojca Miklavec @ 2009-06-15 18:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: mredaelli

On Mon, Jun 15, 2009 at 20:35, Maurí­cio wrote:
> I would like to use this package for
> drawing circuits:
>
> http://home.dei.polimi.it/mredaelli/circuitikz/index.html
>
> The examples are in Latex, but I imagine it
> could be used in ConTeXt since it's written
> using Tikz.
>
> How can I do that? The recomended instalation
> procedure at the website is to just uncompress
> everything in texmf-local directory, but that
> creates a 'latex' directory that I imagine
> ConTeXt won't use.

Hello Maurí­cio,

You'll need to convince the author to make a generic package.

I'm not sure if he's familiar with ConTeXt or not. The changes that
are needed might be doable in reasonable amount of time (from my first
impression there are not too many LaTeX-specific commands present),
but the package won't work out of the box as it stands at the moment.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re :  Using a tikz package
  2009-06-15 18:48 ` Mojca Miklavec
@ 2009-06-15 19:52   ` Flavien Lambert
       [not found]   ` <1245092337.23064.72.camel@casa>
  1 sibling, 0 replies; 4+ messages in thread
From: Flavien Lambert @ 2009-06-15 19:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: mredaelli

If you convince him to do so, I would also be grateful since
electrical circuits are the only missing piece for me to convert all
the exercises for my students from LaTeX to ConTeXt!
Regards,

2009/6/15, Mojca Miklavec <mojca.miklavec.lists@gmail.com>:
> On Mon, Jun 15, 2009 at 20:35, Maurí­cio wrote:
>> I would like to use this package for
>> drawing circuits:
>>
>> http://home.dei.polimi.it/mredaelli/circuitikz/index.html
>>
>> The examples are in Latex, but I imagine it
>> could be used in ConTeXt since it's written
>> using Tikz.
>>
>> How can I do that? The recomended instalation
>> procedure at the website is to just uncompress
>> everything in texmf-local directory, but that
>> creates a 'latex' directory that I imagine
>> ConTeXt won't use.
>
> Hello Maurí­cio,
>
> You'll need to convince the author to make a generic package.
>
> I'm not sure if he's familiar with ConTeXt or not. The changes that
> are needed might be doable in reasonable amount of time (from my first
> impression there are not too many LaTeX-specific commands present),
> but the package won't work out of the box as it stands at the moment.
>
> Mojca
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>


-- 
Flavien.
----------------------------
"Quantum objects are completely crazy but, at least, they are all
crazy in the same way." R.P. Feynman.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using a tikz package
       [not found]   ` <1245092337.23064.72.camel@casa>
@ 2009-06-15 19:55     ` Mojca Miklavec
  0 siblings, 0 replies; 4+ messages in thread
From: Mojca Miklavec @ 2009-06-15 19:55 UTC (permalink / raw)
  To: Massimo Redaelli; +Cc: mailing list for ConTeXt users

On Mon, Jun 15, 2009 at 20:58, Massimo Redaelli wrote:

Dear Massimo,

Thanks a lot for such a quick response.

>     thanks for letting me know about this. I am certainly willing to
> fix it, but my knowledge of Context is null.

My knowlegde of LaTeX equals that as well, so ... :) :) :)

I'm putting this back to the mailing list since I should be studying
instead of playing with TeX now ...

> Could you suggest to me a good starting point to find out differences
> and incompatibilities of Latex and Context?

ConTeXt knows and respects 99% of plain TeX commands. So only
LaTeX-specific ones will need to be fixed. I suggest to take a look at
pgfplots or TikZ package itself to see how the differences are
implemented. If you are ready to adapth the package to ConTeX, plain
TeX support could be done at the same time for no extra cost, I guess.

I suspect that almost all of your code works out of the box already
anyway. These are the most obvious exceptions, but I didn't inspect
closely enough, so there might be others:

\NeedsTeXFormat -> no equivalent in ConTeXt (and is not needed)
\RequirePackage{name} -> \usemodule[name]
\RequirePackage{xstring} -> no idea what it does; it might be that the
functionality of this package will have to be adapted/implemented in
ConTeXt or something else will have to be done
\DeclareOption -> it might be that this needs to be implemented in
semi-low-level ConTeXt (you'll get help on this mailing list); maybe
that's the most work, but once you have a single example you just
copy-paste
\ExecuteOptions
\ProcessOptions
\newcommand -> in ConTeXt one would use the "plain-TeX" \def\commandname#1#2...

\newenvironment{circuitikz}{
\begin{tikzpicture}}{\end{tikzpicture}}
->
\long\def\startcircuitikz#1\stoptikzcircuitikz{\starttikzpicture#1\stoptikzpicture}

You can take a look at pgfplots for example. They put all the code to
tex/generic/pgfplots and only a single file to tex/latex/pgfplots. The
beginning of circuitikz.sty should go to
tex/latex/circuitikz/circuitikz.sty, while the "contents" of that file
and probably all other files should better have the ending "tex" and
go to tex/generic/circuitikz/...(I don't know exact conventions of
tikz).code.tex and you should create a file in
tex/context/third/circuitikz/t-circuitikz.tex that starts
approximately like this:

% some nice header, but you may worry about that later
\def\pgfcircversion{0.2.1}
\writestatus{loading}{2009/04/17 The CircuiTikz circuit drawing
package version \pgfcircversion}
\startmodule[circuitikz]

\unprotect % this sets the catcodes of @ and ! to letter (if needed)

\usemodule[tikz]
\usetikzlibrary[calc]
\usepgflibrary[decorations.pathmorphing]

% maybe some ConTeXt-specific initialisations

% load all the generic file(s) that you need
\input nameofyourfile.code.tex

% define the environment
\long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture}

\stopmodule

\protect \doifnotmode{demo}{\endinput}
% you may put some simple sample document below

In order to test the package:

% \usemodule[tikz] % maybe you don't need this if you load circuitikz already
\usemodule[circuitikz][american]
\starttext
\startcircuitikz
....
\stopcircuitikz
\stoptext

But I'm sure that the list will help you further with implementation details ...

Mojca


> On Mon, 2009-06-15 at 20:48 +0200, Mojca Miklavec wrote:
>> On Mon, Jun 15, 2009 at 20:35, Maurí­cio wrote:
>> > I would like to use this package for
>> > drawing circuits:
>> >
>> > http://home.dei.polimi.it/mredaelli/circuitikz/index.html
>> >
>> > The examples are in Latex, but I imagine it
>> > could be used in ConTeXt since it's written
>> > using Tikz.
>> >
>> > How can I do that? The recomended instalation
>> > procedure at the website is to just uncompress
>> > everything in texmf-local directory, but that
>> > creates a 'latex' directory that I imagine
>> > ConTeXt won't use.
>>
>> Hello Maurí­cio,
>>
>> You'll need to convince the author to make a generic package.
>>
>> I'm not sure if he's familiar with ConTeXt or not. The changes that
>> are needed might be doable in reasonable amount of time (from my first
>> impression there are not too many LaTeX-specific commands present),
>> but the package won't work out of the box as it stands at the moment.
>>
>> Mojca
>
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-15 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-15 18:35 Using a tikz package Maurí­cio
2009-06-15 18:48 ` Mojca Miklavec
2009-06-15 19:52   ` Re : " Flavien Lambert
     [not found]   ` <1245092337.23064.72.camel@casa>
2009-06-15 19:55     ` Mojca Miklavec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).