Re: [NTG-context] Best way to access casul fonts

2023-01-30 Thread Hans Hagen via ntg-context

On 1/30/2023 6:49 PM, Henning Hraban Ramm via ntg-context wrote:

Am 30.01.23 um 18:24 schrieb Mattias Märka via ntg-context:
\definefontstyle is still bugging me. I gather from previous threads 
that it should be possible to define a new font style for casual and 
use that via a font switch, but I cannot get this to work. I'm not 
sure this is still possible.


No, it isn’t, I recently asked Hans.

just define a new typeface with casual as serif

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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


[NTG-context] layout for marked pages?

2023-01-30 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \showframe
  \setuplayout[width=middle]
  \definelayout[odd][reset]
  \definelayout[even][reset]
  \doiftext{\markedpages[zapf]}
{\doloopoverlist{\markedpages[zapf]}
  {\definelayout[\recursestring][page]}}
  \starttext
  \dorecurse{50}{\input{knuth}\par}
  \page\startmarkpages[zapf]
\dorecurse{50}{\input{zapf}\par}
  \stopmarkpages\page
  \dorecurse{50}{\input{knuth}\par}
  \stoptext

I wanted to have page layout in pages marked with zapf.

I thought \markedpages[zapf] was the way to go, but I only get text
after marked pages, not before them.

Which is the right approach to have marked pages with a different layout?

I would be happy to update
https://wiki.contextgarden.net/Page_Layout#Multiple_layouts.

Many thanks for your help,

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

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


Re: [NTG-context] Best way to access casul fonts

2023-01-30 Thread Mattias Märka via ntg-context
Ha, good to know. Do you know what one should do instead?

Also, do you know why this is? It would be good to mention this on the wiki.

Mattias

--- Original Message ---
On Monday, January 30th, 2023 at 7:49 PM, Henning Hraban Ramm via ntg-context 
 wrote:


> 
> 
> 
> Am 30.01.23 um 18:24 schrieb Mattias Märka via ntg-context:
> 
> > \definefontstyle is still bugging me. I gather from previous threads that 
> > it should be possible to define a new font style for casual and use that 
> > via a font switch, but I cannot get this to work. I'm not sure this is 
> > still possible.
> 
> 
> No, it isn’t, I recently asked Hans.
> 
> Hraban
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : https://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Best way to access casul fonts

2023-01-30 Thread Henning Hraban Ramm via ntg-context

Am 30.01.23 um 18:24 schrieb Mattias Märka via ntg-context:

\definefontstyle is still bugging me. I gather from previous threads that it 
should be possible to define a new font style for casual and use that via a 
font switch, but I cannot get this to work. I'm not sure this is still possible.


No, it isn’t, I recently asked Hans.

Hraban

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

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


Re: [NTG-context] Best way to access casul fonts

2023-01-30 Thread Mattias Märka via ntg-context
Hi

Will do.

\definefontstyle is still bugging me. I gather from previous threads that it 
should be possible to define a new font style for casual and use that via a 
font switch, but I cannot get this to work. I'm not sure this is still possible.
The threads I'm referring to:
https://www.mail-archive.com/ntg-context@ntg.nl/msg00039.html
https://www.mail-archive.com/ntg-context@ntg.nl/msg39849.html
https://www.mail-archive.com/ntg-context@ntg.nl/msg84188.html
I might start a separate thread and ask whether \definefontstyle still works.

I also experimented with defining my own typescripts for Lucida so that casual 
and fax (and all the other various Lucida fonts, really) are easily accessible.

Something like:

\starttypescript[serif][lucbr]
  \definefontsynonym[Serif][name:LucidaBright]
  \definefontsynonym[SerifItalic][name:LucidaBright-Italic]
  \definefontsynonym[SerifBold][name:LucidaBright-Demi]
  \definefontsynonym[SerifBoldItalic][name:LucidaBright-DemiItalic]
  \definefontsynonym[SerifSlanted][name:LucidaBright-Slanted]
  \definefontsynonym[SerifCaps][name:LucidaBrightSmallcaps]
  \definefontsynonym[SerifBoldCaps][name:LucidaBrightSmallCaps-Demi]
\stoptypescript

\starttypescript[serif][lucfax]
  \definefontsynonym[Serif][name:LucidaFax]
  \definefontsynonym[SerifItalic][name:LucidaFax-Italic]
  \definefontsynonym[SerifBold][name:LucidaFax-Demi]
  \definefontsynonym[SerifBoldItalic][name:LucidaFax-DemiItalic]
\stoptypescript

