Subject: mailing-list for TeXmacs Users
List archive
From : Joris van der Hoeven <address@hidden>- To: Javier Arántegui <address@hidden>
- Cc: <address@hidden>
- Subject: Re: [TeXmacs] Question about BibTex
- Date: Fri, 15 Oct 2004 11:33:55 +0200 (CEST)
On Fri, 15 Oct 2004, Javier Arántegui wrote:
> El Jueves, 14 de Octubre de 2004 19:59, Joris van der Hoeven escribió:
> > > The problem is the first one. Using this macro I get things like 'Dunne
> > > and Kluter(2001)' or 'Evrendilek et al.(2004)Evrendilek, Zhang, and
> > > Ritcher' where I put a 'cite'. I would be happy if I could add an space
> > > between the authors and the year ('Dunne and Kutler (2001)' and if I
> > > could remove the list of authors after the year in the second example.
> > > Any hint of how can I do it?
> >
> > I think that this one is not very easy, since it requires some rewriting
> > of the markup. I suggest you to use an extern scheme command for this.
> > There are a few examples of these in the standard files, like the macro
> > TeXmacs-version. Please let me know if you manage to hack something ;^)
>
> The problem is I don't know anything about Scheme. But after reading some
> more
> documentation I tried a fast'n'dirty solution. Now I'm focused on how to
> include an space between the authors and the year as in the first example.
> To
> do I have tried to write the following macro (citet as alternative of cite):
>
> (assign "citet" (macro "ref" (equal (arg "ref0") (cite (arg "ref")))(range
> (arg "ref0") (eval "0") (minus (length (arg "ref0")) "6"))" "(range (arg
> "ref0") (minus (length (arg "ref0")) "6")(legth (arg "ref0")))))
> [I hope I copied it correctly because copy and paste didn't work between
> TeXmacs and kmail.]
>
> The idea of the macro is take the cite and split it in two parts separated
> by
> one space. The first part is from the beggining until the total length of
> the
> string minus 6, 4 figures of the year and (). The second part is the total
> length minus 6 to the end of the cite. Well, this is what I wanted but it
> doesn't work. Could you give a hand and tell what's wrong?
It seems that you are confusing ref and ref0.
More seriously, at this point you did not really use Scheme, but just the
TeXmacs macro language. The macro language is suitable for simple macros,
but not for more complex string rewriting as you try to do here. In order
to do what you want, you have to use the "extern" primitive, which allows
you to use any piece of scheme in order to compute the result of your macro.
The scheme function can be defined in your my-texmacs-init.scm and you
should define it to be secure. Once again: search for TeXmacs-version
in the sources and look how it works for this one.
I agree that this way of doing things is a bit complicated; I might
add some more routines for dealing with strings to the macro language
(like searching the index for the "(" character in your example).
However, once you understand how to interact with Scheme, you will
also recognize the huge pour of our approach, and you will probably
be able to do many other interesting things.
Best wishes, Joris
- Re: [TeXmacs] Question about BibTex, Joris van der Hoeven, 10/14/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/14/2004
- Re: [TeXmacs] Question about BibTex, Joris van der Hoeven, 10/14/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/15/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/15/2004
- Re: [TeXmacs] Question about BibTex, Joris van der Hoeven, 10/15/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/18/2004
- Re: [TeXmacs] Question about BibTex, Karl Hegbloom, 10/19/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/19/2004
- Re: [TeXmacs] Question about BibTex, Karl Hegbloom, 10/19/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/18/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/15/2004
- Re: [TeXmacs] Question about BibTex, Joris van der Hoeven, 10/14/2004
- Re: [TeXmacs] Question about BibTex, Javier Arántegui, 10/14/2004
Archive powered by MHonArc 2.6.19.