Re: [NTG-context] \setupinteraction[style=...] supersedes manual text style for \note

2020-04-02 Thread Pablo Rodriguez
On 4/2/20 12:30 PM, Benjamin Buchmuller wrote:
> Hi Pablo,
>
> thanks, this works. :) I will see if I can add this information in
> the wiki at some point.
>
> Is there any way to figure out which styles are inherited or taken
> from which setup in general?

Hi Benjamin,

maybe a superuser from the list knows that, but I’m afraid I only know
by trial and error .

Pablo

PS: I see that your reply to me was also carbon-copied to the mailing
list, but it seems it hasn’t reached it yet.
--
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] \placenamedfloat and \setuphead[aftersection=...] broken?

2020-04-02 Thread Wolfgang Schuster

Benjamin Buchmuller schrieb am 02.04.2020 um 19:29:

Potentially on the same lines, placing delayed element seems currently not to 
work properly (or the syntax has changed?).

I think these features of MkIV are very elegant and useful. I’m just wondering 
if they are/were temporarily not working (tried on 2019.12.27 16:34 MKIV beta 
and the Wiki’s ConTeXt online) or have been disabled/changed for some reason?

Thanks!


Benjamin

(1) palcenamedfloat
 ---

This is the example from the Wiki:

[...]

(2) Footnotes at the end of each chapter
 

Also an example from the Wiki:

\startsetups
  chapter:after
  
\ifcase\rawcountervalue[footnote]\relax


  
\or


  
\startsubject[title=Footnote]


  
\placefootnotes


  
\stopsubject


  
\else


  
\startsubject[title=Footnotes]


  
\placefootnotes


  
\stopsubject


  
\fi

\stopsetups



\setupnotes[location=none]
\setupnotation[way=bychapter]



\setuphead[chapter][aftersection=\setups{chapter:after}]


Here is a slightly reformatted version of Hans code which works for me 
with the latest ConTeXt version (I checked only LMTX).


\startsetups[chapter:after]
  \ifcase\rawcountervalue[footnote]\relax
%
  \or
\startsubject[title=Footnote]
  \placefootnotes
\stopsubject
  \else
\startsubject[title=Footnotes]
  \placefootnotes
\stopsubject
  \fi
\stopsetups

\setupnote [footnote] [location=none]
\setupnotation [footnote] [way=bychapter]

\setuphead[chapter][aftersection=\setups{chapter:after}]

\starttext

