Re: [NTG-context] Crediting copyright on photographs

2022-05-05 Thread Bruce Horrocks via ntg-context
Thank-you Adam, Hraban and Richard for your suggestions.

In the end it was remarkably simple:

\starttext
\definecollector[example]
\setcollector [example] {\externalfigure[cow][width=6cm,frame=off]}
\setcollector [example] [corner={right,bottom},location={right,top}]
{\rotate[rotation=90]{\copyright A great artist}}
\placefigure [ ] [fig:cow] {A fine figure of a cow} 
{\composedcollector{example}}
\stoptext

In the above the cow is drawn with the figure caption below as normal and with 
the copyright text running upwards along the edge of the right-hand edge of the 
image. And if you want to fine tune the space between the image and the text 
then it's easy to \framed the text and play around with the size and offsets.

—
Bruce Horrocks
Hampshire, UK

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Wiki update: create a .vsix extension package for VisualStudio Code (or VSCodium)

2022-05-05 Thread Hans Hagen via ntg-context

On 5/5/2022 12:01 PM, mf via ntg-context wrote:


https://wiki.contextgarden.net/VSCode

Thanks!

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Wiki update: create a .vsix extension package for VisualStudio Code (or VSCodium)

2022-05-05 Thread mf via ntg-context

Hello list,

I just added some instructions to the WIKI to build an extension file 
for VSCode, starting from the code you find in the LMTX installation at


tex/texmf-context/context/data/vscode/extensions/context

You find them at

https://wiki.contextgarden.net/VSCode

Massi
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] XML: calculations on attribute values before output

2022-05-05 Thread Duncan Hothersall via ntg-context
Thanks so much Taco, that opens the door to a lot for me. It's a tricky
learning curve.

Just in case anyone else is copying code in future for CALS, there's a tiny
tweak to the rows calculation, it should be (t.at.morerows or 0) + 1.

I see a route to solving lots of other problems here too. Thanks again.

Duncan

On Thu, 5 May 2022 at 08:21, Taco Hoekwater  wrote:

>
>
> > On 4 May 2022, at 22:10, Duncan Hothersall via ntg-context <
> ntg-context@ntg.nl> wrote:
> >
> > Hi.
> >
> > I'm processing an XML table and need to set a row span. Because we use a
> variant of the CALS table model, spans are defined by an attribute saying
> how many *additional* rows should be spanned, as opposed to how many *in
> total*. So to translate this into TABLE \bTD[nr=X] syntax I need to add 1.
> >
> > I'm guessing this is very easily doable (in lua?) but I've tried various
> permutations and can't work it out. If anyone could give me a pointer that
> would be great.
> >
> > (In reality I'm going to need to handle lots of other conversions of
> attribute values into \bTD[...] commands, so if there's a generalised way
> of doing that sort of thing, or even better if someone has already tackled
> CALS tables in this way, that would also be great!)
>
> Not CALS, but I do a lot of HTML table processing. I find it all much
> easier on the lua side, because there the
> attributes are just in a table entry of the argument node t ( t.at ):
>
> set up a lua function in the setups:
>
> \startxmlsetups xml:demo:base
>  \xmlsetsetup{#1}{*}{xml:demo:*}
>  \xmlsetfunction {\xmldocument}{entry}{userdata.xmlfunctions.entry}
> \stopxmlsetups
>
> and then add this lua code:
>
> \startluacode
> userdata.xmlfunctions = {}
> function userdata.xmlfunctions.entry (t)
>   local rows = (t.at.morerows or 1) + 1
>   context.bTD({nr=rows})
>   lxml.flush(t)
>   context.eTD()
> end
> \stopluacode
>
> All of the tex-side commands also exist in lua, in the lxml and/or xml
> table, e.g.:
>
> direct output flushing:
>   lxml.flush(t)
>   lxml.all(t, ‘entry’)
>
> filter for processing:
>   for b in xml.collected(lxml.getid(t),'../row/entry') do … end
>
>
> (those are the ones I use a lot, there are many more)
>
> Best wishes,
> Taco



-- 
Duncan Hothersall, Operations Director
CAPDM Limited - Online Program Enablers
0131 677 2400  www.capdm.com
Registered in Scotland: SC168970   VAT: 682 846 983
Registered address: 20 Forth Street Edinburgh EH1 3LH UK


Capture, author, publish, deliver and manage your learning materials.


*Sign up to the CAPDM newsletter here *
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Crediting copyright on photographs

2022-05-05 Thread Richard Mahoney via ntg-context
Bruce,

I tend to do something such as the following:

\startplacefigure[reference={fig:0007},location={here},title={{\it
Vīkṣya}, 5b},list={Ch.\ {\sc ix}\TI {\it Vīkṣya}, 5b}]

\externalfigure[plates/01-09/01-09-07-
c.jpg][scale=1000,frame=off,equalwidth=325pt]

{{\NI}{\tfx \copyright\ 2012 Sylvain {\sc Brocquet}.}}

\stopplacefigure


You can find the result in v. 1, p. 257:

Murugaiyan, Appasamy & Parlier-Renault, Édith (2021) (Eds) Whispering
of Inscriptions:
South Indian Epigraphy and Art History: Papers from an International
Symposium in memory
of Professor Noboru Karashima (Paris, 12–13 October 2017). Oxford:
Indica et Buddhica.

OA PDF here:

https://indica-et-buddhica.org/publications/murugaiyan-appasamy-parlier-renault-edith/whispering-of-inscriptions-south-indian-epigraphy-and-art-history



Best, Richard



-- 
T +6433121699  M +64210640216
rmaho...@indica-et-buddhica.org
https://indica-et-buddhica.org/

Indica et Buddhica
Littledene  Bay Road  Oxford  NZ
NZBN: 9429041761809


-Original Message-
From: Henning Hraban Ramm via ntg-context 
Reply-To: mailing list for ConTeXt users 
To: ntg-context@ntg.nl
Cc: Henning Hraban Ramm 
Subject: Re: [NTG-context] Crediting copyright on photographs
Date: Thu, 5 May 2022 08:54:52 +0200
Mailer: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0)
Gecko/20100101 Thunderbird/91.8.1
X-Spam-Score: 0.0