\starttypescript[sans][lucss]
  \definefontsynonym[Sans][name:LucidaSans]
  \definefontsynonym[SansItalic][name:LucidaSans-Italic]
  \definefontsynonym[SansBold][name:LucidaSans-Demi]
  \definefontsynonym[SansBoldItalic][name:LucidaSans-DemiItalic]
\stoptypescript

\starttypescript[mono][lucbr,luctt]
  \definefontsynonym[Mono][name:LucidaTypewriter]
  \definefontsynonym[MonoItalic][name:LucidaTypweriterOblique]
  \definefontsynonym[MonoBold][name:LucidaTypewriterBold]
  \definefontsynonym[MonoBoldItalic][name:LucidaTypweriterBoldOblique]
\stoptypescript

\starttypescript[mono][lucss,lucsstt]
  \definefontsynonym[Mono][name:LucidaSansTypewriter]
  \definefontsynonym[MonoItalic][name:LucidaSansTypweriterOblique]
  \definefontsynonym[MonoBold][name:LucidaSansTypewriterBold]
  \definefontsynonym[MonoBoldItalic][name:LucidaSansTypweriterBoldOblique]
\stoptypescript

\starttypescript[calligraphy][lucbr,luccg]
  \definefontsynonym[Calligraphy][name:LucidaCalligraphy-Italic]
\stoptypescript

\starttypescript[handwriting][lucbr,luchw]
  \definefontsynonym[Handwriting][name:LucidaHandwriting-Italic]
\stoptypescript

\starttypescript[serif][lucbl]
  \definefontsynonym[Serif][name:LucidaBlackletter]
\stoptypescript

\starttypescript[serif][luccas]
  \definefontsynonym[Serif][name:LucidaCasual]
  \definefontsynonym[SerifItalic][name:LucidaCasual-Italic]
\stoptypescript

\starttypescript[lucbr]
  \definetypeface[lucbr][rm][serif][lucbr][default][features=default]
  \definetypeface[lucbr][mm][math][lucida][default]
  \definetypeface[lucbr][tt][mono][lucbr][default][features=default]
  \definetypeface[lucbr][cg][calligrpahy][default][features=default]
  \definetypeface[lucbr][hw][handwriting][default][features=default]
\stoptypescript

\starttypescript[lucfax]
  \definetypeface[lucfax][rm][serif][lucfax][default][features=default]
\stoptypescript

\starttypescript[lucss]
  \definetypeface[lucss][ss][sans][lucss][default][features=default]
  \definetypeface[lucss][tt][mono][lucss][default][features=default]
\stoptypescript

\starttypescript[luctt]
  \definetypeface[luctt][tt][mono][luctt][default][features=default]
\stoptypescript

\starttypescript[lucsstt]
  \definetypeface[lucsstt][tt][mono][lucsstt][default][features=default]
\stoptypescript

\starttypescript[luccg]
  \definetypeface[luccg][cg][calligraphy][luccg][default][features=default]
\stoptypescript

\starttypescript[luchw]
  \definetypeface[luchw][hw][handwriting][luchw][default][features=default]
\stoptypescript

\starttypescript[lucbl]
  \definetypeface[lucbl][rm][serif][lucbl][default][features=default]
\stoptypescript

\starttypescript[luccas]
  \definetypeface[luccas][rm][serif][luccas][default][features=default]
\stoptypescript

\starttypescript[luc]
  \definetypeface[luc][rm][serif][lucbr][default][features=default]
  \definetypeface[luc][mm][math][lucida][default]
  \definetypeface[luc][ss][sans][lucss][default][features=default]
  \definetypeface[luc][tt][mono][lucbr][default][features=default]
  \definetypeface[luc][cg][calligraphy][lucbr][default][features=default]
  \definetypeface[luc][hw][handwriting][lucbr][default][features=default]
\stoptypescript

\def\lucbr{\switchtobodyfont[lucbr]}
\def\lucfax{\switchtobodyfont[lucfax]}
\def\lucss{\switchtobodyfont[lucss]}
\def\luctt{\switchtobodyfont[luctt]}
\def\lucsstt{\switchtobodyfont[lucsstt]}
\def\luccg{\switchtobodyfont[luccg]}
\def\luchw{\switchtobodyfont[luchw]}
\def\lucbl{\switchtobodyfont[lucbl]}
\def\luccas{\switchtobodyfont[luccas]}

Would it make sense adding 

Re: [NTG-context] Subject: Leading spaces verbatim

2023-01-30 Thread Ulrike Fischer via ntg-context
Am Sat, 28 Jan 2023 03:01:24 +0100 schrieb Kalouguine Andre via
ntg-context:

