Skip to Content.
Sympa Menu

texmacs-users - Help with scheme functions

Subject: mailing-list for TeXmacs Users

List archive

Help with scheme functions


Chronological Thread 
  • From: Amit Dubey <address@hidden>
  • To: address@hidden
  • Subject: Help with scheme functions
  • Date: Mon, 25 Oct 2004 00:29:29 +0200 (MEST)


Hi list,

If anyone has *any* experience with scheme in TeX, I'd appreciate
*any* kind of help. The documentation (prim-style-misc.en.tm) does
not appear to be correct. The example in the last line of the first
paragraph reads "<error|insecure script>" unless "Accept all scripts" is
activated. Later on, the documetation suggetss the ":secure" option can be
used to overcome such errors, but it does not specific *what* this is an
option
for. Some digging showed that this is an option to "tm-define", but
it is not clear how I can use tm-define in this context.

A little bit more on what I'm trying to do: I want to implement a
TeXmacs interface to natbib. Natbib returns citations in the form:

Foo et al.(2004b)Foo, Bar and Snafu

TeXmacs turns this in to:

Foo et al.(2004<natbib|b>)Foo, Bar and Snafu

Ideally, I'd like to have several macros which return formatted citations:

\citenew{foo:ea:04b} => "Foo, Bar and Snafu (2004b)"
\citep{foo:ea:04b} => "(Foo et al., 2004b)"
\citet{foo:ea:04b} => "Foo et al. (2004b)"

Of course, there are variations of these. The general approach I plan
to use is the following:

1. Use a TeXmacs macro to call \cite
2. Pass the resulting tree to a scheme function in my-texmacs-init.scm
3. Have the scheme function put the tree in to the proper format
4. Return the resulting tree to the calling macro.

In addition to the problems above, I don't know how to do #2 or #3.
This is not entirely true: using _strings_ instead of trees, I can
do #3, but of course, this is not the way TeXmacs works :(
I'm not even entirely sure what the tree representation is for:

Foo et al.(2004<natbib|b>)Foo, Bar and Snafu

If no one can help with #3, I might be able to call the scheme
functions from \render-cite (which I think allows me to operate on text...).
But then I still need to figure out how to make the scripts secure...

I'll play a bit more w/ the tree representation and report on my
successes/failures. *But*, please, if you have *any* pointers,
*any* help would be appreciated.

Thanks,
Amit Dubey





Archive powered by MHonArc 2.6.19.

Top of Page