Am 04.05.22 um 23:59 schrieb Bruce Horrocks via ntg-context:
> I need to include the copyright acknowledgement / photographer
> credit on an image but I'm not sure what's the best way to do it.
> 
> Option 1: I can add the acknowledgement to the end of the
> \placefigure caption text:
> 
> e.g.   \placefigure{A picture of a cow. Image of a cow that may or
> may not be under copyright
> anymore.}{\externalfigure[cow][height=6cm]}
> 
> then the copyright bit will appear in the Table of Figures which I
> don't really want to happen. Is there a way to truncate this?

Using

\startplacefigure[title={complete caption}, list={description in the 
table of figures}]...\stopplacefigure

you can have different caption texts, like for titles.


> Option 2: some magazines print the copyright credit running up the
> side of the image, independently of the caption. I'd quite like to
> do this and wondered if anyone had already written something they
> could share?

I often use \ininner{\rotate[location=fit]{Copyright notice}}, but
it’s 
a hassle to get the placement right, don’t use it within the caption. 
Using \setlayer is most reliable.


Hraban
__
_
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] XML: calculations on attribute values before output

2022-05-05 Thread Taco Hoekwater via ntg-context


> On 4 May 2022, at 22:10, Duncan Hothersall via ntg-context 
>  wrote:
> 
> Hi.
> 
> I'm processing an XML table and need to set a row span. Because we use a 
> variant of the CALS table model, spans are defined by an attribute saying how 
> many *additional* rows should be spanned, as opposed to how many *in total*. 
> So to translate this into TABLE \bTD[nr=X] syntax I need to add 1.
> 
> I'm guessing this is very easily doable (in lua?) but I've tried various 
> permutations and can't work it out. If anyone could give me a pointer that 
> would be great.
> 
> (In reality I'm going to need to handle lots of other conversions of 
> attribute values into \bTD[...] commands, so if there's a generalised way of 
> doing that sort of thing, or even better if someone has already tackled CALS 
> tables in this way, that would also be great!)

Not CALS, but I do a lot of HTML table processing. I find it all much easier on 
the lua side, because there the 
attributes are just in a table entry of the argument node t ( t.at ):

set up a lua function in the setups:

\startxmlsetups xml:demo:base
 \xmlsetsetup{#1}{*}{xml:demo:*}
 \xmlsetfunction {\xmldocument}{entry}{userdata.xmlfunctions.entry}
\stopxmlsetups

and then add this lua code:

\startluacode
userdata.xmlfunctions = {}
function userdata.xmlfunctions.entry (t)
  local rows = (t.at.morerows or 1) + 1
  context.bTD({nr=rows})
  lxml.flush(t) 
  context.eTD()
end
\stopluacode

All of the tex-side commands also exist in lua, in the lxml and/or xml table, 
e.g.:

direct output flushing: 
  lxml.flush(t)
  lxml.all(t, ‘entry’)

filter for processing:
  for b in xml.collected(lxml.getid(t),'../row/entry') do … end


(those are the ones I use a lot, there are many more)

Best wishes,
Taco
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Crediting copyright on photographs

2022-05-05 Thread Henning Hraban Ramm via ntg-context

Am 04.05.22 um 23:59 schrieb Bruce Horrocks via ntg-context:

I need to include the copyright acknowledgement / photographer credit on an 
image but I'm not sure what's the best way to do it.

Option 1: I can add the acknowledgement to the end of the \placefigure caption 
text:

e.g.   \placefigure{A picture of a cow. Image of a cow that may or may not be 
under copyright anymore.}{\externalfigure[cow][height=6cm]}

then the copyright bit will appear in the Table of Figures which I don't really 
want to happen. Is there a way to truncate this?


Using

\startplacefigure[title={complete caption}, list={description in the 
table of figures}]...\stopplacefigure


you can have different caption texts, like for titles.



Option 2: some magazines print the copyright credit running up the side of the 
image, independently of the caption. I'd quite like to do this and wondered if 
anyone had already written something they could share?


I often use \ininner{\rotate[location=fit]{Copyright notice}}, but it’s 
a hassle to get the placement right, don’t use it within the caption. 
Using \setlayer is most reliable.



Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___