> I'm trying to make a verbatim block of text with copiable leading spaces
> so that students can just copy my Python code snippets into their IDE.

This basically doesn't work (quite unrelated to the tex code). 
The PDF viewers have all their own mind here and none of them is
really "code friendly". See e.g. 

https://tex.stackexchange.com/a/472112/2388

It works sometimes a bit better if the PDF is tagged, but there too
you can't currently rely on four spaces staying four spaces (and not
all PDF reader understand tagging).

Better attach files with code. 

-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

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

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


Re: [NTG-context] Best way to access casul fonts

2023-01-30 Thread Pablo Rodriguez via ntg-context
On 1/29/23 19:07, Mattias Märka via ntg-context wrote:
> Hi
> 
> This is probably the most reasonable solution.

Hi Mattias,

would you be so kind to update
https://wiki.contextgarden.net/Use_the_fonts_you_want to include this?

Many thanks for your help,

Pablo

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

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


[NTG-context] list not following "focus=standard"?

2023-01-30 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setupinteraction[state=start, focus=standard]
  \starttext
  \completecontent
  \dorecurse{25}
{\section{Section}
  a\footnote{b}}
  \stoptext

Using current latest (from 2023.01.26 18:34), destinations for TOC are
pages (/D [ 7 0 R /Fit ]) and destinations for footnotes are named
destinations (/D [ 1 0 R /XYZ 61.900625 141.0443 null ]).

Compare https://pdf.ousia.tk/lst-fnt.pdf#_3 with any link from the TOC.

I‘m afraid this might be a regression from a recently fixed issue.

Could anyone confirm this issue?

Many thanks for your help,

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

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


Re: [NTG-context] Subject: Leading spaces verbatim

2023-01-30 Thread Pablo Rodriguez via ntg-context
On 1/29/23 17:58, Kalouguine Andre via ntg-context wrote:
> On 28.01.2023 22:54, Hans Hagen via ntg-context wrote:
>> […]
>> so: this is all very viewer dependent! (The suggested comment method
>> is more reliable.)
>  
> Unfortunately as I just found out, comments are also viewer dependent...
> For instance in Firefox, indentations are lost.

Hi André,

as far as I know, this may be a bug in PDF.js.

Could you report it to the developers (https://github.com/mozilla/pdf.js)?

Many thanks for your help,

Pablo

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

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


Re: [NTG-context] Wrong prefix in cross references to formulas in external document

2023-01-30 Thread Hans Hagen via ntg-context

On 1/29/2023 5:03 PM, Yaroslav Beltukov via ntg-context wrote:

Dear Hans and all contributors,

I really appreciate ConTeXt for the right way to obtain high quality 
documents. I'm a theoretical physicist and I'm going to write a book. I 
think ConTeXt is the right choice to work with a number of formulas, 
figures and cross-references. The visual quality of formulas is better 
than in regular LaTeX. The new feature with formula autosplitting looks 
also very promising. For me it is important to obtain the high quality 
without a lot of manual tweaks of each formula for each given document 
format and figure placement.


However, I have found a problem with references if I compile one 
component only. The references to formulas in other components have 
wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the right 
formula references are very important.


I started looking into this issue. The references to other components 
are taken from the whole product as from an external document. It turned 
out that this is a general problem with references with prefixes to 
external documents. The prefix is stored in a tuc file as a reference to 
a section as a sequential number of the header in the document. As a 
result, the prefix from the external document is calculated using the 
structure of the current document.


Here is the MWE, which consists of two files:
foo.tex:

\defineenumeration[remark][prefix=yes, prefixsegments=chapter:section]

\starttext

Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4]

Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4]

Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4]

Remarks: \in[remark1], \in[remark2]

\startbodymatter

\chapter[chap1]{Chapter}
\placeformula[eq1]\startformula x = y\stopformula
\chapter[chap2]{Chapter}
\section[sec1]{Section}
\section[sec2]{Section}
\placeformula[eq1]\startformula x = y\stopformula
\placeformula[eq2]\startformula x = y\stopformula

\stopbodymatter

\startappendices

\chapter[chap3]{Chapter}
\section[sec3]{Section}
\placeformula[eq3]\startformula x = y\stopformula
\section[sec4]{Section}
\startremark[remark1]\stopremark
\placeformula[eq4]\startformula x = y\stopformula
\startremark[remark2]\stopremark
\chapter[chap4]{Chapter}

\stopappendices

\stoptext


bar.tex:

