Re: [NTG-context] How to enable the use of the blackboard font in modern ConTeXt

2021-10-23 Thread Pablo Rodriguez via ntg-context
On 10/23/21 3:00 PM, Gerben Wierda via ntg-context wrote:
> By the way, neither does \blackboard{Q} work. But \rationals works in
> the case of the letter Q.

Hi Gerben,

it only seems to work inside math:

  \starttext
  \dorecurse{26}{$\blackboard\characters{\recurselevel}
  \Characters{\recurselevel}$}
  \stoptext

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] logo from wiki

2021-10-23 Thread Pablo Rodriguez via ntg-context
On 10/23/21 12:35 PM, Adam Reviczky via ntg-context wrote:
> Hi Pablo,
>
> https://gitlab.com/schickele/new-context-logo
> (See: https://mailman.ntg.nl/pipermail/ntg-context/2019/093859.html)

Many thanks for your fast reply and your help, Adam.

Pablo
--
http://www.ousia.tk
___
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] logo from wiki

2021-10-23 Thread Pablo Rodriguez via ntg-context
Dear list,

where could I get the vector version from
https://wiki.contextgarden.net/skins/common/images/context/context_logo_inv.png?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] upload

2021-10-22 Thread Pablo Rodriguez via ntg-context
On 10/22/21 5:50 PM, Michal Vlasák via ntg-context wrote:
> [...]
> I checked the backend code and some of the related os functions. I put
> together a patch that hopefully fixes some stuff and doesn't break
> anything.
> [...]
>   \enabledirectives[backend.date=1234-12-30T23:45:16+01:00] % 
> 1234-12-31T00:45:16+02:00
>   \enabledirectives[backend.date=1234-12-30 23:45:16-02:00] % 
> 1234-12-31T03:45:16+02:00
>   \enabledirectives[backend.date=1234-12-30 23:45:16+05:00] % 
> 1234-12-31T20:45:16+02:00
> [...]
> Is the timezone stuff what you wanted, Pablo?

Hi Michal,

I haven’t found the time to check this, but this is pretty much what I
wanted: being able to set other timezones than the local one.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] vertical align in combination

2021-10-22 Thread Pablo Rodriguez via ntg-context
On 10/22/21 5:46 PM, Hans Hagen via ntg-context wrote:
> On 10/22/2021 5:20 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> How could I get all lines with images vertically centered?
>
> maybe by using the command the right way ...
>
>\setupexternalfigure[location=default]
>\startcombination[nx=3, ny=2, location={middle}]
>{\externalfigure[mill.png][width=.25\textwidth]}  {}

Many thanks for your fast reply and your help, Hans.


Pablo
--
http://www.ousia.tk
___
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] vertical align in combination

2021-10-22 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \setupexternalfigure[location=default]
  \startcombination[nx=3, ny=2, location={middle}]
  {\externalfigure[mill.png][width=.25\textwidth]}
  {\externalfigure[cow.pdf][width=.25\textwidth]}
  {\externalfigure[cow.pdf][width=.25\textwidth]}
  {\externalfigure[spider.eps][width=.25\textwidth]}
  {\externalfigure[hacker.png][width=.25\textwidth]}
  {\externalfigure[mill.png][width=.25\textwidth]}
  \stopcombination
  \stoptext

The first line has the images vertically centered, but the second line
has them aligned to the top. Using "align=middle" made no difference.

How could I get all lines with images vertically centered?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] \rotate[rotation=270] adds extra vertical space

2021-10-22 Thread Pablo Rodriguez via ntg-context
On 10/22/21 10:07 AM, Hans Hagen via ntg-context wrote:
> nicer demo:
> [...]
Hans,

many thanks for your reply and your sample.

A more visual version for me would be:

  \setupbodyfont[sans, 30pt]
  \setuppagenumbering[location=,]
  \showframe

  \starttext
   \topskip4cm
  \dostepwiserecurse{0}{360}{10}{
  \doloopoverlist{normal,default,depth,fit,broad,high,middle}{
  \ruledhbox{\rotate[rotation=\recurselevel, location=\recursestring]{%
  \framed
 [width=\textheight, height=\textwidth, rulethickness=5pt,
  depth=0cm, foregroundstyle=\bfd]
{\recursestring, \recurselevel°}
  }
  }
  }
  }
  \stoptext

I have just added it to
https://wiki.contextgarden.net/Scaling_Rotating_Mirroring_Clipping#Rotating_Figures.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] upload

2021-10-21 Thread Pablo Rodriguez via ntg-context
On 10/21/21 8:04 PM, Hans Hagen via ntg-context wrote:
> Hi,
>
> I cleaned up some more backend code.  There were some mails about dates
> and such and although the date field in setupinteraction works ok a more
> drastic overload is doen with directives. The reason is that the fact
> that we can set the date (and traler) is only because it permits
> generating pdf files that can be compared. No date as a bad idea anyway.
>
> \setupinteraction[title=My Title]
> % \enabledirectives[backend.date=2034-06-07]

Many thanks for the new version, Hans.

Is there a way to add time and timezone in backend.date?

> Pablo : transparencies should work again (wrong alias fixed).

Many thanks for this fix too.

Sorry for insisting, but could you check what is wrong with an extra
blank space in rotated imposition
(https://mailman.ntg.nl/pipermail/ntg-context/2021/103909.html)?

Many thanks for your help again,

Pablo
--
http://www.ousia.tk
___
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] setting date in \setupinteraction

2021-10-21 Thread Pablo Rodriguez via ntg-context
On 10/20/21 4:02 PM, Hans Hagen via ntg-context wrote:
> On 10/19/2021 10:38 PM, Michal Vlasák via ntg-context wrote:
>> [...]
>> The pattern doesn't catch all the PDF spec cases, but should match what
>> ConTeXt emits. The timezone info gets overwritten by current timezone
>> though.
>>
>> Requires the below patch.
>[...]
> i'll fix it but also clean up the existing code a bit
>
> (much has to do with omitting date and is for comparison reasons)

Many thanks for the fix. It would be great that current timezone doesn’t
overwrite the specified one.

Pablo
--
http://www.ousia.tk
___
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] \rotate[rotation=270] adds extra vertical space

2021-10-21 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following imposition sample:

  \startbuffer[newbuff]
  \showframe\showgrid
  \setuppapersize[A3, landscape]
  \setuplayout[width=middle]
  \starttext
  \dorecurse{4}{\null\page}
  \stoptext
  \stopbuffer
  \startmode[*first]
  \savebuffer[newbuff][A3page.tex, prefix=no]
  \executesystemcommand{context --purgeall A3page.tex}
  \stopmode
  \showframe
  \setuplayout[page]
  \setuppapersize[A5][A4, landscape]
  \setuparranging [2UP]
  \setupinteractionscreen[option={landscape, paper}]
  \starttext
  \doiffile{A3page.pdf}
  {\def\Doc{A3page.pdf}
  \getfiguredimensions[\Doc]
  \dorecurse{\noffigurepages}
{\ifodd\recurselevel
  \rotate[rotation=90]
{\externalfigure[\Doc][page=\recurselevel, width=\textheight]}
\else\rotate[rotation=270]
{\externalfigure[\Doc][page=\recurselevel, width=\textheight]}
\fi}}
  \stoptext

I’m afraid that if rotation values are 270 or 180, the imposed page has
an extra vertical space before.

I think this might be a bug. Or I don’t know what I might be missing.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] transparency not working in current latest?

2021-10-21 Thread Pablo Rodriguez via ntg-context
Dear list,

since current latest (2021.10.18 23:14), I don’t get transparency working:

  \definecolor[transparent][b=1, a=1, t=0]

  \starttext
  \startTEXpage[offset=1em, align=middle]
  \color[transparent]{\ssbf totally\\transparent?}
  \stopTEXpage
  \stoptext

Am I missing something or is it a bug?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] setting date in \setupinteraction

2021-10-19 Thread Pablo Rodriguez via ntg-context
On 10/19/21 6:23 PM, Michal Vlasák via ntg-context wrote:
> On Tue Oct 19, 2021 at 5:47 PM CEST, Pablo Rodriguez via ntg-context wrote:
> [...]
> So this works:
>
>
> \setupinteraction[state=start,
>   date={2022-02-02T12:00:21+02:00}]
> \starttext
> This document is from 02.02.2020 at 12:00:21.
> \stoptext
>
> This parameter sets the "ModDate" is that what you are after?

Hi Michal,

many thanks for your fast reply.

I would like to import both metadata values (CreationDate and ModDate)
from another file (such as https://pdf.ousia.tk/metadata.pdf).

Besides from the fact that LMTX doesn’t work with this (only MkIV does
[already reported]), isn’t no simpler way to get ISO 8601 formatting
from doc.Info.ModDate than the following one?

  \starttext
  \startluacode
  function document.transfer_metadata(name)
local main_doc = lpdf.epdf.load(name)
context.setupinteraction{ title = main_doc.Info.Title }
context.setupinteraction{ date =  main_doc.Info.ModDate:sub(3,6) ..
"-" .. main_doc.Info.ModDate:sub(7,8) .. "-" ..
main_doc.Info.ModDate:sub(9,10) .. "T" ..
main_doc.Info.ModDate:sub(11,12) .. ":" ..
main_doc.Info.ModDate:sub(13,14) .. ":" ..
main_doc.Info.ModDate:sub(15,22):gsub("'", ":") }
context(main_doc.Info.Title .. "\\par")
lpdf.epdf.unload(name)
  end
  \stopluacode
  \unexpanded\def\TransferMetadata#1%
{\ctxlua{document.transfer_metadata("#1")}}
  \startTEXpage[offset=1em, align=center]
  \TransferMetadata{metadata.pdf}
  \stopTEXpage
  \stoptext

> Seems that "CreationDate" could be set by the SOURCE_DATE_EPOCH
> environment variable, but I am not succesfull with it right now.

It would be fine to ble able to set CreationDate. Otherwise, having a
ModDate prior to CreationDate gives a weird impression.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] upload

2021-10-19 Thread Pablo Rodriguez via ntg-context
On 10/18/21 11:17 PM, Hans Hagen via ntg-context wrote:
> Hi,
>
> I uploaded a new lmtx. This one is a little experimental because I
> removed so redundant / intermediate code still present from teh
> transition from mkiv to lmtx (mostly backend related). I might have
> missed something (not all is in the test suite) but nothing that can't
> be fixed easy, most has to do with the timing of definitions.
>
> But I assume users save their stable trees anyway ...

Hi Hans,

I’m afraid that viewerlayers have issues now.

I hope I’ll find some time soon to write a minimal sample.

Pablo
--
http://www.ousia.tk
___
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] setting date in \setupinteraction

2021-10-19 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setupinteraction[state=start,
date={02.02.2022}]
  \starttext
  This document is from 02.02.2020 at 12:00:21.
  \stoptext

Which is the right way to get PDF dates working with \setupinteraction?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Acrobat doesn’t read imported metadata

