Hi all,

I'm struggling with reftex in order to make it parse a custom macro of
mine which has an optional label arg.  The info docs have a pretty
example of almost the same I'm trying to achieve:

,----[ (info "(reftex)Figure Wrapper") ]
|      \myfig[htp]{filename}{caption text}{label}{1}
| 
|    Now we need to tell RefTeX that the fourth argument of the ‘\myfig’
| macro _is itself_ a figure label, and where to find the context.
| 
|      (setq reftex-label-alist
|            '(("\\myfig[]{}{}{*}{}" ?f nil nil 3)))
`----

Ok, but my macro looks like so:

  %% Definition
  \NewDocumentCommand\apidoc{m m m v o}{...}
  %% Usage
  \apidoc{Function}{namespaceX}{fname}|arg1,arg2 arg2|[label1,label2]

The problems are that

  1) the 4th macro argument is a verbatim one that's enclosed with ||
     instead of {} or [] which seems to be hard-coded in reftex.
     (Actually, it could be enclosed with any pair of same char but I
     stick to the pipes.)

  2) the 5th argument is optional and can be a comma-separated list of
     labels, not just one label.

Is there any chance to make reftex collect those labels?

Currently, I just have my own parsing function that's run by an :after
advice to `reftex-do-parse' which stuffs the label information directly
in the `reftex-docstruct-symbol' var.  Of course, then the labels aren't
at the right positions (marked as LOST LABEL) and won't show up in
*RefTeX Select* buffers.  But at least I can TAB-complete them in there
which is better than nothing.

Bye,
Tassilo


_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex

Reply via email to