\starttext

Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4]

Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4]

Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], \in[foo::chap4]

Remarks: \in[foo::remark1], \in[foo::remark2]

% any chapters and sections here

\stoptext

It is expected to have the same first page on these documents:

Equations: 1.1, 2.2, A.1, A.2
Sections: 2.1, 2.2, A.1, A.2
Chapters: 1, 2, A, B
Remarks: A.2.1, A.2.2

However, the bar.tex produces wrong prefixes to formulas and remarks. 
The output depends on the document structure of bar.tex, not foo.tex.


I started looking into the source code. Thanks to lua, it is not a big 
deal to track the problem. The prefixdata is complemented by the 
sectiondata after the loading the tuc file. So, the question is: is it 
possible to store the full prefixdata with all necessary prefix numbers 
in the tuc file? Here is my proposal to change the source code:


--- strc-lst-old.lmt    2023-01-29 11:30:15.610309948 +0300
+++ strc-lst.lmt        2023-01-29 12:10:08.864228923 +0300
@@ -266,6 +266,16 @@
      if r and not r.section then
          r.section = structures.sections.currentid()
      end
+    -- store sectiondata in prefixdata (necessary for external files)
+    if t.prefixdata and r.section then
+        local sectiondata = structures.sections.collected[r.section]
+        if sectiondata then
+            for k, v in next, sectiondata do
+                t.prefixdata[k] = v
+            end
+        end
+    end
+    --
      local b = r and t.block
      if r and not b then
          local s = r.section

--- strc-ref-old.lmt    2023-01-29 11:30:15.823643904 +0300
+++ strc-ref.lmt        2023-01-29 12:07:45.697109862 +0300
@@ -2318,7 +2318,17 @@
      if data then
          numberdata = lists.reordered(data) -- data.numberdata
          if numberdata then
-            helpers.prefix(data,prefixspec)
+            -- helpers.prefix(data,prefixspec)
+            -- use the actual numbers from prefixdata
+            local prefixdata = data.prefixdata
+            if prefixdata then
+                -- adapted from helpers.prefix (not sure)
+                if (prefixspec and prefixspec == no) or 
prefixdata.prefix == no then

+                    prefixdata = false
+                end
+                sections.typesetnumber(prefixdata,"prefix", prefixspec 
or false, prefixdata)

+            end
+            --
 
  sections.typesetnumber(numberdata,"number",numberspec,numberdata)

          else
              local useddata = data.useddata

After this small change, all the references are correct. However, I'm 
quite new to 

Re: [NTG-context] how to change metadata halfway through document

2023-01-30 Thread jbf via ntg-context

Indeed, that works. Thank you.

Julian

On 30/1/23 20:14, Hans Hagen via ntg-context wrote:

On 1/30/2023 1:14 AM, jbf via ntg-context wrote:
Am trying to understand how best to change the title metadata in 
headertext halfway through a document that has two parts: 
Constitutions and Regulations.


My first attempt (did not work)

\startsetups[headertext]

\startdocument

[metadata:title={Regulations}]

\stopsetups

\setupheadertexts

[ ] [{\getmarking[chapter]\hskip1em \pagenumber}]

[{\pagenumber \hskip1em \setup{headertext}}] [ ]

My second attempt (quite crass, but it works!!) was to create a 
second \startdocument within the main \startdocument (obviously 
closing it towards the end but before the main \stopdocument), this 
time with [metadata:title={Regulations}] instead of the original 
[metadata:title={Constitutions}]. However, I have a strong feeling 
this is not a very elegant solution!

you can try \setupdocument but i didn't test that


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___ 

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


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

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


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

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


Re: [NTG-context] how to change metadata halfway through document

2023-01-30 Thread Hans Hagen via ntg-context

On 1/30/2023 1:14 AM, jbf via ntg-context wrote:
Am trying to understand how best to change the title metadata in 
headertext halfway through a document that has two parts: Constitutions 
and Regulations.


My first attempt (did not work)

\startsetups[headertext]

\startdocument

[metadata:title={Regulations}]

\stopsetups

\setupheadertexts

[ ] [{\getmarking[chapter]\hskip1em \pagenumber}]

[{\pagenumber \hskip1em \setup{headertext}}] [ ]

My second attempt (quite crass, but it works!!) was to create a second 
\startdocument within the main \startdocument (obviously closing it 
towards the end but before the main \stopdocument), this time with 
[metadata:title={Regulations}] instead of the original 
[metadata:title={Constitutions}]. However, I have a strong feeling this 
is not a very elegant solution!

you can try \setupdocument but i didn't test that


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

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