2021-10-11 Thread Pablo Rodriguez via ntg-context
On 10/10/21 6:51 PM, Hans Hagen via ntg-context wrote:
> On 10/10/2021 5:46 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Being the sample file https://pdf.ousia.tk/metadata.pdf, Acrobat cannot
>> display the imported title or either the creation or modification dates.
>>
>> What am I missing to make Acrobat display the imported metadata?
> timing, so best use the official methods:
> [...]
> acrobat looks at the metadata blob

Many thanks for your reply, Hans.

This works in MkIV, but not in LMTX:

 context.setupinteraction { title = main_doc.Info.Title }

BTW, is there a way to add CreationDate and ModDate?

Many thanks for your help again,

Pablo
--
http://www.ousia.tk
___
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] undefined command in current latest

2021-10-10 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setupheadertexts[{\getmarking[chapter]}]
  \starttext
  \chapter{Chapter}
  \stoptext

It compiles perfectly fine with MkIV from 2021.10.08 20:18, but its LMTX
version triggers the following error message:

  Undefined control sequence \??markingfilter

Previous LMTX version compiled just fine.

I think it might be a bug.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Acrobat doesn’t read imported metadata

2021-10-10 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \startluacode
  function document.transfer_metadata(name)
local main_doc = lpdf.epdf.load(name)
lpdf.addtoinfo("Title", lpdf.unicode(main_doc.Info.Title),
  lpdf.string(main_doc.Info.Title))
lpdf.addtoinfo("CreationDate",
  lpdf.string(main_doc.Info.CreationDate))
lpdf.addtoinfo("ModDate", lpdf.string(main_doc.Info.ModDate),
  main_doc.Info.ModDate)
lpdf.epdf.unload(name)
  end
  \stopluacode
  \unexpanded\def\TransferMetadata#1%
{\ctxlua{document.transfer_metadata("#1")}}
  \startTEXpage[offset=1em, align=center]
  \ssbf metadatos\\importados
  \TransferMetadata{metadata.pdf}
  \stopTEXpage
  \stoptext

Being the sample file https://pdf.ousia.tk/metadata.pdf, Acrobat cannot
display the imported title or either the creation or modification dates.

What am I missing to make Acrobat display the imported metadata?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Acrobat doesn’t display some imported metadata

2021-09-19 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample to import metadata (title, author, subject,
keywords and dates).

  \starttext
  \startluacode
  function document.transfer_metadata(name)
local main_doc = lpdf.epdf.load(name)
lpdf.addtocatalog("Lang", lpdf.unicode(main_doc.Catalog.Lang),
  main_doc.Catalog.Lang)
lpdf.addtoinfo("Title", lpdf.unicode(main_doc.Info.Title),
  lpdf.string(main_doc.Info.Title))
lpdf.addtoinfo("Subject", lpdf.unicode(main_doc.Info.Subject),
  lpdf.string(main_doc.Info.Subject))
lpdf.addtoinfo("Keywords", lpdf.unicode(main_doc.Info.Keywords),
  lpdf.string(main_doc.Info.Keywords))
lpdf.addtoinfo("Author", lpdf.unicode(main_doc.Info.Author),
  lpdf.string(main_doc.Info.Author))
lpdf.addtoinfo("CreationDate",
  lpdf.string(main_doc.Info.CreationDate))
lpdf.addtoinfo("ModDate", lpdf.string(main_doc.Info.ModDate),
  main_doc.Info.ModDate)
lpdf.epdf.unload(name)
  end
  \stopluacode
  \unexpanded\def\TransferMetadata#1%
{\ctxlua{document.transfer_metadata("#1")}}
  \startTEXpage[offset=1em, align=center]
  \ssbf metadatos\\importados
  \TransferMetadata{metadata.pdf}
  \stopTEXpage
  \stoptext

Importing from https://pdf.ousia.tk/metadata.pdf gives
https://pdf.ousia.tk/imported-metadata.pdf.

Imported metadata from title, creation and modification dates are not
displayed right in Acrobat. Other PDF viewers display these metadata fine.

How can I get that Acrobat displays the metadata from the imported document?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Roman PDF labels

2021-09-14 Thread Pablo Rodriguez via ntg-context
On 9/14/21 1:58 PM, Sylvain Hubert via ntg-context wrote:
> Dear List,
>
> Do we have something like "\pagenumbering{roman}" in latex, which sets
> the pdf labels (page numbers for pdf viewers, not the ones rendered in
> the footer) to roman numbers?

Hi Sylvain,

copied from
https://wiki.contextgarden.net/Table_of_Contents#Page_numbering_in_ToC:

  \definestructureconversionset[frontpart:pagenumber][][romannumerals]
  \definestructureconversionset[bodypart:pagenumber] [][numbers]

  \setuplist[chapter][pageconversionset=pagenumber]

  \startsectionblockenvironment[frontpart]
  \setupuserpagenumber[numberconversion=romannumerals]
  \setuppagenumber[number=1]
  \stopsectionblockenvironment

  \startsectionblockenvironment[bodypart]
  \setuppagenumber[number=1]
  \stopsectionblockenvironment
  \starttext
  \startfrontmatter
  \dorecurse{25}{\null\page}
  \stopfrontmatter
  \startbodymatter
  \dorecurse{25}{\null\page}
  \stopbodymatter
  \stoptext

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] read PDF metadata from other file

2021-09-11 Thread Pablo Rodriguez via ntg-context
On 9/11/21 6:16 PM, Hans Hagen via ntg-context wrote:
> On 9/11/2021 2:35 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> How can I get the pure text value, so I can transfer metadata from one
>> PDF document into another PDF document?
> just use the better interface
> [...]
> after which you enter wiki mode

Mamy thanks for your reply, Hans.

I think this might be simpler for me:

  \starttext
  \startluacode
  function document.transfer_metadata(name)
  local main_doc = lpdf.epdf.load(name)
  lpdf.addtocatalog("Lang", lpdf.string(main_doc.Catalog.Lang))
  lpdf.addtoinfo("Title", lpdf.unicode(main_doc.Info.Title))
  lpdf.addtoinfo("Subject", lpdf.unicode(main_doc.Info.Subject))
  lpdf.addtoinfo("Author", lpdf.unicode(main_doc.Info.Author))
  lpdf.epdf.unload(name)
  end
  \stopluacode
  \unexpanded\def\TransferMetadata#1%
{\ctxlua{document.transfer_metadata("#1")}}
  \null
  \TransferMetadata{name.pdf}
  \stoptext

Added to
https://wiki.contextgarden.net/Interaction#Import_PDF_metadata_fields_from_other_PDF_documents.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] read PDF metadata from other file

2021-09-11 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \setupinteraction
[state=start,
 title={\cldcontext{pdfe.open("b.pdf").Info.Title}}]
  \null
  \stoptext

From a document composed with \insertpages, I need to transfer medatada.

But I get the raw value "feff0061" (which I guess it may be introduced
by lpdf.pdfunicode).

How can I get the pure text value, so I can transfer metadata from one
PDF document into another PDF document?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Setting up the double pages of part beginnings

2021-09-11 Thread Pablo Rodriguez via ntg-context
On 9/10/21 7:25 PM, Christian Dekant via ntg-context wrote:
> [...]
> % startTEXpage does not increase page number => incrementpagenumber

Sorry, Christian, I’m afraid I don’t understand what you want to achieve

\startTEXpage[pagestate=start] uses page numbers as any other page.

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] JavaScript controlled button appearance

2021-08-30 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setupinteraction[state=start]
  \setupbodyfont[heros]
  \startJSpreamble varia used now
function SwitchFS() {
  app.fs.isFullScreen = !app.fs.isFullScreen;
}
  \stopJSpreamble

  \starttext
\startTEXpage[offset=10pt]
  \goto{fs}[JS(SwitchFS{})]
\stopTEXpage
  \stoptext

How can I get that the "fs" in the text is replaced with "x" when
JavaScript detects that the screen is in full screen mode?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] new upload

2021-08-30 Thread Pablo Rodriguez via ntg-context
On 8/30/21 6:15 PM, mf via ntg-context wrote:
> There's a problem downloading lowlevel-alignments.pdf.
> Here's a slice of the log of install.sh:
> [...]
> mtx-install | added:   7 % :  199 :
> tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf
> mtx-install |
> tex/texmf-context/doc/context/documents/general/manuals/lowlevel-alignments.pdf,
> try again later:
>
> After 5 unsuccessful trials to download the file, the updating process
> does not complete. The script ends without errors, but it's clear the
> update has failed.

I’m afraid I‘m experiencing exactly the same problem that Massi reported.

Just in case it may help,

Pablo
--
http://www.ousia.tk
___
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] getting path and filename from url

2021-08-28 Thread Pablo Rodriguez via ntg-context
On 8/28/21 1:17 AM, Hans Hagen via ntg-context wrote:
> On 8/27/2021 8:53 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> How can I get that match for #1 ends in the last slash (including it
>> "../a/b/cb/ce.b/ca.b/c/") and match for #2 ends in the last period
>> (excluding it, "dabc")?
> it really helps to read the cld manual (or look into l-* files) as there
> are plenty of efficient helpers for these things

Many thanks for your reply, Hans.

It really works like charm and reading cld-mkiv.pdf is one of the things
I want to do in the near future.

Many thanks for your help again,

Pablo
--
http://www.ousia.tk
___
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] getting path and filename from url

2021-08-28 Thread Pablo Rodriguez via ntg-context
On 8/27/21 10:56 PM, Tomas Hala via ntg-context wrote:
> Hi Pablo,
>
> is the following what you need?
>
> context("2a. " .. url:match "[^/]+/.+[.]") -- path and name with period
> context("2c. " .. (url:match "[^/]+[^.]+$") :match ".+[.]")  -- name with 
> period

Hi Tomáš,

well, I wnanted to remove the ending period in both cases (and to
understand how that patterns might work.

I got the first one with:

  context("2a ok. " .. url:match "[^/]+.+/") -- path and name

But I’m stuck at the second one (sorry, I don’t know how to remove the
final period):

  context("2c. " .. url:match "[^/]+.$":match("^.+%l+[.$]"))

https://pragma-ade.com/general/manuals/cld-mkiv.pdf#search=nameonly is
the way to go, but it won’t hurt me to understand how patterns might
work here.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] getting path and filename from url

2021-08-27 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \startluacode
  url = "../a/b/cb/ce.b/ca.b/c/dabc.pdf"

  context(url)

  context("0 ok. " .. url:match "^(.*).pdf$") -- name and path

  context("1. " .. url:match "^(.*).+$") -- path

  context("2. " .. url:match"[^/]+[.$]") -- name

  context("3 ok. " .. url:match "[^.]+$") -- extension
  \stopluacode
  \stoptext

How can I get that match for #1 ends in the last slash (including it
"../a/b/cb/ce.b/ca.b/c/") and match for #2 ends in the last period
(excluding it, "dabc")?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] different preffixsegments for different reference formats

2021-08-21 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \definereferenceformat[itsc][in]
  \setupreferencestructureprefix[itsc][default]
[prefixsegments=section]
  \chapter{Chapter}
  \section[b]{Section}
  \itsc[b] and \in[b]
  \stoptext

