Re: [NTG-context] custom cite in \externalfigure

2016-05-06 Thread Alan BRASLAU
On Fri, 6 May 2016 09:47:39 +0200
eidenbenz  wrote:

> the problem is that I need the control the width of externalfigure in
> the text. With the above solution I have to define a different cite
> rendering for every possible width I need in my layout. 

Maybe, don't set the width and use \scale[]{}

Alternatively, define a parameter
\setupbtx [duane:cite:entry]
[width=10cm]
and then use this parameter, as
\cite[alternative=entry,width=5cm][duane::tug2014]
or something like that, as I have not worked this through.

Alan
___
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
___

Re: [NTG-context] custom cite in \externalfigure

2016-05-06 Thread eidenbenz
that's what I did at first:

\startsetups btx:duane:cite:external
  {\externalfigure[\btxfield{url_image}][width=10cm]}
\stopsetups

the problem is that I need the control the width of externalfigure in the text. 
With the above solution I have to define a different cite rendering for every 
possible width I need in my layout. 

Isn't there a way to just get the filename of the cite so I can a macro with 
the width as an argument?

Thanks Michael



> On 04 May 2016, at 23:39, Alan Braslau  wrote:
> 
> On Wed, 4 May 2016 21:31:46 +
> "Eidenbenz  Michael"  wrote:
> 
>> what seems strange to me is that \cite[filename] works as such, but
>> not as an argument to \externalfigure
> 
> The \externalfigure tries to do quite a lot with its argument(s).
> 
> You can use \placecitation [duane::tug2014]
> defining your rendering appropriately to call \externalfigure.
> 
> Alan

___
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
___

Re: [NTG-context] custom cite in \externalfigure

2016-05-04 Thread Alan Braslau
On Wed, 4 May 2016 21:31:46 +
"Eidenbenz  Michael"  wrote:

> what seems strange to me is that \cite[filename] works as such, but
> not as an argument to \externalfigure

The \externalfigure tries to do quite a lot with its argument(s).

You can use \placecitation [duane::tug2014]
defining your rendering appropriately to call \externalfigure.

Alan
___
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
___

Re: [NTG-context] custom cite in \externalfigure

2016-05-04 Thread Eidenbenz Michael
thats what i already have:

>> \startsetups btx:duane:cite:filename
>>   {\btxfield{url_image}}
>> \stopsetups


so you mean i have to use btxfield outside a setups?

what seems strange to me is that \cite[filename] works as such, but not as an 
argument to \externalfigure
i thought it might have to do with the data (url_image) not being available in 
the first pass.

thanks michael

> On 04 May 2016, at 10:02, Hans Hagen  wrote:
> 
> On 4/30/2016 10:06 PM, eidenbenz wrote:
>> Could somebody explain me why this (the part that is commented) doesn't work?
>> I get the following error:
>> 
>> tex error   > tex error on line 0 in file : ! Emergency stop
>> <*> cont-yes.mkiv
>> 
>> *** (job aborted, no legal \end found)
> 
> because \cite does a lot more than just returning a filename ... you need to 
> use the low more level btxfield commands to get the more raw data
> 
>> 
>> Thanks Michael
>> 
>> 
>> ---
>> 
>> 
>> \startbuffer[duane]
>> 
>>@image {tug2014,
>>title   = "TUG 2014",
>>url = "http://tug.org/tug2014/;,
>>url_image   = "http://tug.org/art/tug2014-color.jpg;,
>>url_thumb   = "http://tug.org/tug2014/t2014-thumb.jpg;,
>>description = "Official drawing of the TUG 2014 conference",
>>author  = "Duane Bibby",
>>year= 2014,
>>}
>> 
>> \stopbuffer
>> 
>> \definebtxdataset
>> [duane]
>> 
>> \usebtxdataset
>> [duane]
>> [duane.buffer]
>> 
>> \usebtxdefinitions
>> [duane]
>> 
>> \definebtxrendering
>>[duane]
>>[dataset=duane,
>> method=local,
>>]
>> 
>> \setupbtxlist
>>[duane]
>>[number=no]
>> 
>> \startsetups btx:duane:list:image
>>  \btxfield{title}
>> \stopsetups
>> 
>> \startsetups btx:duane:cite:external
>>   {\externalfigure[\btxfield{url_image}][width=10cm]}
>> \stopsetups
>> 
>> \startsetups btx:duane:cite:filename
>>   {\btxfield{url_image}}
>> \stopsetups
>> 
>> \starttext
>> 
>>   \cite[filename][duane::tug2014]\par
>>   \cite[external][duane::tug2014]\par
>> 
>>   % Why does this not work?
>>   %\externalfigure[\cite[filename][duane::tug2014]][width=10cm]\par
>> 
>>   \placebtxrendering[duane]
>> 
>> \stoptext
>> 
>> 
>> ___
>> 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
>> ___
>> 
> 
> 
> -- 
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: 038 477 53 69 | 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
> ___