\dorecurse{4}
  {\startchapter[title={Number #1}]
   A few notes\dorecurse{\numexpr#1-1\relax}{\footnote{Note #1.##1}}.
   \stopchapter}

\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \placenamedfloat and \setuphead[aftersection=...] broken?

2020-04-02 Thread Benjamin Buchmuller
Potentially on the same lines, placing delayed element seems currently not to 
work properly (or the syntax has changed?).

I think these features of MkIV are very elegant and useful. I’m just wondering 
if they are/were temporarily not working (tried on 2019.12.27 16:34 MKIV beta 
and the Wiki’s ConTeXt online) or have been disabled/changed for some reason?

Thanks!


Benjamin

(1) palcenamedfloat
---

This is the example from the Wiki:

\starttext


test 
\placefigure[somewhere:alpha][whatever]{alpha}{}

test 
\placefigure[somewhere:beta] [whatever]{beta}{}

test 
\placefigure[somewhere:gamma][whatever]{gamma}{}

test 
\placefigure[somewhere:delta][whatever]{delta}{}

test 
\placefigure{}{}


in 
\in{figure}[whatever]
 bla bla


\placenamedfloat[figure][*l*]



\placenamedfloat[figure][gamma]
\placenamedfloat[figure][beta]



\stoptext

(2) Footnotes at the end of each chapter


Also an example from the Wiki:

\startsetups
 chapter:after
 
\ifcase\rawcountervalue[footnote]\relax

 
\or

 
\startsubject[title=Footnote]

 
\placefootnotes

 
\stopsubject

 
\else

 
\startsubject[title=Footnotes]

 
\placefootnotes

 
\stopsubject

 
\fi
\stopsetups



\setupnotes[location=none]
\setupnotation[way=bychapter]



\setuphead[chapter][aftersection=\setups{chapter:after}]
___
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] Minimum example of problem getting curly braces printed in METAPOST

2020-04-02 Thread Gerben Wierda
Here is a minimum example of a problem that I have in getting curly braces printed in METAPOST in code that is generated by lua.Any help is welcome.\usemodule[scite]\setupxml [entities=yes]\startluacodefunction warn( ... )  texio.write_nl("-> " .. string.format(...))endlocal function mpLabelString( xmlLabelString)  -- Returns a string where each " is replaced by a METAPOST compatible result, except for outer double quotes"  rep = {      [1] = { "\"", "\"&\""   },      -- DOESN'T WORK: [2] = { "\\", "" },  }  local tmpString = string.formatters( "%!tex!", xmlLabelString)  warn( "STRING.FORMAT XML \"%s\"", xmlLabelString)  warn( "STRING.FORMAT TeX-ed \"%s\"", tmpString)  warn( "STRING.FORMAT Replaced \"%s\"", lpeg.replacer(rep):match(tmpString))  return lpeg.replacer(rep):match(tmpString)endfunction warnAndConTeXt( ...)  warn( ...)  context( ...)endfunction moduledata.test( filename)  local labelString  context( "The string to typeset is:\\par\\type-{Label} \"a\" [Text]!-")  context( "\\par The attempts are:")  context( "\\par1. \\type-Label Text-")  context( "\\par2. \\type-Label [Text]!-")  context( "\\par3. \\type-Label \"a\" [Text]!-")  context( "\\par4. \\type-{Label} [Text]!-")  context( "\\par5. \\type-{Label} \"a\" [Text]!-")  context.startMPpage { instance = "doublefun" }  context( "picture pic;")  labelString = "1. Label Text OK"  warnAndConTeXt( "pic := Foo( 0, 0, 150, 50, \"%s\");", mpLabelString( labelString))  labelString = "2. Label [Text]! OK"  warnAndConTeXt( "pic := Foo( 0, -75, 150, 50, \"%s\");", mpLabelString( labelString))  labelString = "3. Label \"a\" [Text]! OK"  warnAndConTeXt( "pic := Foo( 0, -150, 150, 50, \"%s\");", mpLabelString( labelString))  labelString = "4. {Label} [Text]! MISSING curly braces"  warnAndConTeXt( "pic := Foo( 0, -225, 150, 50, \"%s\");", mpLabelString( labelString))  labelString = "5. {Label} \"a\" [Text]! MISSING curly braces"  warnAndConTeXt( "pic := Foo( 0, -300, 150, 50, \"%s\");", mpLabelString( labelString))  context( "drawdot (0,0) withpen pencircle scaled 4 withcolor red;")  context.stopMPpage()end\stopluacode\usemodule[article-basic]%\enabletrackers[metapost.tracingall,metapost.lua,metapost.runs,metapost.textexts,metapost.scrintersectionPoints,metapost.runs,metapost.graphics,metapost.terminal]\starttext\definefontfamily[mainface][rm][Optima]\setupbodyfont[mainface,10pt]\startMPinclusions[+]{doublefun}\stopMPinclusions\startMPdefinitions{doublefun}vardef makeTeXLabel( expr w, h, name) =  show "NAME makeTeXLabel:", name;  save p; picture p ;  save s; string s;  s := "\framed{" & name & "}"; % Curly braces will be missing. I need this to work.  % s := "\type-" & name & "-"; % Curly braces are displayed, but this must become a vbox in the end, so can't use it  show "SCAN:", s;  p := textext( s);  penddef;vardef Foo( expr xpos, ypos, width, height, str) =  show "NAME Foo:", str; % Backslashes are already gone here  save pic; picture pic;  pic := makeTeXLabel( width, height, str) shifted (xpos, ypos);  draw pic;  picenddef;\stopMPdefinitions\ctxlua{moduledata.test("My ArchiMate Model Export BES.xml")}\typefile[option=TEX]{test11.tex}\stoptextThe question is: how can I get this to work? The strings that have to be printed inside the METAPOST picture come from an XML and can contain about anything. But in the end that string will have to be vertically typeset as a paragraph, hence I cannot use \type (which works).

test11.tex
Description: Binary data
___
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] Lua/TeX/METAPOST/textext string issue/puzzle

2020-04-02 Thread Gerben Wierda
Actually, the backslashes disappear before the call to textext()

G

> On 1 Apr 2020, at 23:44, Aditya Mahajan  wrote:
> 
> On Wed, 1 Apr 2020, Gerben Wierda wrote:
>> 
>> My route is probably to complex anyway, but what can I do for the curly 
>> braces to be actually typeset?
> 
> MkII had a feature called \sometxt
> http://dl.contextgarden.net/myway/sometxt.pdf
> 
> I wonder if that still works in MkIV.
> 
> Aditya
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] \setupinteraction[style=...] supersedes manual text style for \note

2020-04-02 Thread Pablo Rodriguez
On 4/2/20 12:04 AM, Benjamin Buchmuller wrote:
> For the following one, I’m not sure if this is the intended
> behaviour or not:
>
> I want to set up the “notation” and “note” style manually, which
> works great unless I also call
> \setupinteraction[state=start,style=normal] (or any other style),
> regardless of calling it before or after setting up “notation” or
> “note”.

Hi Benjamin,

I’m not sure whether this would work for your:

  \setupinteraction[state=start, color=, style=, contrastcolor=,]
  \setupreferenceformat[footnote][color=, style=]

BTW, "focus=standard" doesn’t modify the page size when clicking the link.

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
___