How can I get that \itsc gets "prefixsegments=section" without affecting
to \in?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] paper dimensions for TEXpage

2021-08-19 Thread Pablo Rodriguez via ntg-context
On 8/18/21 4:25 PM, Hans Hagen via ntg-context wrote:
> On 8/17/2021 4:01 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> In this case, \getfiguredimensions would work, but I don’t know how to
>> deal with a pure text box.
>>
>> BTW, is there a way to have TEXpages numbered? "pagestate=start" seems
>> not to work here.

Many thanks for your reply, Hans.

"pagestate=start" works fine with TEXpages, but I don’t know why I
didn’t noticed that when I checked it.

> for the wiki ...

Wikified at https://wiki.contextgarden.net/Layers#Layers_in_fitting_pages.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] compression for multimedia objects

2021-08-17 Thread Pablo Rodriguez via ntg-context
On 8/17/21 12:46 PM, Hans Hagen via ntg-context wrote:
> On 8/17/2021 6:06 AM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> I don’t know whether this is intended. In that case, could we have an
>> option to compress embedded multimedia objects?
>
> indeed intended because zipping already compressed files makes no sense
>
>> (I know that those mp4 files are crappy, but I can’t control the crap
>> others generate.)
> i'll add 'compress' to the options

Many thanks for the new option, Hans.

Pablo
--
http://www.ousia.tk
___
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] paper dimensions for TEXpage

2021-08-17 Thread Pablo Rodriguez via ntg-context
On 8/17/21 9:30 AM, Hans Hagen via ntg-context wrote:
> On 8/17/2021 5:56 AM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> I don’t get the layer in the TEXpage.
>>
>> How could I get it with the TEXpage dimensions?
> only by first boxing (using framed or so) and then taking those dimensions

Many thanks for your reply, Hans.

I’m afraid I don’t know how to make the commands work:

  \setupexternalfigures[location=default]
  \definelayer[hi]
   [x=.5\dimexpr\framedwidth\relax, y=.5\dimexpr\framedheight\relax]
  \setupbackgrounds[page][background={foreground, hi}]
  \starttext
  \startTEXpage
  \framed[frame=off, offset=none]
  {\setlayer[hi]{\color[red]{hi}}
  \externalfigure[cow-brown]\framedheight}
  \stopTEXpage
  \stoptext

In this case, \getfiguredimensions would work, but I don’t know how to
deal with a pure text box.

BTW, is there a way to have TEXpages numbered? "pagestate=start" seems
not to work here.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] compression for multimedia objects

2021-08-16 Thread Pablo Rodriguez via ntg-context
Hi Hans,

some days ago (after the patch from
https://mailman.ntg.nl/pipermail/ntg-context/2021/103011.html), I
included two mp4 files in a PDF document.

They where so generated, that they could be compressed in a zip file
from 254MB into less than 25MB. The resulting PDF file was less than 25MB.

With the current latest, compression for multimedia objects is disabled.
The same PDF document takes about 254MB.

I don’t know whether this is intended. In that case, could we have an
option to compress embedded multimedia objects?

(I know that those mp4 files are crappy, but I can’t control the crap
others generate.)

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] paper dimensions for TEXpage

2021-08-16 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \definelayer[hi][x=.5\paperwidth, y=.5\paperheight]
  \setupbackgrounds[page][background=hi]
  \starttext
  \setlayer[hi]{hi}
  \startTEXpage[offset=10em]
  \null
  \stopTEXpage
  \stoptext

I don’t get the layer in the TEXpage.

How could I get it with the TEXpage dimensions?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Pablo Rodriguez via ntg-context
On 8/15/21 6:02 PM, Fabrice Couvreur via ntg-context wrote:
> A small note : this method works if I compile the project but if I
> compile only one chapter, the header no longer appears.

Hi Fabrice,

I have never used projects and chapters (or whatever the right name is).

I’m not sure I get what you’re experiencing: with a single chapter, do
you have the fancy layout or not?

It would make sense that the fancy chapter doesn’t appear only compiling
a chapter. I guess there is no \startbodymatter...\stopbodymatter
wrapping it.

Another approach would be:

\setuphead
   [chapter]
   [align=flushright,
textcommand=\groupedcommand{\blank[medium]}{},
numbercolor=darkgray,
textstyle=ChapterTextStyle,
numberstyle=ChapterNumberStyle,
before=\startChapterFrame,
after=\stopChapterFrame,
header=high]

\setuphead
  [title]
  [header=empty,
   align=,
   textcommand=,
   textstyle=,
   style=\tfc,
   before={\blank[2*big]},
   after={\blank[2*big]}]

I hope it helps,

Pablo

--
http://www.ousia.tk
___
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] How not to display the header of the chapter page on the page with the table of contents ?

2021-08-15 Thread Pablo Rodriguez via ntg-context
On 8/15/21 12:49 PM, Fabrice Couvreur via ntg-context wrote:
> Hello,
> Wolfgang created a
> heading https://mailman.ntg.nl/pipermail/ntg-context/2021/102870.html
> for the chapters of my book.
> How can I prevent this header from appearing on the page with the table
> of contents ?

Hi Fabrice,

a simple way would be:

  \startsectionblockenvironment[bodypart]
\setuphead
   [chapter]
   [align=flushright,
textcommand=\groupedcommand{\blank[medium]}{},
numbercolor=darkgray,
textstyle=ChapterTextStyle,
numberstyle=ChapterNumberStyle,
before=\startChapterFrame,
after=\stopChapterFrame,
header=high]
  \stopsectionblockenvironment

Then use frontmatter and bodymatter.

Just in case it might help,

Pablo
--
http://www.ousia.tk
___
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] Conditional formatting with *frontpart, *bodypart, *backpart modes

2021-08-12 Thread Pablo Rodriguez via ntg-context
On 8/13/21 5:34 AM, Joey McCollum via ntg-context wrote:
> Hi,
>
> I was curious about the possibility of handling general formatting
> settings (e.g., page layout, headers and footers, page numbering,
> alignment, default body font assignment, etc.) conditionally for front,
> body, and back matter using modes.
> [...]

Hi Joey,

the command is just different:

  \startsectionblockenvironment[frontpart]
\setupbodyfont[modern]
  \stopsectionblockenvironment
  \startsectionblockenvironment[bodypart]
\setupbodyfont[pagella]
  \stopsectionblockenvironment
  \startsectionblockenvironment[backpart]
\setupbodyfont[termes]
  \stopsectionblockenvironment
  \startsectionblockenvironment[appendix]
\setupbodyfont[helvetica]
  \stopsectionblockenvironment
  \starttext
\startfrontmatter
\input knuth\par
\stopfrontmatter
\startbodymatter
\input knuth\par
\stopbodymatter
\startbackmatter
\input knuth\par
\stopbackmatter
\startappendices
\input knuth\par
\stopappendices
  \stoptext

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] JavaScript in multimedia PDF

2021-08-12 Thread Pablo Rodriguez via ntg-context
On 8/12/21 3:02 AM, Michal Vlasák via ntg-context wrote:
> On Thu Aug 12, 2021 at 12:55 AM CEST, Hans Hagen via ntg-context wrote:
>> Hi
>>
>>>  -Type = pdfconstant(MediaPermissions),
>>>  +Type = pdfconstant("MediaPermissions"),
>> That's an interesting one ... easilly goes unnoticed ... thanks
>
> To put credit where its due, this was Pablo's find.

Well, I only noticed that in the generated PDF code read:

  /Type /none

It was Michal who found the bug in the Lua code.

Many thanks for the work improving multimedia in ConTeXt,

Pablo
--
http://www.ousia.tk
___
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] JavaScript in multimedia PDF

2021-08-11 Thread Pablo Rodriguez via ntg-context
On 8/10/21 11:52 PM, Michal Vlasák via ntg-context wrote:
> On Mon Aug 9, 2021 at 8:32 AM CEST, Pablo Rodriguez via ntg-context wrote:
> [...]
>> I get exactly the same results: screen object, but null rendition.
>>
>> I have no idea what it is needed here.
>
> Sorry, in the last mail I forgot to mention one idea I had. But now I
> had time to try it, and in the end came up with three different ways to
> get it working (at least the multimedia part, didn't test the rest).

Many thanks for your in-depth reply and explanation, Michal.

Since there are some related issues, I think it is better to discuss it
in private.

Many thanks for your help again,

Pablo
--
http://www.ousia.tk
___
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] JavaScript in multimedia PDF

2021-08-09 Thread Pablo Rodriguez via ntg-context
On 8/8/21 11:00 PM, Michal Vlasák via ntg-context wrote:
> On Sun Aug 8, 2021 at 8:22 PM CEST, Pablo Rodriguez via ntg-context wrote:
>> I don’t know why I get the following message:
>>
>> TypeError: a.doc is undefined
>>
>> It seems to be caused by "app.media.openPlayer", but the code is copied
>> from the documentation Adobe released early this year.
>
> Is there a newer document than "JavaScript for Acrobat API Reference"
> (May 2015)?

Well, the link you provided
(https://mailman.ntg.nl/pipermail/ntg-context/2021/103023.html) is from
February 2021:

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsapiref.pdf

Here is the guide to developers (from the same date):

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsdevguide.pdf

> Anyways, I thought that the culprit is that you only specify the
> rendition (what to play) and not screen (where to play):
>
>
>  function GoToFirstSlide(label) {
>  this.pageNum = 0 ;
>  var rendition = this.media.getRendition(label) ;
> +var screen = this.media.getAnnots({ nPage: 0})[0];
>  var player = app.media.openPlayer({
>  rendition: rendition,
> +annot: screen,
>});
>  }
>
> But as it turns out, while the screen query succesfully returns an
> object, the rendition query returns null.
>
> The PDF 1.7 standard specifies that the name (/N) of Rendition PDF
> object should be Unicode, but that doesn't seem to make it work either,
> as does deleting the name of the media clip (which was the same).
>
> (But I now get "Invalid arguments" error for the "app.media.openPlayer"
> call, which is kind of expected.)
>
> Can you confirm, that "rendition" is null on your side as well?
>
> console.println(rendition);
> console.println(screen);
> console.show();

I get exactly the same results: screen object, but null rendition.

I have no idea what it is needed here.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] JavaScript in multimedia PDF

2021-08-08 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setupinteraction
  [state=start]

  \startJSpreamble varia used now
  this.pageNum = 0 ; // start at 0

  function GoToFirstSlide(label) {
  this.pageNum = 0 ;
  var rendition = this.media.getRendition(label) ;
  var player = app.media.openPlayer({
  rendition: rendition,
});
  }

  function GoToLastSlide(label) {
this.pageNum = this.numPages ;
  }

  function GoToNextSlide(label) {
  ++this.pageNum ;
  }

  function GoToPreviousSlide(label) {
  --this.pageNum ;
  }

  function SwitchFS() {
if (app.fs.isFullScreen == true)
  app.fs.isFullScreen = false ;
else
  app.fs.isFullScreen = true ;
  }
  \stopJSpreamble


  \setuppapersize[A9, landscape]

  \definefontfamily
  [mainface]
  [rm]
  [Latin Modern Sans]

  \definefontfamily
  [mainface]
  [ss]
  [Hans]

  \setupbodyfont
  [mainface, 25pt]

  \setupalign[middle]

  \setupfooter
  [style={\ss}]

  \def\SlideNavigationButtons{%
  \goto{A}[JS(GoToFirstSlide{mainsound})]%
  \goto{K}[JS(GoToPreviousSlide{mainsound})]%
  \goto{L}[JS(GoToNextSlide{mainsound})]%
  \goto{B}[JS(GoToLastSlide{mainsound})]
  \goto{{\ssb Q}}[JS(SwitchFS{})]%
  }

  \setupfootertexts[\SlideNavigationButtons]

  \starttext