___
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
___

Re: [NTG-context] custom cite in \externalfigure

2016-05-04 Thread Hans Hagen

On 4/30/2016 10:06 PM, eidenbenz wrote:

Could somebody explain me why this (the part that is commented) doesn't work?
I get the following error:

tex error   > tex error on line 0 in file : ! Emergency stop
<*> cont-yes.mkiv

*** (job aborted, no legal \end found)


because \cite does a lot more than just returning a filename ... you 
need to use the low more level btxfield commands to get the more raw data




Thanks Michael


---


\startbuffer[duane]

@image {tug2014,
title   = "TUG 2014",
url = "http://tug.org/tug2014/;,
url_image   = "http://tug.org/art/tug2014-color.jpg;,
url_thumb   = "http://tug.org/tug2014/t2014-thumb.jpg;,
description = "Official drawing of the TUG 2014 conference",
author  = "Duane Bibby",
year= 2014,
}

\stopbuffer

\definebtxdataset
 [duane]

\usebtxdataset
 [duane]
 [duane.buffer]

\usebtxdefinitions
 [duane]

\definebtxrendering
[duane]
[dataset=duane,
 method=local,
]

\setupbtxlist
[duane]
[number=no]

\startsetups btx:duane:list:image
  \btxfield{title}
\stopsetups

\startsetups btx:duane:cite:external
   {\externalfigure[\btxfield{url_image}][width=10cm]}
\stopsetups

\startsetups btx:duane:cite:filename
   {\btxfield{url_image}}
\stopsetups

\starttext

   \cite[filename][duane::tug2014]\par
   \cite[external][duane::tug2014]\par

   % Why does this not work?
   %\externalfigure[\cite[filename][duane::tug2014]][width=10cm]\par

   \placebtxrendering[duane]

\stoptext


___
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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___

[NTG-context] custom cite in \externalfigure

2016-04-30 Thread eidenbenz
Could somebody explain me why this (the part that is commented) doesn't work?
I get the following error:

tex error   > tex error on line 0 in file : ! Emergency stop
<*> cont-yes.mkiv

*** (job aborted, no legal \end found)



Thanks Michael


---


\startbuffer[duane]

@image {tug2014,
title   = "TUG 2014",
url = "http://tug.org/tug2014/;,
url_image   = "http://tug.org/art/tug2014-color.jpg;,
url_thumb   = "http://tug.org/tug2014/t2014-thumb.jpg;,
description = "Official drawing of the TUG 2014 conference",
author  = "Duane Bibby",
year= 2014,
}

\stopbuffer

\definebtxdataset
 [duane]

\usebtxdataset
 [duane]
 [duane.buffer]

\usebtxdefinitions  
 [duane]

\definebtxrendering
[duane]
[dataset=duane,
 method=local, 
]

\setupbtxlist
[duane]
[number=no]

\startsetups btx:duane:list:image
  \btxfield{title} 
\stopsetups

\startsetups btx:duane:cite:external
   {\externalfigure[\btxfield{url_image}][width=10cm]}
\stopsetups

\startsetups btx:duane:cite:filename
   {\btxfield{url_image}}
\stopsetups

\starttext

   \cite[filename][duane::tug2014]\par
   \cite[external][duane::tug2014]\par
   
   % Why does this not work?
   %\externalfigure[\cite[filename][duane::tug2014]][width=10cm]\par
   
   \placebtxrendering[duane]

\stoptext


___
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
___