ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Lance Larsen" <lance.c.larsen@gmail.com>
To: <ntg-context@ntg.nl>
Subject: NTG-context] How to hack the lua files
Date: Mon, 17 Jun 2013 07:25:21 -0600	[thread overview]
Message-ID: <51bf0e46.301a420a.0a74.7d69@mx.google.com> (raw)
In-Reply-To: <mailman.1203.1370614292.2084.ntg-context@ntg.nl>

Hans,

Thankyou for your suggestion of using the \usereferences tag to reference
formulas in another document. This is a good solution. However the example
below doesn't give usable results because the references to the external
formula output by test2.tex does not include the chapter number:

test1.tex:
-------------
\starttext
\chapter{Chapter 1}
\placeformula[one] \startformula x = y \stopformula
\placeformula[two] \startformula y = z \stopformula
\chapter{Chapter 2}
\placeformula[three] \startformula z = x \stopformula
\stoptext


test2.tex:
--------------
\usereferences[test1.tex]
\starttext
\in{formula}[test1.tex::one]
\in{formula}[test1.tex::two]
\in{formula}[test1.tex::three]
\stoptext

In the output of test1.tex, the formulas are labeled (1.1), (1.2), and
(2.1). In the output of test2.tex the references are labeled 'formula 1',
'formula 2', and 'formula 1' (i.e. the section number is not included).

Using the \usereferences tag works if I label formulas 'bytext' rather than
by 'bysection' and turn off chapter prefixes in test1.tex using the
following at the start of the document:

\setupformulae[way=bytext,prefixsegments=None]

I would really prefer to maintain numbering by section, but to do this, I
need test2.tex to show external references in the same way as test1.tex (by
including the section number in front of the equation number). Is there a
way to do this at present? If not, labeling formulas 'bytext' will work for
now even if it isn't ideal.

-Lance Larsen


On 6/7/2013 4:01 PM, Lance Larsen wrote:
> luigi,
>
> When I started exploring how to map equation references (eq:name) to
> equation numbers (4.2), I noticed that the 'tuc' file included the
equation
> reference (eq:name), but I was not able to identify anywhere where it
> indicates the actual equation label specified in the document. Below is an
> example of the tuc output. 'eq:DVOL_RVI_17' is equation (4.28) in the
> document:
>
> {
>    ["metadata"]=142,
>    ["numberdata"]=237,
>    ["prefixdata"]=11,
>    ["references"]={
>     ["block"]="bodypart",
>     ["internal"]=122,
>     ["realpage"]=47,
>     ["reference"]="eq:DVOL_RVI_17",
>     ["section"]=79,
>    },
>   }
>
> There is nowhere in the tuc file that contains 4 and 28 near each other. I
> checked this for other equations as well and concluded that the tuc file
> does not contain the actual equation numbers that are used.

because there are indirect references to for instance 'numberdata' where 
this info sits

> If I am missing something or you have any other suggestions that might
help
> me to extract this info, I would sure appreciate the help.

see previous mail

btw, if you just want to use references in another tex doc, this will do 
the trick:

\usereferences[somedoc]

\starttext

     \in{formula}[somedoc::a]

     \in{formula}[somedoc::b]

\stoptext



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


       reply	other threads:[~2013-06-17 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1203.1370614292.2084.ntg-context@ntg.nl>
2013-06-17 13:25 ` Lance Larsen [this message]
2013-06-17 21:23   ` Hans Hagen
     [not found] <mailman.1335.1371485315.2084.ntg-context@ntg.nl>
2013-06-18 21:25 ` Lance Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51bf0e46.301a420a.0a74.7d69@mx.google.com \
    --to=lance.c.larsen@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).