\definerenderingwindow[soundplace]
  [width=0pt, height=0pt]

\useexternalrendering[mainsound][audio/mp3][sound.mp3][embed=yes]

\placerenderingwindow[soundplace][mainsound]
  \dorecurse{25}{\null\page}
  \stoptext

I don’t know why I get the following message:

TypeError: a.doc is undefined

It seems to be caused by "app.media.openPlayer", but the code is copied
from the documentation Adobe released early this year.

Does anyone know what is wrong here or what am I missing?

Many thanks for your help in advance,

Pablo
--
http://www.ousia.tk
___
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] Setting a heading text on its own page with \setuphead

2021-08-06 Thread Pablo Rodriguez via ntg-context
On 8/6/21 7:12 PM, Joey McCollum via ntg-context wrote:
> Hi,
>
> I'd like to define my own class of heading derived from the "part"
> heading; in the MWE below, it's called "MyPart".

Hi Joey,

these are options for \setuphead[part] (MyPart in your case):

> I'd like this heading to have the following features:
>
>   * Its title should appear in the ToC, but its number should never be
> printed in the ToC or in the text.

number=no.

>   * It should always start on an odd page.

This is the default for \setuphead[part] (only noticeable in doublesided
documents).

>   * Its text should be in a larger size than the text of the body, set
> in all caps, and set with extra letterspacing.

style is the right option there.

>   * Most importantly, the title of the heading should appear on its own
> page without a header or footer. The text of the body should begin
> on the next odd page.

placehead=yes is required for \setuphead[part]. And also for MyPart.

header=empty and footer=emtpy. For the page break before the body text,
you need after=\page.

> I was hoping to accomplish all of this within the \setuphead command,
> and it seems like this should be possible, but in the following example,
> I'm not getting the text of the header at all.

See above. I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] copies from \setupinteractionscreen not working?

2021-08-05 Thread Pablo Rodriguez via ntg-context
On 8/4/21 8:52 PM, Wolfgang Schuster via ntg-context wrote:
> Pablo Rodriguez via ntg-context schrieb am 04.08.2021 um 15:53:
>> [...]
>> I’m afraid that "copies" isn’t generating the proper /NumCopies entry in
>> the /ViewerPreferences dictionary.
>>
>> Could anyone be so kind to confirm this?
>
> A fix is needed in layo-ini.lmt, maybe not in the same way as below but
> the value has to be stored in canvas.copies.
> [...]

Many thanks for your help, Wolfgang.

Pablo
--
http://www.ousia.tk
___
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] issue with footnote in TOC

2021-08-05 Thread Pablo Rodriguez via ntg-context
On 8/5/21 11:58 PM, Hans Hagen via ntg-context wrote:
> On 8/5/2021 4:34 PM, Pablo Rodriguez via ntg-context wrote:
>> \starttext
>>\completecontent
>>\chapter{Chapter Title\footnote{With footnote}}
>>\stoptext
>
> fixed in next beta (different escaping)

Many thanks for the fast fix and the new latest.

Pablo
--
http://www.ousia.tk
___
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] issue with footnote in TOC

2021-08-05 Thread Pablo Rodriguez via ntg-context
Dear list,

compiling the following sample with current latest (2021.08.04 17:51):

  \starttext
  \completecontent
  \chapter{Chapter Title\footnote{With footnote}}
  \stoptext

The entry in the TOC for the chapter seems to have problems with the
footnote command (backslash seems to be unrecognized).

Would anyone be so kind to confirm the issue? I’m afraid it might be a
bug in current latest.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] copies from \setupinteractionscreen not working?

2021-08-04 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setupinteractionscreen[copies=5]
  \starttext
  \dorecurse{5}{\input zapf\par}
  \stoptext

The resulting file from current latest (2021.07.30 00:57) contains the
following /ViewerPreferences dictionary:

  /ViewerPreferences <<
/Duplex /Simplex
/PickTrayByPDFSize true
/PrintScaling /None
  >>

I’m afraid that "copies" isn’t generating the proper /NumCopies entry in
the /ViewerPreferences dictionary.

Could anyone be so kind to confirm this?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] issue with signature fields in Acrobat

2021-08-03 Thread Pablo Rodriguez via ntg-context
Hi Hans,

I have the following sample:

  \setupinteraction[state=start]
  \starttext
  \startTEXpage[offset=2em]
  \setupfield[ShortLine][horizontal][width=5cm,height=5em]
  \definefield [Email] [signature] [ShortLine]
  \field [Email] [your email]
  \stopTEXpage
  \stoptext

If I sign it with Acrobat Reader, Times New Roman is used instead of
MyriadPro (which is the default font used by Acrobat for signing).

Line 945 from lpdf-fld.lmt contains:

  if #collected > 0 then
  local acroform = pdfdictionary {
  NeedAppearances = pdfmajorversion() == 1 or nil,
  Fields  = pdfreference(pdfflushobject(collected)),
  CO  = fieldsetlist(calculationset),
  }
  if sometext or somefont then
  checkpdfdocencoding()
  if sometext then
  usedfonts.tttf = fontnames.tt.tf
  acroform.DA = "/tttf 12 Tf 0 g"
  end
  acroform.DR = pdfdictionary {
  Font = registerfonts(),
  Encoding = pdfdocencodingcapsule,
  }
  end
  lpdf.addtocatalog("AcroForm",pdfreference(pdfflushobject(acroform)))
  end

Would it be possible that the second conditional ("if sometext or
somefont") could be only applied if Fields doesn’t refer to signatures?

Otherwise, Acrobat will use the font specified in the dictionary. Among
other things, this breaks PDF/A documents, since the font for the
signature isn’t embedded.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Code document and simpleslides and create in one go the document with simpleslides added

2021-08-01 Thread Pablo Rodriguez via ntg-context
On 7/31/21 10:23 PM, Jeroen via ntg-context wrote:
> [...]
>   \savebuffer[list=slides, file=\jobname_slides.tex, prefix=no]

Sorry, Jeroen, this was my fault.

A simpler approach to the command above reads:

  \savebuffer[list=slides, file=slides.tex]

But then you have to invoke the file as

  \typesetfile[\jobname-slides.tex][--purgeall][object=no, width=0pt]

and the output file would read:

  \getfiguredimensions[\jobname-slides.pdf]
  \dorecurse{\noffigurepages}
  {\startTEXpage
\externalfigure[\jobname-slides.pdf][page=\recurselevel]
   \stopTEXpage}

I mean, you get hyphen instead of underscore.

I hope it may help,

Pablo
--
http://www.ousia.tk
___
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] Strange new behaviour of the mailing list

2021-08-01 Thread Pablo Rodriguez via ntg-context
On 7/31/21 11:02 PM, Henning Hraban Ramm via ntg-context wrote:
> [...]
> My Apple Mail 12.4 on Mojave shows the same message like attached (dark
> mode).

Thunderbird’s display is in the attached image.

The message list can only include a sender, since it has registered the
email address in the address book.

I think this behaviour makes most sense.

Pablo
--
http://www.ousia.tk
___
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] Code document and simpleslides and create in one go the document with simpleslides added

2021-07-31 Thread Pablo Rodriguez via ntg-context
On 7/31/21 3:27 PM, Jeroen via ntg-context wrote:
> Is there an easy way to write a Context document and also code
> simpleslides in the same document so that the simpleslides are
> automatically added to the document as for example an appendix? Ie
> one tex document with Context code, perhaps with some \input and
> something like a two-pass job.
Hi Jeroen,

not sure this might help you (I’m not sure you intend a single source
file, in addition to a single PDF document), but here you have:

  \startbuffer[slides]
  \setuppapersize[CD]
  \setupbodyfont[60pt]
  \starttext
  \dorecurse{25}
  {\startmakeup[standard][pagestate=start, style={\ss\bf}, align=center]
  Slide \pagenumber
  \stopmakeup}
  \stoptext
  \stopbuffer

  \savebuffer[list=slides, file=\jobname_slides.tex, prefix=no]

  \starttext
  \startbodymatter
  \dorecurse{25}{\input zapf\par}
  \typesetfile[\jobname_slides.tex][--purgeall][object=no, width=0pt]
  \stopbodymatter
  \startappendices
  \getfiguredimensions[\jobname_slides.pdf]
  \dorecurse{\noffigurepages}
  {\startTEXpage
\externalfigure[\jobname_slides.pdf][page=\recurselevel]
   \stopTEXpage}
  \stopappendices
  \stoptext

BTW, I cannot get simpleslides working with LMTX.

> I was thinking if the simpleslides could be saved as a number of png
> images and then with the recurse add them to the document with
> placefigure.
\externalfigure is your friend here and there is no need to convert the
slides to PNG (see above).

Just in case it may help,

Pablo
--
http://www.ousia.tk
___
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] Strange new behaviour of the mailing list

2021-07-31 Thread Pablo Rodriguez via ntg-context
On 7/30/21 11:24 PM, Otared Kavian via ntg-context wrote:
> Hi all,
>
> I noticed that beginning July 27th, the messages distributed by the
> ConTeXt mailing list appear to be from
>
>   Mailing list for ConTeXt users
>
> without the actual name of the sender appearing. It may be dependent
> on the mail client I am using (Mail.app on MacOS 11.4), but I wonder
> whether something has changed on mailing list server, and whether if
> there is something I can do to have the old behaviour (which was
> convenient when one wanted to follow up mails from some specific
> contributors).
>
> Also has anybody else noticed this change?

Hi Otared,

message headers read now:

  From: Otared Kavian via ntg-context 
  To: mailing list for ConTeXt users 
  Reply-To: mailing list for ConTeXt users 
  Cc: Otared Kavian 
  Errors-To: ntg-context-boun...@ntg.nl
  Sender: "ntg-context" 

Before they read:

  From: Otared Kavian 
  To: mailing list for ConTeXt users 
  Reply-To: mailing list for ConTeXt users 
  Errors-To: ntg-context-boun...@ntg.nl
  Sender: "ntg-context" 

I experience the same problem as yours.

Before, replying in Thunderbird (Ctrl+r) generated a private reply. I
needed to generate a reply to the list (Ctrl+Shif+l).

Right now, Ctrl+r generates a reply to the list.

It seems that there is no perfect solution to this. I mean, having both
messages sent from original sender and replied by default to the list.

I guess that this might be achieved finetuning Mailman (but I don’t know
how).

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] multimedia PDF in ConTeXt

