* definereferencestructureprefix for floats
@ 2015-06-20 16:22 Aditya Mahajan
2015-06-20 16:48 ` Wolfgang Schuster
0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2015-06-20 16:22 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
How does one control the referenceprefix for floats. I want to refer to
the figures as only Fig 1, Fig 2, etc, even when they are numbered 1.1,
1.2, etc.
The example from strc-ref.mkvi does not work (I get 1.I-A.1 and 1.I-A.2)
\defineconversionset[default][Character,number,Romannumerals,Character][number]
\defineseparatorset [default][.,.,--][.]
\setuphead[subsection][sectionstopper=),sectionsegments=4:4]
\setupreferencestructureprefix[default][prefixsegments=2:4]
\setupreferencestructureprefix[figure][default][prefixsegments=3:4]
\starttext
\chapter {One}
\section {One}
\subsection[sec:test]{Two}
See \in[sec:test] and \in[fig:xx] and \in[fig:yy]
\placefigure[here][fig:xx]{}{}
\placefigure[here][fig:yy]{}{}
\stoptext
Thanks,
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-20 16:22 definereferencestructureprefix for floats Aditya Mahajan
@ 2015-06-20 16:48 ` Wolfgang Schuster
2015-06-22 3:30 ` Aditya Mahajan
0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2015-06-20 16:48 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 803 bytes --]
> Aditya Mahajan <mailto:adityam@umich.edu>
> 20. Juni 2015 18:22
> Hi,
>
> How does one control the referenceprefix for floats. I want to refer
> to the figures as only Fig 1, Fig 2, etc, even when they are numbered
> 1.1, 1.2, etc.
There is a typo in strc-ref.lua which can by fixed by the following changes.
local function getcurrentprefixspec(default)
local data = currentreference and currentreference.i
local metadata = data and data.metadata
print(metatadata and metadata.kind or "?")
return
- metatadata and metadata.kind or "?",
- metatadata and metadata.name or "?",
- default or "?"
+ metadata and metadata.kind or "?",
+ metadata and metadata.name or "?",
+ default or "?"
end
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 1963 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-20 16:48 ` Wolfgang Schuster
@ 2015-06-22 3:30 ` Aditya Mahajan
2015-06-22 3:35 ` Aditya Mahajan
0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2015-06-22 3:30 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Sat, 20 Jun 2015, Wolfgang Schuster wrote:
>
>> Aditya Mahajan <mailto:adityam@umich.edu>
>> 20. Juni 2015 18:22
>> Hi,
>>
>> How does one control the referenceprefix for floats. I want to refer to the
>> figures as only Fig 1, Fig 2, etc, even when they are numbered 1.1, 1.2,
>> etc.
> There is a typo in strc-ref.lua which can by fixed by the following changes.
Thank you. But even after make the appropriate change in strc-ref.lua (and
regenerating the format), the previous example does not give Fig 1, etc.
Am I missing something in the sttings?
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-22 3:30 ` Aditya Mahajan
@ 2015-06-22 3:35 ` Aditya Mahajan
2015-06-22 7:41 ` Wolfgang Schuster
0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2015-06-22 3:35 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Sun, 21 Jun 2015, Aditya Mahajan wrote:
> On Sat, 20 Jun 2015, Wolfgang Schuster wrote:
>
>>
>>> Aditya Mahajan <mailto:adityam@umich.edu>
>>> 20. Juni 2015 18:22
>>> Hi,
>>>
>>> How does one control the referenceprefix for floats. I want to refer to
> the
>>> figures as only Fig 1, Fig 2, etc, even when they are numbered 1.1, 1.2,
>>> etc.
>> There is a typo in strc-ref.lua which can by fixed by the following
> changes.
>
> Thank you. But even after make the appropriate change in strc-ref.lua (and
> regenerating the format), the previous example does not give Fig 1, etc.
>
> Am I missing something in the sttings?
Even the second example in strc-ref.mkvi does not work correctly.
\starttext
\chapter{test}
\placefigure[here][xx:1]{}{\framed{one}} \placefigure[here][xx:2]{}{\framed{three}}
\placetable [here][xx:3]{}{\framed{two}} \placetable [here][xx:4]{}{\framed{four}}
\start
\in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
\stop \blank \start
\setupreferencestructureprefix[default][prefix=no]
\in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
\stop \blank \start
\setupreferencestructureprefix[float][default][prefix=no]
\in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
\stop \blank \start
\setupreferencestructureprefix[figure][default][prefix=no]
\in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
\stop \blank
\stoptext
The second case, (\setup...[default][prefix=no]) works correctly, but the
last two cases (\setup...[float][default][prefix=no], etc) do not get rid
of the prefix.
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-22 3:35 ` Aditya Mahajan
@ 2015-06-22 7:41 ` Wolfgang Schuster
2015-06-22 15:34 ` Aditya Mahajan
0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2015-06-22 7:41 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1295 bytes --]
> Aditya Mahajan <mailto:adityam@umich.edu>
> 22. Juni 2015 05:35
> On Sun, 21 Jun 2015, Aditya Mahajan wrote:
>
>
> Even the second example in strc-ref.mkvi does not work correctly.
>
> \starttext
> \chapter{test}
> \placefigure[here][xx:1]{}{\framed{one}}
> \placefigure[here][xx:2]{}{\framed{three}}
> \placetable [here][xx:3]{}{\framed{two}} \placetable
> [here][xx:4]{}{\framed{four}}
> \start
> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and
> \in{tab}[xx:4]
> \stop \blank \start
> \setupreferencestructureprefix[default][prefix=no]
> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and
> \in{tab}[xx:4]
> \stop \blank \start
> \setupreferencestructureprefix[float][default][prefix=no]
> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and
> \in{tab}[xx:4]
> \stop \blank \start
> \setupreferencestructureprefix[figure][default][prefix=no]
> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and
> \in{tab}[xx:4]
> \stop \blank
> \stoptext
>
> The second case, (\setup...[default][prefix=no]) works correctly, but
> the last two cases (\setup...[float][default][prefix=no], etc) do not
> get rid of the prefix.
Did you fix the typo in strc-ref.lua and regenrate the format?
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 2437 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-22 7:41 ` Wolfgang Schuster
@ 2015-06-22 15:34 ` Aditya Mahajan
2015-06-22 15:44 ` Wolfgang Schuster
0 siblings, 1 reply; 9+ messages in thread
From: Aditya Mahajan @ 2015-06-22 15:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, 22 Jun 2015, Wolfgang Schuster wrote:
>
>> Aditya Mahajan <mailto:adityam@umich.edu>
>> 22. Juni 2015 05:35
>> On Sun, 21 Jun 2015, Aditya Mahajan wrote:
>>
>>
>> Even the second example in strc-ref.mkvi does not work correctly.
>>
>> \starttext
>> \chapter{test}
>> \placefigure[here][xx:1]{}{\framed{one}}
>> \placefigure[here][xx:2]{}{\framed{three}}
>> \placetable [here][xx:3]{}{\framed{two}} \placetable
>> [here][xx:4]{}{\framed{four}}
>> \start
>> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
>> \stop \blank \start
>> \setupreferencestructureprefix[default][prefix=no]
>> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
>> \stop \blank \start
>> \setupreferencestructureprefix[float][default][prefix=no]
>> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
>> \stop \blank \start
>> \setupreferencestructureprefix[figure][default][prefix=no]
>> \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
>> \stop \blank
>> \stoptext
>>
>> The second case, (\setup...[default][prefix=no]) works correctly, but the
>> last two cases (\setup...[float][default][prefix=no], etc) do not get rid
>> of the prefix.
> Did you fix the typo in strc-ref.lua and regenrate the format?
Yes. Do these two example work correctly for you with the latest beta
(after fixing the typo and generating the format)?
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-22 15:34 ` Aditya Mahajan
@ 2015-06-22 15:44 ` Wolfgang Schuster
2015-06-22 16:01 ` Aditya Mahajan
2015-06-22 16:09 ` Otared Kavian
0 siblings, 2 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2015-06-22 15:44 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 287 bytes --]
> Aditya Mahajan <mailto:adityam@umich.edu>
> 22. Juni 2015 17:34
> On Mon, 22 Jun 2015, Wolfgang Schuster wrote:
>
>
> Yes. Do these two example work correctly for you with the latest beta
> (after fixing the typo and generating the format)?
Yes, the examples work for me.
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 1270 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-22 15:44 ` Wolfgang Schuster
@ 2015-06-22 16:01 ` Aditya Mahajan
2015-06-22 16:09 ` Otared Kavian
1 sibling, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2015-06-22 16:01 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, 22 Jun 2015, Wolfgang Schuster wrote:
>
>> Aditya Mahajan <mailto:adityam@umich.edu>
>> 22. Juni 2015 17:34
>> On Mon, 22 Jun 2015, Wolfgang Schuster wrote:
>>
>>
>> Yes. Do these two example work correctly for you with the latest beta
>> (after fixing the typo and generating the format)?
>
> Yes, the examples work for me.
I must be doing something wrong. But if it works at your end, I'll just
wait for the next beta.
Thanks,
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: definereferencestructureprefix for floats
2015-06-22 15:44 ` Wolfgang Schuster
2015-06-22 16:01 ` Aditya Mahajan
@ 2015-06-22 16:09 ` Otared Kavian
1 sibling, 0 replies; 9+ messages in thread
From: Otared Kavian @ 2015-06-22 16:09 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
Hi Aditya, Hi Wolfgang,
I was following this thread and I fixed too the typo, then rebuilt the formats but the results I get are as Aditya describes it (please see the attached output I get). Actually I need something analogous but regarding a reference to a Theorem or Lemma within a given chapter.
My version is ConTeXt ver: 2015.06.15 13:42 MKIV beta fmt: 2015.6.22 int: english/english
Best regards: OK
[-- Attachment #2: definereferencestructureprefix-1.pdf --]
[-- Type: application/pdf, Size: 11074 bytes --]
[-- Attachment #3: Type: text/plain, Size: 886 bytes --]
> On 22 Jun 2015, at 17:44, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
>
>
>> Aditya Mahajan 22. Juni 2015 17:34
>> On Mon, 22 Jun 2015, Wolfgang Schuster wrote:
>>
>>
>> Yes. Do these two example work correctly for you with the latest beta (after fixing the typo and generating the format)?
>
> Yes, the examples work for me.
>
> Wolfgang
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
[-- Attachment #4: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-06-22 16:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-20 16:22 definereferencestructureprefix for floats Aditya Mahajan
2015-06-20 16:48 ` Wolfgang Schuster
2015-06-22 3:30 ` Aditya Mahajan
2015-06-22 3:35 ` Aditya Mahajan
2015-06-22 7:41 ` Wolfgang Schuster
2015-06-22 15:34 ` Aditya Mahajan
2015-06-22 15:44 ` Wolfgang Schuster
2015-06-22 16:01 ` Aditya Mahajan
2015-06-22 16:09 ` Otared Kavian
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).