2021-07-31 Thread Pablo Rodriguez via ntg-context
On 7/31/21 1:08 AM, Michal Vlasák via ntg-context wrote:
> [...]
> By the way, Pablo, your issue
> https://www.mail-archive.com/ntg-context@ntg.nl/msg88204.html was also
> solved in the last upload. Unfortunately it will probably not help you,
> because Acrobat no longer supports this.
> [...]
> But, you can use renderings instead:
>
> \useexternalrendering[myaudiorendering]
>   [audio/mp3][audio.mp3][embed=yes]
>
> \definerenderingwindow[audiowindow]
>   [width=0sp, height=0sp]
>
> \definelayer[resources]
> \setupbackgrounds[page][background=resources]
> \setlayer[resources]{\placerenderingwindow[audiowindow][myaudiorendering]}
>
> \goto{PLAY SOUND}[StartRendering{myaudiorendering}]
>
> This is basically the example from "/back-swf.mkiv". Works in Acrobat.
> And one can use either of the three possible file methods (embedded,
> external, URL), not just external files. The layer is so that the empty
> frame doesn't interfere with normal page content. No frame is drawn when
> both dimensions are 0, not sure if that is a behaviour one can take as
> granted. But currenntly the dimensions can't be zero.

Many thanks for your code update, Michal.

I’m extremely interested in investigating the possibilities this opens.

But I’m afraid that I will have other things to do first. It will take
me months to come back to this again.

> Hans, I would omit the check for 0 dimensions of rendering window (as
> already noted in the source, it is useful for sound). See patch below.

Many thanks for the patch and for your help,

Pablo
--
http://www.ousia.tk
___
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] multimedia PDF in ConTeXt

2021-07-31 Thread Pablo Rodriguez via ntg-context
On 7/30/21 11:57 PM, Michal Vlasák via ntg-context wrote:
> On Fri Jul 30, 2021 at 8:53 PM CEST, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Although I don’t read Czech, just out of curiosity, is your bachelor
>> thesis available on the net, Michal? Thanks to theses.cz, I found
>> https://is.muni.cz/th/t8qpp/DP_Vlasak_Michal_2015.pdf (only a name
>> coincidence, I guess).
>
> Sorry, should have shared the link at the first place.
>
> https://dspace.cvut.cz/handle/10467/95065

Many thanks for your fast reply and the link to your thesis, Michal.

>> [...]
>> Is there no way to have the video as an embedded file in the PDF
>> document? (I mean, that the file is listed when the attachment panel is
>> displayed.)
>
> Currently, only attachments are added as "embedded files" (either as
> "hidden", ending up in /EmbeddedFiles, or as "annotation" ending up as
> /FileAttachment annotation).
>
> Maybe "codeinjections.embedfile" can have the option to force the
> reference, so that the file also ends up in /EmbeddedFiles? Should it be
> default for all \externalrenderings?
> [...]
> --- a/tex/context/base/mkxl/lpdf-wid.lmt
> +++ b/tex/context/base/mkxl/lpdf-wid.lmt
> [...]

Many thanks for the patch.

It would be also great to have an option not to list some files as
embedded (adding a option "list" to "\useexternalrendering" such as in
"\useexternalrendering[myvideo][video/mp4][video.mp4][embed=yes, list=no]").

Being the default to yes, I’m thinking of cases where there is a risk
distributing the multimedia file without the embedding document, because
of the lack of context (no pun indented)

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] multimedia PDF in ConTeXt

2021-07-30 Thread Pablo Rodriguez via ntg-context
Hi Michal and Hans,

many thanks for your patch to fix multimedia objects in PDF and your
extremely interesting and in-depth explanation about multimedia in PDF.
Many thanks to Hans for the release of an updated latest with also
updated documentation.

Although I don’t read Czech, just out of curiosity, is your bachelor
thesis available on the net, Michal? Thanks to theses.cz, I found
https://is.muni.cz/th/t8qpp/DP_Vlasak_Michal_2015.pdf (only a name
coincidence, I guess).

Using your sample, I have two questions:

  \starttext
  \setupinteraction[state=start]

  \useexternalrendering[myvideo][video/mp4][video.mp4][embed=yes]

  \definerenderingwindow[myrenderingwindow]
[width=\textwidth, height=\textwidth]

  \placerenderingwindow[myrenderingwindow][myvideo]
  \stoptext

Is there no way to have the video as an embedded file in the PDF
document? (I mean, that the file is listed when the attachment panel is
displayed.)

The second question is addressed to Hans: would it be possible that
\placerenderingwindow could have another option and text as in \framed?
A workaround would be to add a layer, but too complex only for adding
usage instructions for the media usage.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] question about followingup.pdf

2021-07-24 Thread Pablo Rodriguez
On 7/22/21 3:53 PM, Hans Hagen wrote:
> On 7/22/2021 2:57 PM, Pablo Rodriguez wrote:
>> [...]
>> In latest, the PDF document for LMTX is from yesterday, but the PDF for
>> the Following Up manual is almost two years old.
>>
>> Is this intended or am I missing something?
> i just didn't regenerate the whole thing (when i add a chapter i
> generate just that) .. it's not that critical, nostly a wrapup for
> myself when working on something and users can generate it anyway

Many thanks for having updated the manual in current latest, Hans.

BTW, there is a minor issue. After the experiments scaling fonts, titles
for chapters 19
(https://www.pragma-ade.com/general/manuals/followingup.pdf#page=513)
and 20
(https://www.pragma-ade.com/general/manuals/followingup.pdf#page=517)
are displayed wrong.

Just in case it might help

Pablo
--
http://www.ousia.tk
___
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] question about followingup.pdf

2021-07-22 Thread Pablo Rodriguez
Hi Hans,

current latest has content added to the Following Up manual and also to
the LMTX manual.

In latest, the PDF document for LMTX is from yesterday, but the PDF for
the Following Up manual is almost two years old.

Is this intended or am I missing something?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] \xmlrefatt as node?

2021-07-19 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \startbuffer[test]
  

 1


 2


 3

  
  \stopbuffer

  \startxmlsetups xml:testsetups
   \xmlsetsetup{#1}{*}{-}
  \xmlsetsetup{#1}{document|div|p|a}{xml:flushing}
  \xmlsetsetup{#1}{a}{xml:*}
  \stopxmlsetups

  \xmlregistersetup{xml:testsetups}

  \startxmlsetups xml:flushing
  \xmlflush{#1}
  \stopxmlsetups

  \startxmlsetups xml:a
  \xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}\\
  \xmlrefatt{#1}{href}:\
  \doifelse
{\xmlrefatt{#1}{href}}
{\xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}}
  {yes}{no}\blank
  \stopxmlsetups

  \starttext
  \xmlprocessbuffer{main}{test}{}
  \stoptext

I need to check whether the link is inside the same div or not.

I know how to obtain the destination identifier (\xmlreffatt{#1}{href}
and I know how to obtain the identifier of the contaning div
(\xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}}).

But I don’t know how to ge the identifier of the div which contains the
destination idetifier.

How could I get that?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] drop cap (initial) and indentation

2021-07-19 Thread Pablo Rodriguez
On 7/18/21 11:54 PM, Gerben Wierda wrote:
> With the following minimal example:
> [...]
> both the initial and the bold stuff after it is indented. With hoffset I
> can move the initial, but not what comes after. I have been
> experimenting but haven’t found a way to solve this.

Hi Gerben,

this might be what you need:

  % Every chapter body text starts with a drop cap:
  \setupindenting[yes, medium]

  \starttext
  \chapter{Chapter}

  \placeinitial So it was. \input knuth

  \placeinitial So it was. \input knuth

  \noindentation
  \placeinitial So it was. \input knuth
  \stoptext

Sectioning commands never indent next paragraph by default. You have to
type either \setuphead[chapter][indentnext=yes] or
\setupheads[indentnext=yes] to enable it.

If every chapter starts with an initial,
\setuphead[chapter][after={\blank[2*big]\placeinitial}] enables this
automatically (\blank[2*big] is the default command after chapter).

> [...]
> PS. switching \kap and \bf has an interesting result, the first
> character of the words is not in bold. This did not happen with lettrine
> in mkii,

Please, avoid adding questions after a multiline signature (because the
lines might be look like belonging to the signature, and not as a
question to the list).

This might help in LMTX:

  \definefontfeature[allcaps][uppercasing=yes]
  \starttext
  \startTEXpage[offset=1em]
  {\feature[+][allcaps]\bf uppose we}
  \stopTEXpage
  \stoptext

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] (no subject)

2021-07-18 Thread Pablo Rodriguez
On 7/17/21 8:38 AM, T. Kurt Bond wrote:
> I have the following file:
>
> \setupfloat[table][default=nonumber]
>
> \starttext
> \startplacetable[title={Table With A Caption},location=force]
>   \bTABLE
>   \bTR\bTD r2c1 \eTD\bTD r2c2\eTD\eTR
>   \eTABLE
> \stopplacetable
> \stoptext
> [...]
> Why does the last table have "Table 1", when there is
> a \setupfloat[table][default=nonumber]?

Hi Kurt,

I think this might be what you intend:

   \setupcaption[table][number=no]

   \starttext
   \startplacetable[title={Table With A Caption},location=force]
 \bTABLE
 \bTR\bTD r2c1 \eTD\bTD r2c2\eTD\eTR
 \eTABLE
   \stopplacetable
   \stoptext

As to your quetsion, I have no idea why this happens.

Just in case it might help,

Pablo
--
http://www.ousia.tk
___
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] LMTX and lettrine

2021-07-18 Thread Pablo Rodriguez
On 7/18/21 3:35 PM, Gerben Wierda wrote:
> I am trying to find out how to move this setup in mkii
>
> 23     \usemodule[lettrine]
> 24 >>  \setuplettrine[Lines=3,
> 25                    Hang=.5,
> 26                    Oversize=0,
> 27                    Raise=0,
> 28                    Findent=0pt,
> 29                    Nindent=0em,
> 30                    Slope=0em,
> 31                    Ante=,
> 32                    FontHook=,
> 33                    TextFont=\sc,
> 34                    Image=no]
>
> to lmtx. (Basically, ConTeXtgarden gives my mike info for lettrine)

Hi Gerben,

\setupinitial is your friend.

i-context.pdf (included in LMTX) contains the available options
(searching for "\setupinitial [", without quotation marks).

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] number in \doloopoverlist?

2021-07-14 Thread Pablo Rodriguez
On 7/14/21 9:06 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 14.07.2021 um 20:41:
>> Dear list,
>>
>> I have the following sample:
>>
>>\starttext
>>\doloopoverlist{a,b,c,d}
>>  {\recursestring, number: \recurselevel\\}
>>\stoptext
>>
>> Which is the way to get the number when looping over a list?
>
> There is no number, you're just iterating over a list.

Many thanks for your reply, Wolfgang.

I thought that iterations were numbered when loops took place.

This is now clear to me now.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] number in \doloopoverlist?

2021-07-14 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \starttext
  \doloopoverlist{a,b,c,d}
{\recursestring, number: \recurselevel\\}
  \stoptext

Which is the way to get the number when looping over a list?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] double-sided page number placement

2021-07-11 Thread Pablo Rodriguez
On 7/11/21 5:07 PM, Charles Doherty wrote:
> [...]
> the left page of the double spread places the page number on the left
> margin of the page and in the right page it is placed on the right
> margin. This is what I would like to get in LMTX as well. Am I doing
> something wrong here?

Hi Charles,

I think that "inright" is what you want:

  \setuppagenumbering[alternative=doublesided,
  location=inright]

  \starttext
  \dorecurse{20}{\input knuth }
  \stoptext

With current latest from 2021.07.10 21:51, "location=inright" behaves as
you expect using LMTX.

Using MKIV with the current latest, there is no difference between
"location=inright" and "location=inmargin".

I don’t know whether this is intended or not.

I hope it might help,

Pablo
--
http://www.ousia.tk
___
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] LMTX crashes with source

2021-07-11 Thread Pablo Rodriguez
On 7/8/21 7:38 PM, Hans Hagen wrote:
> On 7/7/2021 6:51 PM, Pablo Rodriguez wrote:
>> [...]
>> I get a crash when using LMTX, but not with MkIV (in both Windows and
>> Linux). I’m afraid it might be a bug.
>>
> hm, not related to the font .. tricky to trace, the real cause

Many thanks for your fix in current latest, Hans.

Pablo
--
http://www.ousia.tk
___
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] LMTX crashes with source

2021-07-07 Thread Pablo Rodriguez
Dear list,

I have the following source:

  \definefontfamily [malayalam] [rm] [RIT Rachana]
  %~ [features=malayalam-two]
  \setupbodyfont [malayalam]
  \starttext
  \startTEXpage
  \tf അദ്ധ്യായം\\
  \em അദ്ധ്യായം\\
  \em\bf അദ്ധ്യായം\\
  \em അദ്ധ്യായം
  \stopTEXpage
  \stoptext

Using latest from 2021.07.06 18:49 and the following fonts:

  http://rachana.org.in/downloads/RIT-Rachana-Regular.ttf
  http://rachana.org.in/downloads/RIT-Rachana-Italic.ttf
  http://rachana.org.in/downloads/RIT-Rachana-Bold.ttf
  http://rachana.org.in/downloads/RIT-Rachana-BoldItalic.ttf

I get a crash when using LMTX, but not with MkIV (in both Windows and
Linux). I’m afraid it might be a bug.

Could anyone confirm the issue?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Proper ligatures in Malayalam

2021-07-07 Thread Pablo Rodriguez
On 7/6/21 7:44 PM, Ajith R wrote:
> Hi Pablo,
>
> Just to be sure that you have the correct ligature, will you please
> share a picture or pdf of the rendered text?

Hi Ajith,

sure, the output from the following source:

  \setupinteraction[state=start]
  \setupinteractionscreen[option=max]
  \definefontfamily [malayalam] [rm] [RIT Rachana]
  [features=malayalam-two]
  \setupbodyfont [malayalam]
  \setupattachments[method=hidden]
  \attachment[file=\jobname.tex]
  \attachment[file=http://rachana.org.in/downloads/RIT-Rachana-Regular.ttf]
  \attachment[file=http://rachana.org.in/downloads/RIT-Rachana-Italic.ttf]
  \attachment[file=http://rachana.org.in/downloads/RIT-Rachana-Bold.ttf]

\attachment[file=http://rachana.org.in/downloads/RIT-Rachana-BoldItalic.ttf]
  \starttext
  \startTEXpage[offset=1ex]
  \tf അദ്ധ്യായം\\
  \em അദ്ധ്യായം\\
  \em\bf അദ്ധ്യായം\\
  \em അദ്ധ്യായം
  \stopTEXpage
  \stoptext

is located at https://pdf.ousia.tk/ml.pdf.

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] Proper ligatures in Malayalam

2021-07-07 Thread Pablo Rodriguez
On 7/7/21 8:57 AM, Aditya Mahajan wrote:
> On Tue, 6 Jul 2021, Ajith R wrote:
>> Hi,
>>
>> I am running Debian 10 and context --version returns
>> [...]
>> mtx-context | current version: 2018.04.04 00:51
>
> This is more than 3 years old! You will need to update. Not sure if
> there is a debian package for LMTX. You can always install it in
> parallel to the system installation by following the instructions on the
> wiki.

Hi Ajith,

as Aditya mentioned, this version is too old (maybe it even lacks the
mlm2 script).

This old version won’t be fixed now (I’m afraid).

I hope it helps,

Pablo
--
http://www.ousia.tk
___
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] Proper ligatures in Malayalam

2021-06-26 Thread Pablo Rodriguez
On 6/25/21 1:17 PM, ajithramay...@yahoo.co.in wrote:
> Hi Pablo

Hi Ajith,

it isn’t clear to me whether you got the right ligatures with the sample
included in https://mailman.ntg.nl/pipermail/ntg-context/2021/102635.html.

I also wonder whether the feature "malayalam-two" got you the proper
ligatures for your original sample included in
https://mailman.ntg.nl/pipermail/ntg-context/2021/102631.html.

Just in case it might help,

Pablo
--
http://www.ousia.tk
___
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] injectors not working in LMTX?

2021-06-26 Thread Pablo Rodriguez
On 6/25/21 5:15 PM, Hans Hagen wrote:
> On 6/24/2021 6:44 PM, Rik Kabel wrote:
>> [...]
>> In trying to tune a toc, I discovered that this is still an issue.
>
> fixed in next upload

Many thanks for your fix, Hans.

And many thanks also to you, Rik, for reporting the pending issue.

Pablo
--
http://www.ousia.tk
___
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] Proper ligatures in Malayalam

2021-06-24 Thread Pablo Rodriguez
On 6/24/21 10:25 AM, Ajith R wrote:
> Hi,
>
> I tried to make a document in Malayalam, an Indian language. However, the 
> ligatures don't form as expected. 
> [..]
> What setting am I missing?

Hi Ajith,

I don’t have any idea about Malayalam (or any other Indic language [I
can deal with Latin and Greek scripts only, I’m afraid]), but this seems
to work fine.

\mainlanguage[ml]
\definefontfamily [malayalam] [rm] [RIT Rachana]
[features=malayalam-two]
\setupbodyfont [malayalam]
\starttext
\tf അദ്ധ്യായം\\
\em അദ്ധ്യായം\\
\bf അദ്ധ്യായം\\
\em അദ്ധ്യായം
\stoptext

Fonts are RIT Rachana from http://www.rachana.org.in/.

The relevant feature here malayalam-two. I used serif (or rm), since the
font looked to me more serif than sans-serif (Latin glyphs are clearly
from a serif font).

> The expected form is show in libre office with the same text and font, 
> attached as an image

I would say that with malayalam-two ligatures are the same ones as in
LibreOffice.

Just in case it might help,

Pablo
--
http://www.ousia.tk
___
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] Setup output name from within ConTeXt document

2021-06-23 Thread Pablo Rodriguez
On 6/23/21 9:26 AM, Hans Hagen wrote:
> On 6/22/2021 1:55 PM, Pascal Pascali wrote:
>> Dear ConTeXt community,
>>
>> Is it possible to set the file name of the output from within the document?
> [...]
> \startluacode
> luatex.wrapup(
>  function()
>  os.remove("new.pdf")
>  os.rename("old.pdf","new.pdf")
>  end
> )
> \stopluacode

Many thanks for your reply, Hans.

Just a question, which is the gain of wrapping os.rename() in a function?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] new upload lmtx

2021-06-23 Thread Pablo Rodriguez
On 6/18/21 11:46 PM, Hans Hagen wrote:
> Hi,
>
> End of the week so time to wrap up.
> [...]
> (2) (Pablo:) There is some progress with facing floats that Thomas will
> check out for real usage. So, still experimental.

Excellent news, Hans.

Many thanks for your work, Hans and Thomas.

Pablo
--
http://www.ousia.tk
___
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] xtable as list item (again)

2021-06-17 Thread Pablo Rodriguez
On 6/16/21 9:56 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 15.06.2021 um 19:57:
>>[...]
>>\showframe\showstruts
>>\starttext
>>\startitemize[n][margin=yes]
>>\item a
>>\item
>>  \startembeddedxtable[option={stretch, width}]
>>  \dorecurse{25}{\startxrow
>>\startxcell \Characters{\recurselevel}\stopxcell
>>\startxcell \characters{\recurselevel}\stopxcell
>>  \stopxrow}
>>\stopembeddedxtable
>
> \item
>\startfixed
>  % put your table here
>\stopfixed

Many thanks for your help, Wolfgang.

This worked like a charm.

First time I’m aware of this command.

Many thanks for your help again,

Pablo
--
http://www.ousia.tk
___
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] *keep-pdf.pdf files included in latest

2021-06-16 Thread Pablo Rodriguez
Hans,

current latest from 2021.06.14 17:16 includes both s-inf-01-pdf-keep.pdf
and s-inf-03-pdf-keep.pdf.

I wonder whether these files are part of the distribution.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] xtable as list item (again)

2021-06-15 Thread Pablo Rodriguez
Dear list,

I already posted a similar question some time ago
(https://mailman.ntg.nl/pipermail/ntg-context/2021/101021.html), but I
got no reply.

I have the following sample:

  \showframe\showstruts
  \starttext
  \startitemize[n][margin=yes]
  \item a
  \item
\startembeddedxtable[option={stretch, width}]
\dorecurse{25}{\startxrow
  \startxcell \Characters{\recurselevel}\stopxcell
  \startxcell \characters{\recurselevel}\stopxcell
\stopxrow}
  \stopembeddedxtable
  \item b
  \stopitemize
  \stoptext

And I get two issues:

1. Item number in 2 is placed on the bottom of the xtable. I need it on
the top of the xtable.

2. There is an extra horizontal space before the xtable. How can I get
rid of it? (In my real-world document, the space before is huge. In any
case, it misplaces the xtable.)

Maybe my approach is wrong, but I need the xtable as part of a list (and
I need it to strecht it horizontally).

Does anyone know how to achieve this?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] new upload

2021-06-14 Thread Pablo Rodriguez
On 6/14/21 5:22 PM, Hans Hagen wrote:
> On 6/14/2021 5:13 PM, Pablo Rodriguez wrote:
>> [...]
>> Sorry, but I have no idea about what I may be doing wrong (or whether
>> there is an issue here).
> The interface is evolving (so it's not meant for production ... it's
> what Thomas and i are exploring so it might change till it suits his needs).

Many thanks for your fast reply, Hans.

It would be great to have facing streams in ConTeXt.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] new upload

2021-06-14 Thread Pablo Rodriguez
On 6/13/21 7:31 PM, Hans Hagen wrote:
> Hi,
>
> A few things
>
> (1) Thomas and I picked up the facing floats thread. I will probably
> remove the experimental code from mkiv and only work on the lmtx
> implementation. The same can be true for streams.

Many thanks for the new latest, Hans.

I have compiled the sample from page-ffl.mkxl:

  \starttext
  \definefacingfloat
  [whatever]

  \setupfacingfloat
  [whatever]
  [style=bold,
   width=frame,
   offset=10pt,
   color=white]

  \setupfacingfloat
  [whatever:left]
  [background=color,
   backgroundcolor=red]

  \setupfacingfloat
  [whatever:right]
  [background=color,
   backgroundcolor=green]

  \startfacingfloat[whatever]
{\dorecurse{10}{\samplefile{tufte} }}
{\dorecurse{10}{\samplefile{ward}  }}
{\dorecurse{10}{\samplefile{tufte} }}
{\dorecurse{10}{\samplefile{ward}  }}
  \stopfacingfloat

  \startfacingfloat[whatever]
\startcontent \dorecurse{10}{\samplefile{tufte} } \stopcontent
\startcontent \dorecurse{10}{\samplefile{ward}  } \stopcontent
\startcontent \dorecurse{10}{\samplefile{tufte} } \stopcontent
\startcontent \dorecurse{10}{\samplefile{ward}  } \stopcontent
  \stopfacingfloat

  \dorecurse{10}{\samplefile{sapolsky} }
  \stoptext

I’m afraid that the resulting PDF document only contains the text from
Sapolsky (no facing floats).

Sorry, but I have no idea about what I may be doing wrong (or whether
there is an issue here).

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] new upload / math

2021-06-11 Thread Pablo Rodriguez
On 6/11/21 6:08 PM, Hans Hagen wrote:
> Hi,
>
> In addition the the mentioned integral trickery we can now do this
>
> \setupbodyfont[newcomputermodern-book]

Hi Hans,

many thanks for the new upload.

I’m afraid that now slanted for New Computer Modern Mono doesn’t work:

  \mainlanguage[agr]
  \setupbodyfont[newcomputermodern]
  \starttext
  {\tt\bi\input aristotle-grc\par}
  \tt\it\input aristotle-grc\par
  \stoptext

"newcmmono10-oblique.otf" is actually "newcmmono10-italic.otf". Naming
isn’t consistent in those fonts (italic and bold oblique, I’m afraid).

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] upload / some new math stuff

2021-06-11 Thread Pablo Rodriguez
On 6/10/21 11:35 PM, Hans Hagen wrote:
> [...]
> I made a typescript for the 10pt regular and book (as I see no reason to
> configure 8pt).  So, assuming that one installs these fonts:
>
> \setupbodyfont[newcomputermodern-book]
> \setupbodyfont[newcomputermodern]
> [...]
> Happy testing (hopefully there are no side effects).

Many thanks for the new latest, Hans.

The following sample shows an issue with "newcmmono10-bolditalic.otf":

  \mainlanguage[agr]
  \definefontfamily[another][rm][Another]
[tf=file:newcmmono10-boldoblique.otf]
  \setupbodyfont[newcomputermodern]
  \starttext
  \tt\bi\input aristotle-grc\par
  \switchtobodyfont[another]
  \input aristotle-grc\par
  \it\input aristotle-grc
  \stoptext

I’m afraid that there is no "newcmmono10-bolditalic.otf", but
"newcmmono10-boldoblique.otf".

The following patch fixes the issue:

---
context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv
2021-06-11 16:58:53.742990586 +0200
+++ type-imp-newcomputermodern.mkiv 2021-06-11 16:51:57.861274985 +0200
@@ -46,7 +46,7 @@
 \definefontsynonym [\s!MonoItalic]
[\s!file:newcmmono10-italic.otf]
[\s!features=\s!none,\s!fallbacks=\s!MonoItalic]
-\definefontsynonym [\s!MonoBoldItalic]
[\s!file:newcmmono10-bolditalic.otf]
[\s!features=\s!none,\s!fallbacks=\s!MonoBoldItalic]
+\definefontsynonym [\s!MonoBoldItalic]
[\s!file:newcmmono10-boldoblique.otf]
[\s!features=\s!none,\s!fallbacks=\s!MonoBoldItalic]
 \stoptypescript

 \starttypescript [\s!math][newcomputermodern] [\s!name]
@@ -76,7 +76,7 @@
 \definefontsynonym [\s!MonoItalic]
[\s!file:newcmmono10-bookitalic.otf]
[\s!features=\s!none,\s!fallbacks=\s!MonoItalic]
-\definefontsynonym [\s!MonoBoldItalic]
[\s!file:newcmmono10-bolditalic.otf]
[\s!features=\s!none,\s!fallbacks=\s!MonoBoldItalic]
+\definefontsynonym [\s!MonoBoldItalic]
[\s!file:newcmmono10-boldoblique.otf]
[\s!features=\s!none,\s!fallbacks=\s!MonoBoldItalic]
 \stoptypescript

 \starttypescript [\s!math][newcomputermodern-book] [\s!name]

Many thanks for your excellent work with ConTeXt,

Pablo
--
http://www.ousia.tk
___
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] PDF forms not creating proper children

2021-06-09 Thread Pablo Rodriguez
On 6/9/21 12:28 PM, Leonard Janis Robert König wrote:
> On Tue, 2021-06-08 at 23:29 +0100, Adam Reviczky wrote:
>> Not sure how good it is, but in the poppler discussion this site was
>> mentioned to verify the signature details:
>> https://validator.docusign.com/
>
> Oh, that's a great tool, thanks!

Many thanks for the link to the tool, Adam.

Pablo
--
http://www.ousia.tk
___
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] PDF forms not creating proper children

2021-06-09 Thread Pablo Rodriguez
On 6/8/21 11:07 PM, Leonard Janis Robert König wrote:
> On Tue, 2021-06-08 at 17:41 +0200, Pablo Rodriguez wrote:
>> [...]
>> Try to open a PDF document signed with mupdf-gl in Acrobat (Reader or
>> not). You will see that the signature is wrong.
>
> Hm, I tested with Okular, Firefox and MasterPDF as I don't have Acrobat
> on Linux [...]

Hi Leo,

Acrobat for Linux is available (although the version is too old) at
ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/.

Acrobat isn’t able to deal with the signature annotation and with the
>> Sorry, objects is a very special term in PDF parlance. It has nothing
>> to do with signatures.

Here is a description:
https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#search=4.35
(link should work with Firefox).

But you might check yourself with the following sample:

  \setuppapersize[A10, landscape]
  \setuplayout[page]
  \setupinteraction[state=start]
  \starttext
  \setupfield[sl][horizontal]
[frame=on, width=\textwidth, height=\textheight]
  \definefield[x][signature][sl]
  \field[x]
  \stoptext

The attached certificate has the password 123456.

Only mupdf-gl sees the signature annotation after signing it. Acrobat,
Evince, Okular and xpdf cannot deal with the signature.

https://validator.docusign.com/ gives a warning:

  This document doesn't have any digital signatures.

I hope it might help,

Pablo
--
http://www.ousia.tk


JohnDoe.pfx
Description: application/pkcs12
___
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] PDF forms not creating proper children

2021-06-08 Thread Pablo Rodriguez
On 6/7/21 10:43 PM, Leonard Janis Robert König wrote:
> Hi Adam, Hi Pablo,
>
> I just noticed your replies, sorry for the late answer!
>
> I could sign forms with both okular as well as mupdf just fine,
> although the behavior is different.  The former assumes that the field
> is already an existing signature and segfaults when you look at the
> properties, but cann successfully add another signature using the
> "Tools" menu.

Hi Leo,

I’m afraid that I don’t use Okular.

>  With the latter you can click on the form field to
> trigger a menu to select the signature you want to sign with, and it
> "replaces" the "empty" signature generated by ConTeXt.  Both work fine,
> even with my newer ConTeXt.

mupdf-gl signs the document, but in a way that only mupdf-gl understands it.

Try to open a PDF document signed with mupdf-gl in Acrobat (Reader or
not). You will see that the signature is wrong.

>> On Sun, May 2, 2021 at 5:50 PM Pablo Rodriguez  wrote:
>>> [...]
>>> From my experience, only Acrobat deals with child objects in
>>> signatures
>>> generating a valid signature (and rewriting the two objects into a
>>> single one).
>
> As mentioned above, it seems that mupdf (now?) actually rewrites "both"
> signatures into one, however Okular doesn't.

Sorry, objects is a very special term in PDF parlance. It has nothing to
do with signatures.

Just in case it might help,

Pablo
--
http://www.ousia.tk
___
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] issue with link (MkIV & LMTX)

2021-06-05 Thread Pablo Rodriguez
On 6/5/21 4:07 PM, Hans Hagen wrote:
> On 6/5/2021 11:08 AM, Pablo Rodriguez wrote:
>> [...]
>> Could anyone confirm the issue?
>
> a side effect of more detail in final node lists (that make up the lines)
>
>> Many thanks for your help,
> fixed in next upload

Hans, many thanks for the fix.

Pablo
--
http://www.ousia.tk
___
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] issue with link (MkIV & LMTX)

2021-06-05 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \setuppapersize[A10]
  \setupinteraction[state=start]
  \enabledirectives[references.border]
  \unexpanded\def\MyURL#1%
{\bgroup\goto{{\tt\hyphenatedurl{#1}}}[url(#1)]\egroup}
  \starttext
  \startTEXpage[offset=1ex]
  \startitemize
  \item \MyURL{a.b\\/c.d\letterhash e}
  \stopitemize
  \stopTEXpage
  \stoptext

I’m using current latest from 2021.06.04 17:28.

LuaTeX generates the link rectangle right.

LuaMetaTeX generates a wrong link rectangle.

In the attached image, you can see the output I get (MkIV and LMTX).

Could anyone confirm the issue?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] different prefixsegments for \in

2021-06-04 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \setupreferencestructureprefix
[default]
[prefixsegments=*:*]
  \starttext
  \section{One Section}
  \subsection[sec0]{Subsection}
  As told in \in[sec0] and \in[sec1]…
  \section{Another Section}
  \subsection[sec1]{Subsection}
  …
  \stoptext

The output reads:

  As told in 1.1 and 2.1…

I would like to be able to supress the section number in the reference,
if the current section is the same as the referenced one.

I mean, I would like that the output reads:

  As told in 1 and 2.1…

Which would be the way to do it automatically?

BTW, in my real--world document, I need to remove part and chapter
numbers from the reference when in the same part and chapter (when
compiling XML sources).

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] new upload

2021-06-04 Thread Pablo Rodriguez
On 6/4/21 7:43 PM, Hans Hagen wrote:
> On 6/4/2021 6:18 PM, Pablo Rodriguez wrote:
>> On 6/4/21 5:46 PM, Hans Hagen wrote:
>>> Hi,
>>>
>>> I uploaded a new version of lmtx [...]
>> Hans,
>>
>> at least on Linux64, if I compile a source file named "mwe.tex", I get
>> an extra "mwe-pdf-keep.pdf", either with or without invoking the option
>> "--purgeall".
>> [...]
>> I’m afraid that this might be a bug.
>
> more an incomplete feature (should normally not be done) [...]
> no fix-upload today (not for a one line fix)
>
> thanks for noticing,

Many thanks for the fast reply, Hans.

Fine for me, this is not that important.

Pablo




--
http://www.ousia.tk
___
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] new upload

2021-06-04 Thread Pablo Rodriguez
On 6/4/21 5:46 PM, Hans Hagen wrote:
> Hi,
>
> I uploaded a new version of lmtx [...]
Hans,

at least on Linux64, if I compile a source file named "mwe.tex", I get
an extra "mwe-pdf-keep.pdf", either with or without invoking the option
"--purgeall".

This happens both with MkIV (LuaTeX 1.13 7420 + ConTeXt MkIV 2021.06.04
17:28) and LMTX (LuaMetaTeX 2.09 20210531 + ConTeXt LMTX 2021.06.04 17:28).

Contents seem to be irrelevant, but actual contents of "mwe.tex" read:

  \starttext
  \input zapf
  \stoptext

I’m afraid that this might be a bug.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] Fwd: --luatex option failing

2021-05-29 Thread Pablo Rodriguez
On 5/29/21 2:38 AM, jbf wrote:
> Pablo, thanks for the assistance you gave me... it made me look at the
> cache inside the lmtx folders and I could see that the entire luatex
> folder was missing. I did try your --erase and --generate moves, but
> that did nothing to resolve things, so I installed the latest 2021.05.27
> 14:15 and the problem is resolved.

Julian,

glad to read it worked fine with current latest.

Pablo
--
http://www.ousia.tk
___
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] --luatex option failing

2021-05-28 Thread Pablo Rodriguez
On 5/28/21 12:00 PM, Hans Hagen wrote:
> On 5/28/2021 11:40 AM, jbf wrote:
>> [...]
>> As this may be an 'ignorant' kind of question, something I should really
>> know but don't, about paths and permissions, there may be someone else
>> on the list with time (in lockdown like I am) to put me right.
> you need help from a linux expert indeed

Just a comment. I also experienced problems in Linux with --luatex some
days ago.

I got everything right with current latest (2021.05.27 14:15).

I would erase the cache and try it again:

  mtxrun --script cache --erase && mtxrun --generate

I’m not a Linux expert at all. But this might help.

Pablo
--
http://www.ousia.tk
___
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] wrong link rectagle in LMTX

2021-05-28 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \setuppapersize[A9]
  \setupinteraction[state=start]
  \enabledirectives[references.border]
  \unexpanded\def\MyURL#1%
{\bgroup\goto{{\tt\hyphenatedurl{#1}}}[url(#1)]\egroup}
  \starttext
  \startitemize
  \dorecurse{2}{\item \MyURL{a.b\\/c.d\letterhash e}}
  \stopitemize
  \stoptext

I get an unindented link rectangle with LMTX (2021.05.27 14:15). Using
--luatex, the link rectangle is perfectly fine.

Could anyone confirm the issue?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] styling references

2021-05-28 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \starttext
  \startitemize
  \dorecurse{15}
{\item[\recurselevel]whatever}
  \stopitemize

  As exposed in \in{item}[9]...
  \stoptext

How can I add style to the item reference (9)?

I mean, how can I get “As exposed in item {\em 9}”?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] new upload

2021-05-26 Thread Pablo Rodriguez
On 5/25/21 6:20 PM, Hans Hagen wrote:
> [...] but for those willing to check the alternative, in
> page-ins.mkxl one can uncomment
>
> % \insertmode\plustwo

Many thanks for the new upload, Hans.

I’m extremely interested in testing this.

How can we enable this feature in a permanent way?

I mean, how can we avoid that an update disables it?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] \switchtobodyfont issue

2021-05-22 Thread Pablo Rodriguez
On 5/22/21 1:10 PM, Wolfgang Schuster wrote:
> [...]
> You can't use x and a with \switchtobodyfont, only small and big are
> possible.
>
> \starttext
> a
> \switchtobodyfont[small]
> a
> \switchtobodyfont[big]
> a
> \stoptext
Many thanks for your fast reply, Wolfgang.

This works fine with standard sizes:

  \starttext
  a
  \switchtobodyfont[x]
  a
  \stoptext

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] \switchtobodyfont issue

2021-05-22 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \setupbodyfont[11.25pt]
  \starttext
  a
  \switchtobodyfont[x]
  a
  \switchtobodyfont[a]
  a
  \stoptext

How can I get both \switchtobodyfont working in both appearances?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] \setupbackend[space=yes] and hz

2021-05-22 Thread Pablo Rodriguez
On 5/22/21 12:25 PM, Hans Hagen wrote:
> On 5/22/2021 11:28 AM, Pablo Rodriguez wrote:
>> [...]
>> Using SumatraPDF-3.1.2 and current latest (from 2021.05.21 15:07),
>> spacing is only right when I disable font expansion.
>>
>> Would it be possible that spacing be the same with and without font
>> expansion?
> not sure what you mean but using hz without stretch (and/or tolerance)
> makes no sense
>
>\setupalign
>  [hz,stretch] % maybe also add tolerant

It doesn’t make any difference in the text spacing (searching and
copying) in the minimal sample.

> also, you should update your sumatra (I have 3.3 and am not going to
> waste time on older versions).

I wish I could. PDF annotations are a mess in MuPDF (this affects
versions from 3.2).

PDF annotations in SumatraPDF-3.3 are huge, even preventing the text
from being readable. And they are always printed (since all contain "/F
4"), no matter that no appearance dictionary allows to print them.

I have already discussed that with people from Artifex, but it seems
that they won’t change their mind about this.

It would be helpful that PDF annotations in ConTeXt with no associated
appearance dictionary could have "/F 0" (so that MuPDF doesn’t print them).

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] \setupbackend[space=yes] and hz

2021-05-22 Thread Pablo Rodriguez
Hi Hans,

I have the following sample:

  \definefontfeature
[default]
[default]
[expansion=quality]
  \setupalign
[hz]

  \setuppapersize[A6]
  \setupbodyfont[pagella]
  \setupbackend [space=yes]
  \starttext
\input zapf
  \stoptext

Using SumatraPDF-3.1.2 and current latest (from 2021.05.21 15:07),
spacing is only right when I disable font expansion.

Would it be possible that spacing be the same with and without font
expansion?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] underscore hyphenation and hz

2021-05-17 Thread Pablo Rodriguez
On 5/10/21 3:35 PM, Pablo Rodriguez wrote:
> Hans,
>
> I’m afraid that underscore hyphenation has issues with font expansion:
> [...]

Hans,

many thanks for the fix in current latest (2021.05.15 22:45).

Pablo
--
http://www.ousia.tk
___
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] underscore hyphenation and hz

2021-05-10 Thread Pablo Rodriguez
Hans,

I’m afraid that underscore hyphenation has issues with font expansion:

  \startluacode
  function document.addfunnyhyphen(tfmdata)
  local underscore = utf.byte("_")
  local char   = tfmdata.characters[underscore]
  if not char then return end
  tfmdata.characters[0xFE000]   = {
  width= 0,
  height   = 0,
  depth= 0,
  commands = {
  { "right", -char.width },
  { "down", char.depth },
  { "slot", 1, underscore },
  }
  }
  end


  utilities.sequencers.appendaction("aftercopyingcharacters",
  "after","document.addfunnyhyphen")

  local shared = {
  start  = 1,
  length = 1,
  before = utf.char(0xFE000),
  after  = nil,
  left   = false,
  right  = false,
  }

  local all = table.setmetatableindex({ }, function(t,k)
  return shared
  end)

  languages.hyphenators.traditional.installmethod("sha",
  function(dictionary,word,n)
  return all
  end)
  \stopluacode

  \definehyphenationfeatures
 [sha]
 [characters=all,
  alternative=sha,
  righthyphenchar="FE000]

  \definefontfeature
[default]
[default]
[expansion=quality]

  \setupalign[hz]
  \sethyphenationfeatures[sha]%
  \setuphyphenation[method=traditional]%

  \starttext
\hsize\zeropoint
abcde
  \stoptext

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] underscore hyphenation not working

2021-05-10 Thread Pablo Rodriguez
On 5/10/21 9:36 AM, Hans Hagen wrote:
> [...]
> but at the cost of runtime you can try \setupbackend [space=yes]

It works perfectly fine, but not with font expansion:

  \definefontfeature
[default]
[default]
[expansion=quality]
  \setupalign
[hz]

  \setuppapersize[A6]
  \setupbodyfont[pagella]
  \setupbackend [space=yes]
  \starttext
\input zapf
  \stoptext

  Com i ng back t o t he use o f ty pe f aces i n
  e l ec tr on i c pub li sh i ng : man y o f t he new
  ty pog r aphe r s r ece iv e t he ir know l edge and
  i n f o r ma ti on abou t t he r u l es o f ty pog r a -
  ph y fr om books , fr om compu t e r maga -
  z i nes o r t he i ns tr uc ti on manua l s wh i ch
  t he y ge t w it h t he pu r chase o f a PC o r so ft-
  wa r e . T he r e i s no t so much bas i c i ns tr uc -
  ti on , as o f now , as t he r e was i n t he o l d
  da y s , show i ng t he d iff e r ences be t ween
  good and bad ty pog r aph i c des i gn . Man y
  peop l e a r e j us t f asc i na t ed b y t he ir PC ' s
  tri cks , and t h i nk t ha t a w i de ly -- p r a i sed
  p r og r am , ca ll ed up on t he sc r een , w ill
  make e v e ryt h i ng au t oma ti c fr om now on .

Pablo
--
http://www.ousia.tk
___
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] underscore hyphenation not working

2021-05-10 Thread Pablo Rodriguez
On 5/9/21 7:46 PM, Hans Hagen wrote:
> [...]
> you can also retest the advance

It works fine now.

A minor issue happens with SumatraPDF-3.1.2 (aside from font advance):

  \setuppapersize[A6]
  \definefontfamily[mainface][rm]
  [TeX Gyre Pagella]
  \setupbodyfont[mainface]
  \starttext
\input zapf
  \stoptext

Lines 3, 7, 10, 12 and 13 lack spaces between words:

  Coming back to the use of typefaces in
  electronic publishing: many of the new
  typographersreceivetheirknowledgeand
  information about the rules of typogra-
  phy from books, from computer maga-
  zines or the instruction manuals which
  theygetwiththepurchaseofaPCorsoft-
  ware. There is not so much basic instruc-
  tion, as of now, as there was in the old
  days,showingthedifferencesbetweengood
  and bad typographic design. Many peo-
  plearejustfascinatedbytheirPC'stricks,
  andthinkthatawidely--praisedprogram,
  called up on the screen, will make every-
  thing automatic from now on.

Although this only happens with SumatraPDF, it would be great to have
standard spacing (otherwise searching is impossible).

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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] underscore hyphenation not working

2021-05-09 Thread Pablo Rodriguez
On 5/9/21 4:40 PM, Hans Hagen wrote:
> On 5/8/2021 7:55 PM, Pablo Rodriguez wrote:
>
>> I wonder whether this might be caused by a bug or the code should be
>> adapted to current latest.
> hm, i'll check it ... looks like some lua closure side effect

Many thanks for your ultra-fast fix, Hans.

Current latest from 2021.05.09 17:14 fixes the issue.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___


<    1   2   3   4   5   6   7   8   9   10   >