Re: [NTG-context] xtable row number trouble

2020-10-26 Thread Wolfgang Schuster

Oleg schrieb am 26.10.2020 um 21:03:

On Sun, Oct 25, 2020 at 09:26:06PM +0100, Wolfgang Schuster wrote:

Oleg schrieb am 25.10.2020 um 14:51:

Hi, all.

I try to place a row number into the first column of my table.
I tried:

\definecounter[rownum][way=bytext,prefix=no]
\setcounter[rownum][0]

\starttext
\startxtable
  \startxrow
  \startxcell
  \incrementcounter[rownum]
  \rawcounter[rownum]
  \stopxcell
  \stopxrow
  \startxrow
  \startxcell
  \incrementcounter[rownum]
  \rawcounter[rownum]
  \stopxcell
  \stopxrow
  \startxrow
  \startxcell
  \incrementcounter[rownum]
  \rawcounter[rownum]
  \stopxcell
  \stopxrow
\stopxtable

And got:

7
8
9

If i place \setcounter[rownum][0] right after \startxtable, then i got:

1
2
3

Is this normal?

Yes, to fix it use

\startxcell
\doifelsemode{*trialtypesetting}
  {0}
  {\incrementcounter[rownum]%
   \convertedcounter[rownum]}
\stopxcell

It seems that reseting once at table start is simpler, isn't it :-)?


Try your method with natural table or tabulate and it won't work anymore.


What is the difference between \rawcounter and \convertedcounter?
\rawcounter give me the plain number as i want.


In this case there is no difference but I suggest to use \rawcounter 
only when you need

the value of the counter, e.g. counter>... or counter=...

With \convertedcounter you have always the option to change the style of 
the value,

e.g. number conversion, prefixes etc.


What's about \newcount&\advance variant? Why it not work?


Short answer: expansion

You're using advance in a place where it is just ignored, there are ways 
to get rid
of these limitations with Luametatex but it's better to use 
\incrementcounter.


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
___


Re: [NTG-context] MkIV and LMTX difference in comma list expansion

2020-10-26 Thread Wolfgang Schuster

Rik Kabel schrieb am 26.10.2020 um 17:34:

Hello list,

Another difference, perhaps the result of my lack of knowledge, but a 
difference.


The following example produces different results for the fourth 
sequence, with the index being passed one item under MkIV and two items 
under LMTX.


(The code is stripped out of a much more complex bit to show the issue.)

[...]

Did I misuse the comma list processing, or is this a bug?


Probably something we missed when the comma list processor was 
rewritten. In the example below the braces are stripped when there is 
only a single element (first and second list).


\def\CommalistEntry#1{\ruledhbox{\strut#1}}

\starttext

\dontleavehmode\processcommalist[{aaa}]\CommalistEntry

\dontleavehmode\processcommalist[{aaa,bbb}]\CommalistEntry

\dontleavehmode\processcommalist[{ccc,ddd},{eee,fff}]\CommalistEntry

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


Re: [NTG-context] xtable row number trouble

2020-10-25 Thread Wolfgang Schuster

Oleg schrieb am 25.10.2020 um 14:51:

Hi, all.

I try to place a row number into the first column of my table.
I tried:

\definecounter[rownum][way=bytext,prefix=no]
\setcounter[rownum][0]

\starttext
\startxtable
 \startxrow
 \startxcell
 \incrementcounter[rownum]
 \rawcounter[rownum]
 \stopxcell
 \stopxrow
 \startxrow
 \startxcell
 \incrementcounter[rownum]
 \rawcounter[rownum]
 \stopxcell
 \stopxrow
 \startxrow
 \startxcell
 \incrementcounter[rownum]
 \rawcounter[rownum]
 \stopxcell
 \stopxrow
\stopxtable

And got:

7
8
9

If i place \setcounter[rownum][0] right after \startxtable, then i got:

1
2
3

Is this normal?


Yes, to fix it use

\startxcell
  \doifelsemode{*trialtypesetting}
{0}
{\incrementcounter[rownum]%
 \convertedcounter[rownum]}
\stopxcell

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
___


Re: [NTG-context] Concerning text backgrounds (and further tuning) in references

2020-10-24 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 24.10.2020 um 01:45:

|Hi, list! I've seen the following question in TeX.SE.
|

|My attempt of solving was:
|

|
https://tex.stackexchange.com/questions/567655/change-background-color-of-hyperlinks/567719?noredirect=1#comment1431936_567719

\setupinteraction [state=start] \definetextbackground[MyUrl] [ 
location=text, background=color,backgroundcolor=yellow, frame=off, 
]\def\myfootnote#1{\MyUrl{\high{#1}}} 
\setupfootnotes[textcommand=\myfootnote] 
\definepapersize[default][A8,portrait] \setuppapersize [default] 
\useURL[aurl] [https://wiki.contextgarden.net] [] [\MyUrl{ConTeXt 
Garden}] \starttext Testing links to same page\footnote{This should 
create links to same page} and an external link: \from[aurl]. \stoptext


|

|When one tries to use `\setupinteraction[...style=\MyUrl...]` either it 
doesn't work or displays a background which doesn't break well across 
lines.

|

|Is there a workaround or another method? Maybe a feature request for a 
more customizable setup for references? I had the same problem some time 
ago and I guess some others too.


\definebar
  [urlbackground]
  [color=yellow,
   order=background,
   continue=yes,
   rulethickness=2.8,
   offset=1.4]

\setupinteraction
  [state=start,
   style={\setbar[urlbackground]}]

\starttext

\unknown\ \goto{ConTeXt 
garden}[url(https://wiki.contextgarden.net/Main_Page)] \unknown


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


Re: [NTG-context] Filler rules

2020-10-22 Thread Wolfgang Schuster

Willi Egger schrieb am 15.10.2020 um 21:59:

Hoi,

In earlier times we had something like \definerule[…][…] and \setuprule[…][…]. 
This made it possible to create lines of a define width.


I'm sorry but I'm unable to find any code or proper example for the command.


So what I found is the fillers, which apparently are not meant for the purpose 
I am looking for.


You can try the \blackrule command to add a custom rule after your title.

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
___


Re: [NTG-context] oldstyle numerals in STIX Two Math

2020-10-21 Thread Wolfgang Schuster

Alan Bowen schrieb am 21.10.2020 um 20:46:

Thanks, Hraban.That’s a helpful start

  I guess the challenge now is to get STIX Two Math to use the oldstyle 
numerals in STIX Two Text (by adapting code that Wolgang gave me for 
using  oldstyle numerals with TexGyre Math). When I ran


mtxrun --script fonts --list --info stixtwotext, I got

mtx-fonts       |   onum     cyrl     dflt

mtx-fonts       |            dflt     dflt

mtx-fonts       |            grek     dflt

mtx-fonts       |            latn     dflt rom trk


Sadly, I have no idea what this means or how it might help in 
identifying the Unicode range of the oldstyle numerals in STIX Two Text. 
And that is something I need to take advantage of Wolfgang’s code.


You replace the normal digits but apply the oldstyle feature.

\definefontfamily
  [alan] [rm] [STIX Two Text]
  [features={default,f:oldstyle}]

\definefallbackfamily
  [alan] [mm] [STIX Two Text]
  [range=digitsnormal,force=yes,features=f:oldstyle]

\definefontfamily
  [alan] [mm] [STIX Two Math]

\setupbodyfont [alan]

\starttext

abc 123456789 xyz

\m{abc\ 123456789\ xyz}

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


Re: [NTG-context] Filler rules

2020-10-14 Thread Wolfgang Schuster

Willi Egger schrieb am 14.10.2020 um 15:48:

Good afternoon!

I am dealing with a book, which has a short black rule under the title of the 
chapters.

I see, that the old rule mechanisms are no more available in LMTX and are 
replaced by fillers.


What mechanism do you mean, fillers are just a high level interface to 
leaders.


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
___


Re: [NTG-context] need help comparing strings

2020-10-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.10.2020 um 19:06:

On 10/13/20 5:54 PM, Aditya Mahajan wrote:

On Tue, 13 Oct 2020, Pablo Rodriguez wrote:

[...]
Could anyone explain me what I’m missing here?

Many thanks for your reply, Aditya.


I find it simpler to write macros where there is clean communicating
between tex and lua. For example:
[...]
 \define[1]\numbersfname
 {\cldcontext{userdata.numbersfname([==[#1]==])}}

This is the first time I see that way of wrapping an argument.

In any case, I cannot compare to a number:

   \startluacode
 userdata = userdata or {}
 function userdata.numbersfname(name)
 return string.match(name, "%d+")
 end
   \stopluacode

   \define[1]\numbersfname
   {\cldcontext{userdata.numbersfname([==[#1]==])}}


Untested:

\defineexpandable[1]\numbersfname
  {\cldcontext{userdata.numbersfname([==[#1]==])}}

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
___


Re: [NTG-context] need help comparing strings

2020-10-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.10.2020 um 17:33:

Dear list,

I have the following sample:

   \starttext
   \def\numbersfname
 {\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}}
   \ctxlua{ c = context.getvariable("environment", "fname") or "a" }
   \ctxlua{ d = [[\env{fname}]] }

   tex: \numbersfname\\
   \doifelse{}
   {123}{yes}{no}\\
   c: \cldcontext{c}\\
   \doifelse{\cldcontext{c:match("\letterpercent d+")}}
   {123}{yes}{no}\\
   d: \cldcontext{d}\\
   \doifelse{\cldcontext{d:match("\letterpercent d+")}}
   {123}{yes}{no}
   \stoptext

For compilation, I run the command:

   context --purgeall --arguments=fname={abc123} test-file.tex

These things are failing:

1. I don’t know how to get \numbersfname equal to "123". I don’t know
what I’m doing wrong.

2. Is there no Lua version of \getvariable{...}{...}?


There is no need because everything is stored in a Lua table.


 begin example
\starttext

\startluacode

local argumentlist  = document.arguments.arguments
local argumenttable = utilities.parsers.settings_to_hash(argumentlist)

context(argumenttable["fname"])

\stopluacode

\stoptext
 end example


I tested the example with:

    context --arguments="fname=abc123" 


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
___


Re: [NTG-context] \setregisterentry levels with colon (keys:1, entries:1) in lua

2020-10-10 Thread Wolfgang Schuster

Jano Kula schrieb am 10.10.2020 um 20:52:

Greetings!

One can can set register levels with keys and entries
\setregisterentry[MyIndex]
     [keys:1=Sorting Key Level 1,
      entries:1=Entry Level 1,
      keys:2=Sorting Key Level 2,
      entries:2=Entry Level 2]

Rewriting the code in lua works until colon (:) is used.
\startluacode
context.setregisterentry({ "MyIndex" },
    { keys:1="C Level 1", entries:1="C Level 2"})


context.setregisterentry (
{ "MyIndex" },
{ ["keys:1"] = "...", ["entries:1"] = "..." }
)

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
___


Re: [NTG-context] \doifelse not working, \doiftextelse breaking

2020-10-09 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 09.10.2020 um 16:31:

To improve your command and allow a space between both arguments you can use

\unexpanded\def\startswith
{\dodoubleargument\dostartswith}

\def\dostartswith[#1][#2]%
{...}

Now I see with \dosingleargument, \dodoubleargument and
\dotripleargument are there.

Which are the improvements to the command added by \do*argument?


You can add a space between both arguments. You version expects this

    \startswith [...][...]

while the extended code allows this

    \startswith [...] [...]

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
___


Re: [NTG-context] \doifelse not working, \doiftextelse breaking

2020-10-09 Thread Wolfgang Schuster



Pablo Rodriguez schrieb am 09.10.2020 um 15:58:

Dear list,

I have the following sample:

 \starttext
 \startluacode
 function document.starts_with(str, start)
   if str:sub(1, #start) == start then
 context(start)
   end
 end
 \stopluacode

 \unexpanded\def\startswith[#1][#2]
 {\cldcontext{document.starts_with("#1", "#2")}}



You need a % at the end of the definition, otherwise TeX expects a space 
after the second argument to end the command.


\unexpanded\def\startswith[#1][#2]%
  {...}


To improve your command and allow a space between both arguments you can use

\unexpanded\def\startswith
  {\dodoubleargument\dostartswith}

\def\dostartswith[#1][#2]%
  {...}

or just add a dummy parameter and use #1 and #3 to pass the arguments

\unexpanded\def\startswith[#1]#2[#3]%
  {...}


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
___


Re: [NTG-context] Split Table, don't repeat caption

2020-10-07 Thread Wolfgang Schuster

Denis Maier schrieb am 07.10.2020 um 17:39:

Hi,

is there a way not to repeat the caption of a multipage natural table? 
I've searched the list archive and it looks the question came up a 
couple of times, but I couldn't find an answer.


If this doesn't help you have to provide a example.

\starttext

\bTABLE[split=yes]
    \bTABLEhead
    \bTR \bTD Header 1 \eTD \bTD Header 2 \eTD \eTR
    \eTABLEhead
    \bTABLEbody
    \dorecurse{100}{\bTR \bTD Column 1 \eTD \bTD Column 2 \eTD \eTR}
    \eTABLEbody
\eTABLE

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


Re: [NTG-context] URLs in XML, escaping special characters

2020-10-07 Thread Wolfgang Schuster

Denis Maier schrieb am 07.10.2020 um 17:16:

Am 07.10.2020 um 16:47 schrieb Wolfgang Schuster:

Denis Maier schrieb am 07.10.2020 um 15:42:

Hi,

I'm struggling with getting hyphenated URLs to work from XML input.
How do you enter ampersands and percent signs correctly so that they 
can be used in links?


This here doesn't really works:


\startxmlsetups xml:test
    \xmlsetsetup{#1}{*}{-}
    % Hauptgruppen
    \xmlsetsetup{#1}{article|ext-link}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:article
\starttext
    \xmlflush{#1}
\stoptext
\stopxmlsetups

\startxmlsetups xml:ext-link
    \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]
\stopxmlsetups


\startxmlsetups xml:ext-link
    \begingroup
    \expandUx
\expanded{\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]}
    \endgroup
\stopxmlsetups

Wolfgang


Thanks, Wolfgang.

Unfortunately, the clickable link is still not correct. What am I doing 
wrong?


Add

\setupinteraction[state=start]

to your document.

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
___


Re: [NTG-context] Sections in content: macros v text

2020-10-07 Thread Wolfgang Schuster

Tomas Hala schrieb am 05.10.2020 um 20:20:

Hi all,

the content generated by the MWE below contains
1 bb ... 1
2 bb ... 1
instead of
1 aa ... 1
2 bb ... 1
because the content structure refers to the macro name \name in both sections 
instead of to work with the text.

Maybe it was already discussed by I am not able to find any solution how to send the text 
"aa" to the content in this case.

Thanks in advance for any hint.

Best wishes,

Tomáš

MWE (TL2020):
\starttext
\define\name{aa} \startsection[title=\name,list=\name] \stopsection
\define\name{bb} \startsection[title=\name,list=\name] \stopsection
\completecontent
\stoptext


Variant 1:

\setuphead[section][expansion=yes]

\starttext

\defineexpandable\name{aa}

\startsection[title=\name,list=\name] \stopsection

\defineexpandable\name{bb}

\startsection[title=\name,list=\name] \stopsection

\completecontent

\stoptext


Variant 2:

\starttext

\defineexpandable\name{aa}

\expanded{\startsection[title=\name,list=\name]} \stopsection

\defineexpandable\name{bb}

\expanded{\startsection[title=\name,list=\name]} \stopsection

\completecontent

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


Re: [NTG-context] URLs in XML, escaping special characters

2020-10-07 Thread Wolfgang Schuster

Denis Maier schrieb am 07.10.2020 um 15:42:

Hi,

I'm struggling with getting hyphenated URLs to work from XML input.
How do you enter ampersands and percent signs correctly so that they 
can be used in links?


This here doesn't really works:


\startxmlsetups xml:test
    \xmlsetsetup{#1}{*}{-}
    % Hauptgruppen
    \xmlsetsetup{#1}{article|ext-link}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:article
\starttext
    \xmlflush{#1}
\stoptext
\stopxmlsetups

\startxmlsetups xml:ext-link
    \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]
\stopxmlsetups


\startxmlsetups xml:ext-link
    \begingroup
    \expandUx
\expanded{\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]}
    \endgroup
\stopxmlsetups

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
___


Re: [NTG-context] Protusion and spurios empty line

2020-10-03 Thread Wolfgang Schuster

Denis Maier schrieb am 02.10.2020 um 22:34:

Am 02.10.2020 um 18:11 schrieb Hans Hagen:

On 10/1/2020 4:58 PM, Denis Maier wrote:

I'm getting emtpy lines after paragraph breaks, where the last 
character is just squeezed in. Looks like it has to do with the bidi 
mechanism. Commenting out this line removes the effect. (Somewhat 
long) Example below.


Is there a fix for that?
(\setupalign[tolerant,stretch] ... actually always advised when you 
use protrusion and/or expansion)


I have that it my environment file already. Doesn't make a difference.


The extra line is in the \title which has its own alignment setting.

\setuphead[title][align={...}]

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
___


Re: [NTG-context] Natural Tables: spaceinbetween not working?

2020-09-30 Thread Wolfgang Schuster



Denis Maier schrieb am 30.09.2020 um 21:54:

Hi,

spaceinbetween seems to have no effect in this example:

===
\setupTABLE [spaceinbetween=25pt,split=yes]


A few options need [start] when you set them before \bTABLE.

\setupTABLE [split=yes]
\setupTABLE [start] [spaceinbetween=25pt]


\starttext

\bTABLE

\dorecurse{50}{\bTR \bTD table cell \eTD \bTD table cell \eTD \eTR}

\eTABLE


Try to avoid blank lines in tables, it shouldn't matter in this case but 
in certain cases this can lead to unwanted whitespace.


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
___


Re: [NTG-context] Tagged export breaks r2l alignment in tabulate

2020-09-30 Thread Wolfgang Schuster

Denis Maier schrieb am 30.09.2020 um 16:18:

Ok, that works. Is it possible to define that both cells in the first 
row as left to right? (Like in the definition, not in the cell.)


I don't think so but maybe table headers can help you.

\starttext

\starttabulatehead[]
\BC \raggedcenter Column 1 \BC \raggedcenter Column 2 \NC\NR
\stoptabulatehead

\starttabulate[|p|p|]
\NC \input ward \NC \input ward \NC\NR
\stoptabulate

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


Re: [NTG-context] Unwanted whitespace at beginning of document

2020-09-29 Thread Wolfgang Schuster

Denis Maier schrieb am 29.09.2020 um 14:26:

Hi,

I have ended up with unwanted whitespace at the beginning of my 
document. The environment definition is already quite complex, so I 
cannot easily tell where the whitespace is coming from. Any advice how 
I could track that down? Are there some tricks for this?


1. Create a dummy document where you load your environment, e.g.

\environment[myenvironment]
\starttext
I'm a placeholder!
\stoptext


2. Change the position of \stopenvironment in your style file until the 
whitespace disappears.



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
___


Re: [NTG-context] OK, I Don't Quite Understand \definefontfamily

2020-09-29 Thread Wolfgang Schuster

Michael Urban schrieb am 28.09.2020 um 23:49:




On Sep 28, 2020, at 12:39 PM, Wolfgang Schuster 
 wrote:

Michael Urban schrieb am 25.09.2020 um 21:12:

I don't seem quite able to put it all together, forgive the question.
I have a 'Bookman' font setup, pretty vanilla:
\definetypeface [Bookman] [rm] [serif] [bonum] [sl=name:unituscndboldoblique]
\definetypeface [Bookman] [tt] [mono]  [modern] [default]
\definetypeface [Bookman] [ss] [sans] [unitus] [default]
\definetypeface [Bookman] [mm] [math] [modern] [default]
(Unitus is the fontsite 500 'Univers' substitute, works fine)
Now, the built-in gyre bonum font doesn't have a slanted/oblique variant, so if 
I have Bookman as my main body
font, \sl  produces (unsurprisingly) the same result as \it, 
TexGyreBonum-Italic.   If I want \sl to summon
Latin Modern for the variant, I have tried variations on
\definetypeface [Bookman] [rm] [serif] [bonum] [sl=file:Latin Modern Roman 
Slanted]
but to no avail — not helped by the fact that the \definetypeface contextgarden 
page doesn't have any pointer to just what that fifth
argument can contain.


https://wiki.contextgarden.net/Command/definetypeface


How do I accomplish this?


Use \definefontfamily which is missing in your example.

\definefontfamily [Bookman] [rm] [TeX Gyre Bonum]
  [sl=features:{*,slanted},
   bs=features:{*,slanted}]

\definetypeface [Bookman] [mm] [math] [modern] [default]

\setupbodyfont [Bookman]

\starttext
\tf upright \it italic \sl slanted \bf bold \bi bolditalic \bs boldslanted
\stoptext

Wolfgang


Except that this does not work, because, as I said, the Gyre Bonum font has no 
builtin slanted version.


Have you even taken a look at the output of my example?


So, I want to use some other font (like Latin Modern) for a substitute for \sl .


I still think my version looks better (even with bold Latin Modern).

\definefontfamily [slantedbookman] [rm] [TeX Gyre Bonum]
  [sl={style:regular,features:{*,slanted}},
   bs={style:bold,features:{*,slanted}}]

\definefontfamily [modernbookman] [rm] [TeX Gyre Bonum]
  [sl={file:lmromanslant10-regular},
   bs={file:lmromanslant10-bold}]

% \definefontfamily [modernbookman] [rm] [TeX Gyre Bonum]
%   [sl={file:lmromanslant10-regular,features:{*,boldened}},
%bs={file:lmromanslant10-bold,features:{*,boldened}}]

\starttext

\setupbodyfont [slantedbookman]

\it italic \sl slanted \bi bolditalic \bs boldslanted

\setupbodyfont [modernbookman]

\it italic \sl slanted \bi bolditalic \bs boldslanted

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


Re: [NTG-context] OK, I Don't Quite Understand \definefontfamily

2020-09-28 Thread Wolfgang Schuster

Michael Urban schrieb am 25.09.2020 um 21:12:

I don't seem quite able to put it all together, forgive the question.

I have a 'Bookman' font setup, pretty vanilla:

\definetypeface [Bookman] [rm] [serif] [bonum] [sl=name:unituscndboldoblique]
\definetypeface [Bookman] [tt] [mono]  [modern] [default]
\definetypeface [Bookman] [ss] [sans] [unitus] [default]
\definetypeface [Bookman] [mm] [math] [modern] [default]

(Unitus is the fontsite 500 'Univers' substitute, works fine)

Now, the built-in gyre bonum font doesn't have a slanted/oblique variant, so if 
I have Bookman as my main body
font, \sl  produces (unsurprisingly) the same result as \it, 
TexGyreBonum-Italic.   If I want \sl to summon
Latin Modern for the variant, I have tried variations on

\definetypeface [Bookman] [rm] [serif] [bonum] [sl=file:Latin Modern Roman 
Slanted]


but to no avail — not helped by the fact that the \definetypeface contextgarden 
page doesn't have any pointer to just what that fifth
argument can contain.


https://wiki.contextgarden.net/Command/definetypeface


How do I accomplish this?


Use \definefontfamily which is missing in your example.

\definefontfamily [Bookman] [rm] [TeX Gyre Bonum]
  [sl=features:{*,slanted},
   bs=features:{*,slanted}]

\definetypeface [Bookman] [mm] [math] [modern] [default]

\setupbodyfont [Bookman]

\starttext
\tf upright \it italic \sl slanted \bf bold \bi bolditalic \bs boldslanted
\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
___


Re: [NTG-context] Tagged export breaks r2l alignment in tabulate

2020-09-27 Thread Wolfgang Schuster

Denis Maier schrieb am 26.09.2020 um 22:39:

Am 23.09.2020 um 16:04 schrieb Wolfgang Schuster:

Denis Maier schrieb am 23.09.2020 um 14:14:

Hi,

this example produces correctly aligned right-to-left text:


\setupalign[verytolerant,stretch]
\setupdirections[bidi=global,method=unicode]

\starttext

\starttabulate[|p|p|]
\NC Text
\NC Translation
\NC\NR
\NC\setupalign[r2l]\input ward
\NC\input ward
\NC\NR
\stoptabulate

\stoptext
==

But, this here fails:


\setupalign[verytolerant,stretch]
\setupdirections[bidi=global,method=unicode]
\setupbackend[export=yes]
\setupstructure[state=start,method=auto]

\starttext

\starttabulate[|p|p|]
\NC Text
\NC Translation
\NC\NR
\NC\setupalign[r2l]\input ward
\NC\input ward
\NC\NR
\stoptabulate

\stoptext
==

Why is that?


The export can lead to unwanted results in the PDF and should always 
be done in a separate run.



And what can I do about it? (I need tagged pdf for PDF/A compliance.)


You do you use export when you need only tagging?


You can enable tagging with

 \setuptagging[state=start]

and to set the PDF format use \setupbackend but ignore the export key.

Wolfgang


Thanks, Wolfgang for that suggestion. However, that does not seems to 
solve the problem. Put differently, tagging seems to lead to the same 
sort of problems.


It works when you set the alignment in the template of the table.

\setupdirections
  [bidi=global,
   method=unicode]

\setuptagging
  [state=start]

\starttext

\starttabulate[|pA{righttoleft}|p|]
%\NC \raggedleft Text\NC Translation \NC\NR
\NC \rightaligned{Text} \NC Translation \NC\NR
\NC \input ward \NC \input ward \NC\NR
\stoptabulate

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


Re: [NTG-context] numbering pages included by \copypages

2020-09-24 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 24.09.2020 um 23:48:

On Thu, 24 Sep 2020, Alan Bowen wrote:


I need to include several documents in a single paginated file. Treating
the source file (.tex) of each document as a component file in a .prd file
is one way to go. But I was wondering if it might be possible to do get the
same result using the .pdf files of each document instead.

\copypages is promising: it includes the. pdf files and the counter in the
resultant .prd file is correct. But what I still have to get is the page
number on all pages of the included .pdf files except the first page in
each.

I looked at \startpagefigure but that would be a very cumbersome way to go
since there over 350 pages to include, given that it handles only one page
at a time.

I hope that this makes sense.


I don't completely understand the question


I guess something like this:

\setupexternalfigures[location=default]

\starttext

...

\page

\getfiguredimensions[texit.pdf]

\noheaderandfooterlines

\dorecurse{\noffigurepages}
  {\vbox to \vsize
 {\vskip-\dimexpr\headerheight+\topspace\relax
  \hbox to \hsize
{\hskip-\backspace
 \externalfigure[texit.pdf][page=\recurselevel]%
 \hss}%
  \vss}}

\page

...

\stoptext


Any suggestions or pointers will be most welcome.


See if this gives you any ideas 

https://adityam.github.io/context-blog/post/include-multi-page-pdf/


When both document have the same size you can replace TeXpage with a 
"page" layout.


\startlayout[page]
\dorecurse{\noffigurepages}{\externalfigure[...][page=\recurselevel]}
\stoplayout

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
___


Re: [NTG-context] Tagged export breaks r2l alignment in tabulate

2020-09-23 Thread Wolfgang Schuster

Denis Maier schrieb am 23.09.2020 um 14:14:

Hi,

this example produces correctly aligned right-to-left text:


\setupalign[verytolerant,stretch]
\setupdirections[bidi=global,method=unicode]

\starttext

\starttabulate[|p|p|]
\NC Text
\NC Translation
\NC\NR
\NC\setupalign[r2l]\input ward
\NC\input ward
\NC\NR
\stoptabulate

\stoptext
==

But, this here fails:


\setupalign[verytolerant,stretch]
\setupdirections[bidi=global,method=unicode]
\setupbackend[export=yes]
\setupstructure[state=start,method=auto]

\starttext

\starttabulate[|p|p|]
\NC Text
\NC Translation
\NC\NR
\NC\setupalign[r2l]\input ward
\NC\input ward
\NC\NR
\stoptabulate

\stoptext
==

Why is that?


The export can lead to unwanted results in the PDF and should always be 
done in a separate run.



And what can I do about it? (I need tagged pdf for PDF/A compliance.)


You do you use export when you need only tagging?


You can enable tagging with

    \setuptagging[state=start]

and to set the PDF format use \setupbackend but ignore the export key.

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
___


Re: [NTG-context] How to shift unnumbered ToC entry?

2020-09-23 Thread Wolfgang Schuster

Lukas/ConTeXt schrieb am 23.09.2020 um 10:33:

Hello,
  
how do I shift unnumbered ToC entry (here: \subsubsection)? My attempt:
  


\setuphead[subsubsection][number=no]
\setuplist[subsubsection][distance=20mm,width=20mm]


\setuplist
  [subsubsection]
  [margin=5em]

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
___


Re: [NTG-context] \dorecurse{}{} problem

2020-09-21 Thread Wolfgang Schuster

Jeong Dal schrieb am 21.09.2020 um 20:54:


Dear Aditya, Jairo, Wolfgang, and Otared,

Thank you for the replies and explanations.
I also read the blog.

In this case, using '##1’ is an easy way.
For more complex table, I may use luacode.



I forgot the obvious \expanded solution:

\starttext

\starttabulate[|c|]
\dorecurse{9}{\expanded{\NC \recurselevel \NC\NR}}
\stoptabulate

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


Re: [NTG-context] Extreme tables and XML conflict?

2020-09-21 Thread Wolfgang Schuster

Denis Maier schrieb am 21.09.2020 um 16:38:

Hi,

I'm a bit confused, but this here won't compile:

=
\startbuffer[test]


Test


\stopbuffer

\startxmlsetups xml:test
    \xmlsetsetup{#1}{*}{-}
    \xmlsetsetup{#1}{article}{xml:*}
    \xmlsetsetup{#1}{table[@content-type!='parallel']}{xml:table}
    \stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:article
\starttext
    \xmlflush{#1}
\stoptext
\stopxmlsetups

\startxmlsetups xml:table
  \startxtable
    \startxrow
  \startxcell one \stopxcell
  \startxcell two \stopxcell
    \stopxrow
  \stopxtable
\stopxmlsetups


\startxmlsetups xml:table
    \startembeddedxtable
    \startxrow
    ...
    \stopxrow
    \stopembeddedxtable
\stopxmlsetups

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
___


Re: [NTG-context] Math fonts for Nimbus fonts

2020-09-21 Thread Wolfgang Schuster

Otared Kavian schrieb am 21.09.2020 um 15:30:

Hi,

I wish to use the Nimbus fonts, but since I didn't know which Math fonts is 
best adapted to this family, I tried several fonts such as Stix Math, TeX Gyre 
Math, and so on, but doing this the math-italic does not appear in these fonts: 
does this mean that I have to set explicitely math-italic in definefontfamily?


I don't understand your problem because you tell ConTeXt to use upright 
letters (normal = upright) in math mode with the following setup.



\setupmathematics[integral=nolimits,lcgreek=normal,default=normal]


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
___


Re: [NTG-context] \dorecurse{}{} problem

2020-09-21 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 21.09.2020 um 16:35:

On Mon, 21 Sep 2020, Jeong Dal wrote:


Hi,

I tried to make a table using \dorecurse or \doloop as in the example.
There is no error but \recurselevel is not increased, all are 0 in the first 
example and only two rows are created with the \recurselevel 0 and 2 only in 
the second example.

Does the tabulate cause the error?
What is wrong in this MWE?

\dorecurse does not expand its arguments. See this old blog post for a 
discussion on this:

https://adityam.github.io/context-blog/post/tex-programming/


\starttext

\starttabulate[|c|]
\dorecurse{8}{\NC ##1 \NC\NR}
\stoptabulate

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


Re: [NTG-context] lmtx update

2020-09-17 Thread Wolfgang Schuster

Eduardo Bohoyo schrieb am 17.09.2020 um 10:14:

Thank you for this illustrative example, Wolfgang.

So, what \forgetparagraphfreezing does is to reverse the order that 
lmtx currently imposes by default, right? In other words, 
\forgetparagraphfreezing, recovers the default behaviour of MkIV.


So, I suspect that this will not change; if we want to apply Lettrine 
to a paragraph, from now on we must wrap it up with 
\forgetparagraphfreezing and \setparagraphfreezing.


Please correct me if I'm wrong.


LMTX removes some restrictions for settings which are applies to 
paragraphs, e.g. the following example works now without problems with 
LMTX while LuaTeX needs the \dontleavehmode at the begin of the paragraph


\starttext

\placefigure[left]{none}{\framed[width=2cm,height=2cm]{}}
%\dontleavehmode
{\bf Tufte: }\input tufte

\stoptext

To avoid side effects from these changes LMTX freezes a few settings at 
the begin of the paragraph. In some cases commands or settings have to 
be adapted to these changes and the lettrine module is one of them.


The changes itself to the commands have to be made in the modules etc. 
itself and not in the documents, below is a minimal example how the 
lettrine module has to be changed to get indentation for the initial back.


\starttext

\hsize 10cm

\noindent
\parshape 3 1cm 9cm 1.5cm 8.5cm 0cm 10cm
\input weisman

\blank

\begingroup
\noindent
\parshape 3 1cm 9cm 1.5cm 8.5cm 0cm 10cm
\updateparagraphshapes
\endgroup
\input weisman

\stoptext

BTW: ConTeXt already provides a command to place initials as part of the 
core but it lacks a few features of the lettrine module.


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
___


Re: [NTG-context] lmtx update

2020-09-16 Thread Wolfgang Schuster

ebohoyod schrieb am 16.09.2020 um 17:52:

Hi,

It seems that the Lettrine module is one of those affected:

https://tex.stackexchange.com/questions/562534/does-context-fail-in-the-lmtx-environment-with-the-lettrine-module?noredirect=1#comment1418902_562534 



But, honestly, first, I don't know what means "/Of course it might have 
other side effects once in lmtx we everywhere expect freezing to be 
enabled./"
I suppose that, in order not to be a nuisance (and not to digress into 
this real subject of interest), a short answer would be enough to put me 
on track to investigate it.


On the other hand, I suppose the best practice, from what I have just 
read, would be not to use \forgetparagraphfreezing globaly, but 
\forgetparagraphfreezing  and \setparagraphfreezing at the beginning and 
end of the first paragraph respectively of each chapter.  Would this be 
the least harmful way? That is, wrapping it up to avoid this provisional 
failure of the Lettrine with LMTX module, but at the same time to avoid 
affecting that default freezing proposal in the rest of the document, 
right?


By the way, and just out of curiosity, how does the recommended 
provisional command work? Would it be something like this in the preamble?:


\definingparagraphs
     firstparagraph][n=1]
     \setupparagraphs [firstparagraph][1][align={hanging}]

And then this arrangement in the \input files?:

\startfirstparagraph
\lettrine{B}{lah} blah, blah, blah...
\stopfirstparagraph
\blank [overlay] \strut

I know it's a dirty, inelegant solution, but I can't think of a better 
one at the moment.


Below is a minimal example which doesn't rely on the module,
the problem is caused by the order of the \noindent and \parshape
command.

When a paragraph starts before the \parshape values are set
the arguments are ignored because the values are already frozen
at this moment, when you set the values before the paragraphs
starts ConTeXt applies them.

\starttext

\hsize 10cm

% lettrine module, \noindent before \parshape

\noindent
\parshape 3 1cm 9cm 1.5cm 8.5cm 0cm 10cm
\input weisman

\blank

% working order, \parshape before \noindent

\parshape 3 1cm 9cm 1.5cm 8.5cm 0cm 10cm
\noindent
\input weisman

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


Re: [NTG-context] Footnote font size equal to main text font size

2020-09-16 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 15.09.2020 um 04:38:
Hi, list. I've adapted the following example from the mailing list. My 
aim is to use endnotes for each chapter:


\mainlanguage[es]
\definehead[footnotetitle][title]
\startsetups[chapter:after]
\ifcase\rawcountervalue[footnote]\relax
      \else
          \startfootnotetitle[title={Notas}]
              \placefootnotes
          \stopfootnotetitle
      \fi
\stopsetups

\setupnotes[location=none]
\setupnotation[way=bychapter]
\setupfootnotedefinition[style={\switchtobodyfont[12pt]}]

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

\starttext

\startchapter[title={Chapter One}]

Here comes \footnote{a footnote}. Aquí \footnote{otra nota a pie de página}.

\stopchapter

\stoptext

However, I'm concerned by \switchtobodyfont. How should I make footnote 
size the same as the default font size, even when an arbitrary font size 
is used.



\starttext

First paragraph\footnote{Footnote one}

\page

\setupnote[footnote][bodyfont=]
%\setupnotation[footnote][numbercommand=]

Second paragraph\footnote{Footnote two}

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


Re: [NTG-context] Bad argument #1 to 'prehypenchar'

2020-09-15 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 15.09.2020 um 21:19:

On Tue, 15 Sep 2020, Wolfgang Schuster wrote:


You have to add \resetbreakpoints to the vim/filter module.


Thanks. I had:

   \doifnotinset{\v!hyphenated}{\externalfilterparameter\c!option}
   {\language\minusone}%

which I changed to

   \doifnotinset{\v!hyphenated}{\externalfilterparameter\c!option}
   {\language\minusone
\resetbreakpoints}%

and this fixed the error.


Don't use the \language hack, the official and supported commands are 
\nohypens and \dohyphens or when you need a interface for it use


\usehyphensparameter\...parameter

which allows

\setup...[hyphens=yes|no]

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
___


Re: [NTG-context] Problem with fonts in Lua

2020-09-15 Thread Wolfgang Schuster

MANUEL GONZALEZ SUAREZ schrieb am 15.09.2020 um 12:00:

Hi all:

I have this minimal example (thanks to Pablo and Charles):

\mainlanguage [es]

\definefallbackfamily [mainface] [rm] [New Athena Unicode]

[preset = range: greek, force = yes]

% \definefallbackfamily [mainface] [rm] [Old Standard]

% [preset = range: greek, force = yes]

\definefontfamily [mainface] [rm] [TeX Gyre Pagella]

\definefontfamily [mainface] [ss] [TeX Gyre Heros, scale = 0.75]

\setupbodyfont [mainface]

\starttext

Spanish text

\input tufte

Greek Text:

Μετὰ δὲ ταῦτα οὐ πολλαῖς ἡμέραις ὕστερον ἦλθεν ἐξ

Ἀθηνῶν Θυμοχάρης ἔχων ναῦς ὀλίγας · καὶ εὐθὺς ἐναυμάχησαν αὖθις 
Λακεδαιμόνιοι καὶ Ἀθηναῖοι, ἐνίκησαν δὲ


Λακεδαιμόνιοι ἡγουμένου Ἀγησανδρίδου.

\stoptext

I compile with TeXLive 2020 and Windows 10. I have the two fonts (New 
Athena Unicode and Old Standard) installed on my system but with New 
Athena Unicode it does not compile; on the other hand, with Old Standard 
it does compile. I do not know what I can do.


1. Remove the spaces from the key-val entries

2. Don't mix key-val entries with arguments

3. Load hyphenation patterns for greek (you can add them to spain 
because there is no overlap).


The following example works on my system but I suggest to add a math 
font (itemize uses math symbols as fallback).


\definefallbackfamily
  [mainface] [rm] [New Athena Unicode]
  [preset=range:greek,force=yes]

\definefontfamily [mainface] [rm] [TeX Gyre Pagella]

\definefontfamily [mainface] [ss] [TeX Gyre Heros] [scale=0.75]

\setuplanguage [es] [patterns={es,gr}]

\setupbodyfont [mainface]

\mainlanguage[es]

\starttext

\samplefile{cervantes-es}

\samplefile{aristotle-grc}

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


Re: [NTG-context] Bad argument #1 to 'prehypenchar'

2020-09-15 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 15.09.2020 um 05:30:

The following MWE gives an error with LMTX 2020.09.05


\usemodule[vim]
\definevimtyping[MATLABCODE][syntax=matlab]

\starttext
\startMATLABCODE
   saveas(gcf(), "output/same-sigma.png")
\stopMATLABCODE
\stoptext

The error message is:

callback error: 
...metatex/texmf-context/tex/context/base/mkiv/lang-ini.lua:509: bad argument 
#1 to 'prehyphenchar' (luatex.lang expected, got no value)
stack traceback:
 [C]: in function 'lang.prehyphenchar'
 ...metatex/texmf-context/tex/context/base/mkiv/lang-ini.lua:509: in 
field 'prehyphenchar'
 ...metatex/texmf-context/tex/context/base/mkiv/typo-brk.lua:171: in 
local 'method'
 ...metatex/texmf-context/tex/context/base/mkiv/typo-brk.lua:392: in 
upvalue 'typesetters_breakpoints_handler'
 [string "local tonut  = nodes.tonut..."]:16: in function <[string "local tonut 
 = nodes.tonut..."]:11>
 (...tail calls...)
 ...metatex/texmf-context/tex/context/base/mkiv/node-pro.lua:88: in function 
<...metatex/texmf-context/tex/context/base/mkiv/node-pro.lua:79>

1 >>  \SYNBOL{}saveas(gcf(), \SYN[String]{"output/same-sigma.png"})\SYNEOL{}
2
mtx-context | fatal error: return code: 256

Any idea what is going on?


You have to add \resetbreakpoints to the vim/filter module.

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
___


Re: [NTG-context] How do I specify a fallback to Symbola for the playing card range?

2020-09-11 Thread Wolfgang Schuster

T. Kurt Bond schrieb am 11.09.2020 um 16:12:
I tried using 
"\definefontfallback[mainface][rm][Symbola][range=playingcards,force=yes]" 
and the PLAYING CARD ACE OF SPADES still didn't show up in the output.


It's the wrong command, you need \definefallbackfamily when you use 
\definefontfontfamily.


\definefallbackfamily[mainface][rm][Symbola][range=playingcards,force=yes]

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
___


Re: [NTG-context] \definefontfamily not finding fonts

2020-09-10 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 10.09.2020 um 17:53:

On Thu, 10 Sep 2020, Wolfgang Schuster wrote:


Aditya Mahajan schrieb am 10.09.2020 um 05:16:

Did something change with regard to \definefontfamily recently.

I have an old document where I use:

\starttypescript[mainface]
\definefontfamily[mainface][rm][Libertinus Serif][features=default]
\definefontfamily[mainface][ss] [heros]  [features=default]
\definefontfamily[mainface][tt] [dejavu] [features=none, rscale=0.85]
\definefontfamily[mainface][mm] [LibertinusMath]
\stoptypescript

\setupbodyfont[mainface,12pt]

On the recent LMTX (2020.09.05) I get

selectfont  > the requested font 'Libertinus Serif' has no files for the
'tf' alternative, Latin Modern is used instead.
selectfont  > the requested font 'heros' has no files for the 'tf'
alternative, Latin Modern is used instead.
selectfont  > the requested font 'dejavu' has no files for the 'tf'
alternative, Latin Modern is used instead.
selectfont  > the requested font 'LibertinusMath' has no files for the
'tf' alternative, Latin Modern is used instead.


I can find the fonts using mtxrun --script fonts. For example:

$mtxrun --script fonts --list --pattern="LibertinusSerif" --all
identifier   familynamefontname
filename  subfont   instances

libertinusserif  libertinusserif   libertinusserif
libertinusserif-regular.otf
libertinusserifdisplaynormal libertinusserifdisplay
libertinusserifdisplaylibertinusserifdisplay-regular.otf
libertinusserifdisplayregularlibertinusserifdisplay
libertinusserifdisplaylibertinusserifdisplay-regular.otf
libertinusserifinitialsnormallibertinusserifinitials
libertinusserifinitials   libertinusserifinitials-regular.otf
libertinusserifinitialsregular   libertinusserifinitials
libertinusserifinitials   libertinusserifinitials-regular.otf
libertinusserifnormallibertinusserif
libertinusserifitalic libertinusserif-italic.otf
libertinusserifregular   libertinusserif   libertinusserif
libertinusserif-regular.otf

and similar for the other fonts.

Any idea on what is going on and how to debug.

I can't reproduce your Libertinus problem but the sans serif and monospaced
fonts just use the wrong names.

In by defense, it used to work for the last 5 years :-)


Are you mixing \definetypeface and \definefontfamily?

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
___


Re: [NTG-context] problem embedding TABLE macros within wrapper macros "to reduce repetitive complexity")

2020-09-10 Thread Wolfgang Schuster

Rudd, Kevin schrieb am 09.09.2020 um 17:32:

[Workable solution found]

After more exploration, the following seems to solve the problem of 
creating a simple 2x2 quad chart; thanks for the explanation that the 
\bTD requires a matching \eTD in the immediate (not future expanded) 
evaluation context. I prefer the \start* and \stop* model but for the 
moment this solution works for my current purpose. The good part is that 
it does abstract out the interface so that I can change it in the future 
without needing to change the slide text. I may investigate a better 
(parametrizable/reconfigurable) solution later if I end up needing a 
more complex paned-layout environment that doesn't need direct access to 
the TABLE (or some other more relevant) interface.


MWE demonstrator; there's other cruft in the actual definitions for my 
purposes.


\starttext
     \define\startPaneSlide{\bTABLE}
     \define\stopPaneSlide{\eTABLE}
     \long\def\PaneRow#1{\bTR #1 \eTR}
     \long\def\Pane#1{\bTD #1 \eTD}

     \startPaneSlide
         \PaneRow{\Pane{aaa bbb ccc ddd}\Pane{eee fff ggg hhh}}
         \PaneRow{\Pane{iii jjj kkk lll}\Pane{mmm nnn ooo ppp}}
     \stopPaneSlide
\stoptext


For very short texts like in your example you can use the short form of 
natural tables.


\starttext

\startTABLE
\NC aaa bbb ccc ddd \NC eee fff ggg hhh \NC\NR
\NC iii jjj kkk lll \NC mmm nnn ooo ppp \NC\NR
\stopTABLE

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


Re: [NTG-context] How do I specify a fallback to Symbola for the playing card range?

2020-09-10 Thread Wolfgang Schuster

T. Kurt Bond schrieb am 09.09.2020 um 21:40:
I want to use the Unicode Character PLAYING CARD ACE OF SPADES in a 
ConTeXt document.  Because of the way the source document is created it 
has to be as the actual unicode character itself, rather than a 
reference to a specific character in a specific font.


Here's what I've tried, but it doesn't work:

\definefontfallback[mainface][rm][Symbola][preset=range:playingcards,force=yes]


Try

\definefontfallback[mainface][rm][Symbola][range=playingcards,force=yes]

The "range:..." presets are just a comma separated list of name which 
are passed to the range key.


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
___


Re: [NTG-context] \definefontfamily not finding fonts

2020-09-10 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 10.09.2020 um 05:16:

Did something change with regard to \definefontfamily recently.

I have an old document where I use:

\starttypescript[mainface]
   \definefontfamily[mainface][rm][Libertinus Serif][features=default]
   \definefontfamily[mainface][ss] [heros]  [features=default]
   \definefontfamily[mainface][tt] [dejavu] [features=none, rscale=0.85]
   \definefontfamily[mainface][mm] [LibertinusMath]
\stoptypescript

\setupbodyfont[mainface,12pt]

On the recent LMTX (2020.09.05) I get

selectfont  > the requested font 'Libertinus Serif' has no files for the 
'tf' alternative, Latin Modern is used instead.
selectfont  > the requested font 'heros' has no files for the 'tf' 
alternative, Latin Modern is used instead.
selectfont  > the requested font 'dejavu' has no files for the 'tf' 
alternative, Latin Modern is used instead.
selectfont  > the requested font 'LibertinusMath' has no files for the 'tf' 
alternative, Latin Modern is used instead.


I can find the fonts using mtxrun --script fonts. For example:

$mtxrun --script fonts --list --pattern="LibertinusSerif" --all
identifier   familynamefontname 
 filename  subfont   instances

libertinusserif  libertinusserif   libertinusserif  
 libertinusserif-regular.otf
libertinusserifdisplaynormal libertinusserifdisplay
libertinusserifdisplaylibertinusserifdisplay-regular.otf
libertinusserifdisplayregularlibertinusserifdisplay
libertinusserifdisplaylibertinusserifdisplay-regular.otf
libertinusserifinitialsnormallibertinusserifinitials   
libertinusserifinitials   libertinusserifinitials-regular.otf
libertinusserifinitialsregular   libertinusserifinitials   
libertinusserifinitials   libertinusserifinitials-regular.otf
libertinusserifnormallibertinusserif   
libertinusserifitalic libertinusserif-italic.otf
libertinusserifregular   libertinusserif   libertinusserif  
 libertinusserif-regular.otf

and similar for the other fonts.

Any idea on what is going on and how to debug.


I can't reproduce your Libertinus problem but the sans serif and 
monospaced fonts just use the wrong names.


\definefontfamily [mainface] [rm] [Libertinus Serif]
\definefontfamily [mainface] [ss] [TeX Gyre Heros] [rscale=0.85]
\definefontfamily [mainface] [tt] [DejaVu Sans Mono] 
[features=none,rscale=0.85]

\definefontfamily [mainface] [mm] [Libertinus Math]

\setupbodyfont[mainface]

\starttext

\rm\tf Regular \it Italic \bf Bold \bi BoldItalic

\ss\tf Regular \it Italic \bf Bold \bi BoldItalic

\tt\tf Regular \it Italic \bf Bold \bi BoldItalic

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


Re: [NTG-context] styling individual parts of ToC entry

2020-09-09 Thread Wolfgang Schuster

jbf schrieb am 09.09.2020 um 08:04:
Have to confess I am still not getting far with the final problem in a 
book that is now fully laid out: frontmatter through to appendices is 
all correct and working, but the Table of Contents not the way I need it 
(as explained earlier and listed in a previous email).


My latest effort focuses on just one item, the Foreword, since if I get 
that right, I can apply the same logic to sections. Chapters are already 
working correctly, thanks to Wolfgang's ChapterListCommand and I am 
assuming I need that for the several frontmatter 'chapters'.


I was earlier using \title for foreword, preface and notes to 
contributors, but have abandoned that as complicating things, and am now 
using \chapter, since it does not produce a numbered item - however, it 
is producing the label 'Chapter' which I don't want for these item. You 
can see below how I tried to avoid that, but it failed. My MWE addition 
to what Wolfgang provided is:


\definehead [foreword] [chapter]

\setuphead [foreword]

\setuplist [foreword]
  [label=foreword,
  alternative=command,
  command=\ChapterListCommand]% definition not included here. It was 
given in an earlier response from Wolfgang.


 And in the frontmatter itself:

\startchapter[foreword][title={\ss Foreword}][author={A. Uthor}]

..


You can set the forword string as labeltext and ignore the title (but 
use a empty argument when set userdata like the author).


\definehead
  [forword] [chapter]

\setuplabeltext
  [en]
  [forword=Forword,
   chapter=Chapter ]

\setuphead
  [forword]
  [frontpartlabel=forword,
   conversion=empty]

\setupsectionblock
  [frontpart]
  [number=yes]

\setuplist
  [forword]
  [label=forword,
   width=2cm]

\setuplist
  [chapter]
  [label=chapter,
   width=2cm]

\starttext

\startfrontmatter

\placelist [chapter,forword]

\startforword [] [author={A. u. thor}] \stopforword

\stopfrontmatter

\startbodymatter

\startchapter [title=Chapter 1] [author={A. u. thor}] \stopchapter

\stopbodymatter

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


Re: [NTG-context] problem embedding TABLE macros within wrapper macros "to reduce repetitive complexity")

2020-09-08 Thread Wolfgang Schuster

Rudd, Kevin schrieb am 09.09.2020 um 00:30:
Thanks. The immediate goal is to make a ”quad chart” w/ different 
pains in the four (2x2 => NW, NE, SW, SE) quadrants. It seemed that 
the concept was scalable to any NxM (even with multi-cell 
spreads---useful for larger structured posters) based on TABLE. But 
I'd settle for 2x2 at the moment; at one point I'd thought of 2x2+1 
having a spanning block for publication references per slide but 
decided a separate publications slide was a better idea visualy..


If they have to see an end command, would before/after tags work 
around a framedtext or buffer structure?


1. 2x2 panes, layout order not important, all panes independent; no 
flow (like Framemaker used to do) requiredbetween panes.
2. was going to have inner frames (i.e. + frame for 2x2 which was 
trivial to specify in TABLE) to separate the panes
3. other than wanting the + frame, inner margins  for panes wsn't 
an issue either way.


When you need one than single block per line this definition

\define\startPaneRow{bTR\bTD}
\define\stopPaneRow{\eTD\eTR}

doesn't make sense because you limit yourself and after each table cell 
there is a new row.


While you can write code which moves your blocks around you should ask 
yourself the question is it worth it. When you have only two or three 
posters in this format use the extra commands for table rows and cells 
because it takes more time to write something which does the work.


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
___


Re: [NTG-context] problem embedding TABLE macros within wrapper macros "to reduce repetitive complexity")

2020-09-08 Thread Wolfgang Schuster

Rudd, Kevin schrieb am 08.09.2020 um 19:50:
I have a number of slides using \...framedtext blocks to break the 
slides into panes within a TABLE environment (TMI: not in MWE; merely 
my justification for writing the wrapper macros). When the TABLE 
macros are invoked explicitly it all works fine and produces a 
suitable single-cell table with "quux blech baz bar foo" framed; when 
embedded in macros (whether defined by \def, \unexpanded\def, \define) 
then it fails with the error "The file ended when scanning an 
argument. => fatal error: return code: 256. A previous question on the 
topic seemed to indicate that TABLE was suitable, so I figure that 
something subtle is wrong as I've invoked the embedded TABLE macros. 
Any suggestions?


While most natural tables command can be embedded within other command 
the cells have to see the end command.


I guess this shouldn't be a problem for your case because something 
simpler can be used to create your desired layout but you have to 
provide more information:


1. Are there blocks side by side or do you stack them only vertically?

2. Do you need a frame around each block?

3. Are (small) gaps between the blocks allowed?

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
___


Re: [NTG-context] Column not Balancing, Footnote is Missing

2020-09-08 Thread Wolfgang Schuster

Art Chimes schrieb am 08.09.2020 um 00:38:

Greetings, list. My first post here. Please be gentle!

The command \contextversion reports I am using 2020.09.03 20:03 on Windows 10.

The MWE below produces a column and a half of text, not balanced
(despite the \setupcolumns [...balance=yes...] command. Also, the
footnote *number* appears on the PDF, but the *text* of the footnote
doesn't.

However, when I use the online compiler (live.contextgarden.net,
reported version 2020.06.30 17:30, older than mine), the footnote text
*does* appear, though the columns are still not balanced.

%

\usemodule[ipsum]
\setupfootnotes[location=page,rule=on,bodyfont=8.5pt]
\setupcolumns [n=2,balance=yes,blank=line]

\starttext
\chapter{Footnote Test  —  \contextversion}
\startcolumns

\ipsum

Cursus metus aliquam eleifend mi in nulla posuere sollicitudin
aliquam. Id aliquet risus feugiat in ante metus dictum at
tempor.\footnote{Thor, A.U.: {\it Latin 101 for Dummies} (Rome,
Dummies Pub., MCMLXXIX)}

\ipsum[alternative=lines,n=20]

\end columns
\stoptext

%

Question (1) : Why don't the columns balance, and how can I fix it?


Replace

    \end columns

with

    \stopcolumns

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
___


Re: [NTG-context] Appendix question

2020-09-08 Thread Wolfgang Schuster

jbf schrieb am 08.09.2020 um 12:40:

A (hopefully) simple question this time:

Why would my appendices be labelled as Appendix One, Appendix Two etc., 
instead of Appendix A, Appendix B? I thought Appendices would normally 
be labelled alphabetically, not numerically.


So I get APPENDIX as the label, I have:

\setuplabeltext
   [en]
   [chapter={\bf Chapter }, appendix=APPENDIX ]

But elsewhere I have:

\setupheads[chapter][indentnext=no,conversion=Words,distance=.25em]

So is that what is affecting my appendices, and if so how do I do it so 
that Chapters get words (One, Two, etc) and Appendices get letters (A,B, 
etc)?


Use sectionconversionset to set the number conversion for all section 
levels and ignore the conversion key.


\defineconversionset [bodypart:section] [n,Word] [n]
\defineconversionset [appendix:section] [n,A] [n]

\setupheads
  [sectionconversionset=section]

\setuplabeltext
  [en]
  [chapter=Chapter ,
   appendix=Appendix ]

\starttext

\startbodymatter

\stopbodymatter

\dorecurse{5}{\chapter{Chapter #1}}

\startappendices

\dorecurse{5}{\chapter{Chapter #1}}

\stopappendices

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


Re: [NTG-context] styling individual parts of ToC entry

2020-09-07 Thread Wolfgang Schuster

jbf schrieb am 07.09.2020 um 01:31:


Yes, Wolfgang, that corrects the minor problem of including the author 
name correctly, even when there is no year range. Thank you.


But since I use \title, not \chapter, for the frontmatter items, ( 
Foreword, Preface, A note on Contributors), the ChapterListCommand 
clearly does not apply, so currently my ToC looks as follows (leaving 
out the pg numbers which correctly align right):



                     Foreword
                     A. Uthor
                            Preface
                     A. Uthor
                             A note on contributors
Chapter One        Year range
                    A. Uthor

What I want is for 'Foreword', 'Preface' and 'A note on Contributors' 
to align flushleft with Chapter One, but with author names still where 
they should be (Foreword and Preface have authors, 'A note...' does 
not have an author).


So I tried creating a TitleListCommand which copies the 
ChapterListCommand. But where I run into difficulties then is with a 
new lot of \setuplist to accommodate that. There are three different 
labels involved (Foreword, Preface, and A note on Contributors).


And why is it that even with the current setup, 'Foreword' has aligned 
with author name, not with 'Preface' and 'A note...'? All three are 
\title, after all.


All in all this is a most complicated ToC! What I need is for the ToC 
to look like I show it below, and you will note the additional 
complication of Chapter Two which does not have an author, but instead 
it is the SECTIONS in the Chapter that have authors!


I'm sure if I can get on top of all this somehow, no future ToC is 
ever going to cause me problems! The body of the book is all looking 
good, all 300 pages of it. It is just the automatically produced ToC 
that is causing the headaches.


Foreword                    A. Uthorpg no.
Preface                 A. Uthor"
A note on Contributors  "
Chapter One                 Chapter Title
                             A. Uthor"
Chapter Two Chapter title
A section   Context
 A. Uthor"
Another section Reflection
 A. Author   "

So what I have below as an MWE is fundamentally what you gave me (I 
have left out the correctly working ChapterListCommand), altered for 
\title, but I haven't got the setups below correct because I don't 
know how to do it. I have replaced unknowns with a question mark!


And at the moment I have nothing for the 'sections' with authors I 
need for Chapter Two. I assume I would set up a third definition 
called \SectionListCommand. Sections will have different labels too - 
one will be called 'Context', the other 'Reflection'.


\define[3]\TitleListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

\setuplist
  [chapter]
  [label=chapter,
  alternative=command,
   command=\ChapterListCommand]

\setuplist
  [title]
  [label=?,
  alternative=command,
   command=\TitleListCommand]

\setuplabeltext
  [en]
  [chapter={\bf Chapter }]

\setuplabeltext
  [en]
  [title={\bf ? }] %There needs to be three different labels


You need extra headings for the forward and preface

    \definehead [forward] [chapter]
    \definehead [preface] [chapter]

to have full control about their layout.

I can provide you a solution for your problems but you have to create a 
complete minimal example (including forward and preface titles) first.


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
___


Re: [NTG-context] styling individual parts of ToC entry

2020-09-06 Thread Wolfgang Schuster

jbf schrieb am 06.09.2020 um 02:03:
Thanks Wolfgang, while I don't pretend to fully understand the setup you 
have provided (but am working on doing so!), of course it provides the 
correct result for a chapter that has a title, an author, and a year.


My ever-so-complicated book (and its authors!) however, throws one small 
further complication into the mix.


Where a chapter does not have a year-range, and I either omit that 
declaration, or I leave the curly brackets empty (e.g. year={}), then I 
find that the author name also does not appear in the ToC. What 
adjustment to the \ChapterListCommand do I need to make to accommodate 
the following? Possibly an \else statement, but not sure how to include 
that:


\startchapter [title={Chapter title}] [author={Author Name}]


I forgot to change the argument for the check off the author entry, this 
should fix it.


\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\bf\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

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
___


Re: [NTG-context] styling individual parts of ToC entry

2020-09-05 Thread Wolfgang Schuster

jbf schrieb am 05.09.2020 um 03:35:
Now that with Hraban's invaluable assistance I am able to include title, 
subtitle, author as and when necessary in the ToC and put them on the 
same line if I need to, I have two questions that I have not found a 
satisfactory solution to after playing around with various possibilities.


I need:

(1) the author's names lined up vertically throughout the ToC, and

(2) the first part of the entry (e.g. Foreword) to be bold, but the 
author name to be regular text.


An adjusted version of Hraban's setup can show what I have tried by way 
of example:


%

\define[1]\TitleTocEntry{%
   #1\hskip 1cm% title
    \structurelistuservariable{author}%
   }

\setuplist[title][textstyle=bold,
   textcommand=\TitleTocEntry,
]

%---

/Question 1:/ /How to get the two author names to line up vertically./ 
Given that I have both a Foreword and a Preface, I am using \title for 
these. And both have separate authors. The titles will be simply 
'Foreword' and 'Preface', obviously.


*Foreword Author name*

*Preface    Author name*

I am using \hskip 1cm to separate the authors' names from either of 
those two words. But this does not give me the kind of exact positioning 
I need to get the two author names directly underneath each other in the 
list. I have tried various alternatives to \hskip, but none of them can 
give me the correct proportional distance. The distance is obviously 
being controlled by the fact that 'Foreword' is 8 characters and 
'Preface' is 7. Is what I want only obtainable with a table setup?


The issue might or might not be more complicated when I get to main 
chapters, where the author names need to line up with the Foreword and 
Preface author names as well. There will be, e.g.


Chapter One  Title

    Author name
//

/Question 2:/ /How to independently get Foreword and Preface to be bold, 
but the authors' names to be regular./ \setuplist offers me options like 
textstyle, pagestyle, numberstyle, but they apply to everything (both 
Foreword/Preface and Authors' name are bold). I thought perhaps I could 
control it from within the document, e.g.


\starttitle[title={\ss\bf Foreword}][author={A. Uthor}]

But that does the same - both Foreword and A. Uthor end up bold. And 
besides, I also want to style the ToC independently of the heads if I can.


The wiki and various manuals do offer various tips on modifying the ToC, 
but I cannot find anything regarding the two questions above - not yet, 
anyway. If someone knows where, please point me to it.


\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{year}}
 {\crlf{\bf\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

\setuplist
  [chapter]
  [label=chapter,
   alternative=command,
   command=\ChapterListCommand]

\setuplabeltext
  [en]
  [chapter=Chapter ]

\starttext

\completecontent

\startchapter [title={Chapter title}] [author={Author 
Name},year={1980--2000}]

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


Re: [NTG-context] Typing efficiency

2020-09-04 Thread Wolfgang Schuster

Taco Hoekwater schrieb am 04.09.2020 um 15:51:


Hi,

Sounds like a job for the blocks mechanism more so than buffers:


\defineblock[entext]
\defineblock[nltext]
   
\defineselector [language] [max=2,n=1]

\startmode[en]
 \setupselector[language][n=1]
 \keepblocks[entext]
\stopmode
\startmode[nl]
 \setupselector[language][n=2]
 \keepblocks[nltext]
\stopmode
  
\starttext
  
\startsection[title=\select{language}{English title}{Dutch title}]
  
\beginentext

 This is English text.
\endentext
\beginnltext
 This is Dutch text.
\endnltext
  
\stopsection
  
\stoptext



It can also be done with buffers.

\definebuffer [entext]
\definebuffer [nltext]

\defineselector [language] [max=2,n=1]

\startmode[en]
\setupselector[language][n=1]
\def\stopentext{\getentext}
\stopmode

\startmode[nl]
\setupselector[language][n=2]
\def\stopnltext{\getnltext}
\stopmode

\starttext

\startsection[title=\select{language}{English title}{Dutch title}]

\startentext
This is English text.
\stopentext
\startnltext
This is Dutch text.
\stopnltext

\stopsection

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


Re: [NTG-context] Quotation with footnote

2020-09-04 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 04.09.2020 um 15:34:

Am 04.09.2020 um 13:25 schrieb Henning Hraban Ramm :

My current book contains a lot of quotations with their sources marked as 
footnotes, e.g.


\definedelimitedtext[Zitat][
  %setups=Zitat, % doesn’t work!?
  left=»,
  right=«,
  leftmargin=2em,
  rightmargin=1.5em,
]

\startZitat
A rose is a rose is a rose.\footnote{Marx brothers}
\stopZitat


Now, since the quotations are whole sentences or paragraphs, the footnote 
marker needs to be placed _after_ the closing quotation mark. (German 
typography, I learned it’s different at least in US English.)

I tried several approaches e.g. with my own single start/stop macros that call 
\start/stopnarrower or \start/stopZitat – that always lead to unclosed 
environments.

This looks as I want it to:

\setupnarrower[left=2em,right=1.5em]

\startnarrower
\hskip-0.33em\quotation{Im übrigen ist der Mensch ein Lebewesen, das klopft, 
schlechte Musik macht und seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, 
aber dann ist er tot.}\footnote[f:9]{Kaspar Hauser (Kurt Tucholsky), Weltbühne 
24, 16.\,6.\,1931}
\stopnarrower

But how can I make that into a single environment?


\startsetups [userdata:myquote]
    \startnarrow [left=2em,right=1.5em]
%\dontleavehmode\llap{\symbol[leftquotation]}\getinlineuserdata\symbol[rightquotation]
    \symbol[leftquotation]\getinlineuserdata\symbol[rightquotation]
    \doifsomething{\userdataparameter{source}}
{\footnote[\userdataparameter{reference}]{\userdataparameter{source}}}
    \stopnarrow
\stopsetups

\defineuserdataalternative
  [myquote]
  [renderingsetup=userdata:myquote]

\defineuserdata
  [myquote]
  [alternative=myquote]

\showframe

\definefontfeature [default] [default] [protrusion=quality]

\setupalign [hanging]

\starttext

\startuserdata [myquote] [reference={f:9},source={Kaspar Hauser (Kurt 
Tucholsky), Weltbühne 24, 16.\,6.\,1931}]
Im übrigen ist der Mensch ein Lebewesen, das klopft, schlechte Musik 
macht und seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, aber dann 
ist er tot.

\stopuserdata

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


Re: [NTG-context] force index entries without page number

2020-09-04 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 03.09.2020 um 10:17:

Hi,

I’d like to have an (person) index entry like

Ramm, Hraban   passim

i.e. without actual page number.
How can I force that?

I also need to be able to refer to it like
\seeindex{Hraban}{Ramm, Hraban)



You can use this when the entry appears only once which replaces the 
page number with "passim".


\define[1]\Passim
  {passim}

\defineprocessor [passim] [command=\Passim]

\starttext

xxx\index{First}

yyy\index[passim->]{Second}

zzz\seeindex{Third}{Second}

\placeindex

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


Re: [NTG-context] \setupuserpagenumber not working as expected

2020-09-04 Thread Wolfgang Schuster

Jan Willem Flamma schrieb am 03.09.2020 um 10:29:

Dear Julian,

I use something similar using a main product file, an environment file 
that contain the styling and several components that build up the 
frontmatter, the manual and the appendices.


Below my setup where I start the roman numbering on the table of 
contents page (page 5 or v in roman)


Once the bodymatter starts the pagenumber is set  to the arabic 1 (see 
below in the main product file)


You should be able to copy and adapt to your needs.


There are lot of things which can be improved in your example.

1. Pass the filename of the component/product to \startcomponent and not 
some dummy name (or just use *), this allows you to print the filename 
with \currentcomponent or \currentproduct


2. Use \setvariables or \setupdocument to set the document title, 
revision etc.


3. Use \startsectionblockenvironment to move setups from the document 
content into the environment file.


4. Use pagestate=start to increase the page counter with 
\startstandardmakeup.


5. Set search path for figures (\copypages use the figure mechanism) 
with \setupexternalfigure[location=...].


Below is a modified (but untested) version of your sample document.

Wolfgang


 begin product
\startproduct product

\environment env-WA

% \setvariables
%   [document]
%   [ manual={Course Manual},
%  title={Title},
%subtitleone={Subtitle 1},
%subtitletwo={Subtitle 2},
%  revnumber={Revision number}]

\setupdocument
  [ manual={Course Manual},
 title={Title},
   subtitleone={Subtitle 1},
   subtitletwo={Subtitle 2},
 revnumber={Revision number}]

\startfrontmatter

  \component fm-frontpage
  \component fm-titlepage
  \component fm-tableofcontents

\stopfrontmatter

\startbodymatter

  \component co-01
  \component co-02

\stopbodymatter

\startappendices

  \component co-ap-01
  \component co-ap-02

\stopappendices

\startbackmatter

  \copypages[app1.pdf][n=4]

\stopbackmatter

\stopproduct
 end product

 begin environment
\startenvironment env-WA

\setuppagenumbering
  [alternative=doublesided, 

   location=right] 



\defineconversionset
  [frontpart:pagenumber] [] [romannumerals]

\setupexternalfigures
  [directory={External PDF}]

\startsectionblockenvironment [frontpart]

  \setupbackgrounds
[leftpage]
[setups=pagenumber:left]

  \setupbackgrounds
[rightpage]
[setups=pagenumber:right]

\stopsectionblockenvironment

\startsectionblockenvironment [bodypart]

  \setupbackgrounds
[leftpage]
[setups=pagenumber:left]

  \setupbackgrounds
[rightpage]
[setups=pagenumber:right]

  \setuppagenumber
[number=1]

\stopsectionblockenvironment

\startsectionblockenvironment [appendix]

  \setupbackgrounds
[leftpage]
[setups=pagenumber:left]

  \setupbackgrounds
[rightpage]
[setups=pagenumber:right]

\stopsectionblockenvironment

\startsectionblockenvironment [backpart]

  \setuppagenumber[state=stop]

\stopsectionblockenvironment

\stopenvironment
 end environment

 begin component
\startcomponent fm-frontpage

\product product

\startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue]

% \dontleavehmode\externalfigure[frontpage-logo.png][width=12cm]

\framed
  [height=5cm,width=broad,frame=off]
  {\externalfigure[frontpage-logo.png][width=12cm]}

\blank[6*big]

{\bfc \documentvariable{manual}}

\blank[4*big]

{\tfc \documentvariable{title}}

\blank[2*big]

{\tfc \documentvariable{subtitleone}}

\blank[2*big]

{\tfc \documentvariable{subtitletwo}}

\stopstandardmakeup

\stopcomponent
 end component

 begin component
\startcomponent fm-titlepage

\product product

\startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue]

{\tfb \documentvariable{manual}}

\blank[2*big]

{\tfb \documentvariable{title}}

\blank[2*big]

{\tfb \documentvariable{subtitleone}}

\blank[2*big]

{\tfb \documentvariable{subtitletwo}}

\blank[10*big]

{\tfb \documentvariable{revnumber}}

\blank

{\tfb \currentdate[month,year]}

\blank[10*big]

{\tfb Written by:}

\blank

{\tfb Company name}

\blank

{\tfb City, Country}

\stopstandardmakeup

\stopcomponent
 end component

 begin component
\startcomponent fm-tableofcontents

\product product

\starttitle [title=Table of Contents]

\placecontent

\stoptitle

\stopcomponent
 end component
___
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] \setupuserpagenumber not working as expected

2020-09-03 Thread Wolfgang Schuster

jbf schrieb am 03.09.2020 um 06:32:
Thanks Wolfgang. I did have the respective setupsectionblocks, but 
they said [page= ], so I have now changed them to [page=yes] and 
things work as expected. I also tried the second \page method you 
offered, which, naturally enough, also works. I take it there is no 
'purist' preference for either of these solutions?


You can improve the second method with the following setup

\setupsectionblock [frontpart] [after=\page] % after={\page[right]}

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
___


Re: [NTG-context] footnotes missing in heads

2020-09-03 Thread Wolfgang Schuster
Pablo Rodriguez  schrieb am Do., 3. Sept. 2020, 07:51:

> Dear list,
>
> the following minimal sample:
>
> \starttext
> \chapter{Chapter\footnote{Note}}
> \section{Section\footnote{Note}}
> \stoptext
>
> Using current latest (from 2020.09.02 20:37) doesn’t display the footnotes.
>
> I’m afraid this may be a bug. Could anyone confirm this?
>

Does ist work when you add \automigrateinserts?

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
___


Re: [NTG-context] \setupuserpagenumber not working as expected

2020-09-02 Thread Wolfgang Schuster

jbf schrieb am 03.09.2020 um 06:04:
Am seeking to have frontmatter pages in roman numerals and from Chapter 
1 onwards in arabic numerals. I have achieved something of the kind, but 
page 1 (arabic) is appearing on the last page of the frontmatter and not 
the first page of Chapter 1. I do not know why this is happening. My 
setup for page numbering is as follows (something I found somewhere - 
wiki? elsewhere? Not sure. I didn't make it up!):


\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber] [][numbers]
\startsectionblockenvironment[frontpart]
\setupuserpagenumber[numberconversion=romannumerals]
\setuplist[chapter][pageconversionset=pagenumber]
\setuppagenumber[number=1]
\stopsectionblockenvironment

\startsectionblockenvironment[bodypart]
\setuppagenumber[number=1]
\stopsectionblockenvironment

The frontmatter is some 16 pages worth (ends on a verso page but that 
verso carries the arabic number 1 instead of page xvi which it should 
be, since the final paragraph on that page ends with \stopfrontmatter. 
That means Chapter 1 (immediately after \startbodymatter) is now page 2 
instead of page 1!


I tried a slightly simpler version of the above which I found on 
Stackexchange:


|\definestructureconversionset[frontpart:pagenumber][][romannumerals]||
|

|\startsectionblockenvironment[bodypart]|

|\setcounter[userpage][1]\stopsectionblockenvironment|

but it gave me the same result. Any idea how I can get the correct result?


Do you have these settings in your document?

\setupsectionblock [frontpart] [page=]
\setupsectionblock [bodypart]  [page=]

When this is the case change them to

\setupsectionblock [frontpart] [page=yes]
\setupsectionblock [bodypart]  [page=yes]

or add

\page

before \stopfrontmatter.

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
___


Re: [NTG-context] MKIV - LMTX difference: stripping of leading white space in verbatim text

2020-09-02 Thread Wolfgang Schuster

Christoph Reller schrieb am 03.09.2020 um 05:29:

Dear List,

I am using ConTeXt LMTX 2018.05.19 21:46. Consider the following MWE:

\starttext
\startLUA
     whatever
\stopLUA
\stoptext

In contrast to ConTeXt MKIV, the leading four spaces in front of 
"whatever" are not removed when processing the verbatim text:


MKIV output:
whatever

LMTX output:
     whatever

Is there a way to get the old MKIV behavior back?


\setuptyping[LUA][strip=yes]

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
___


Re: [NTG-context] Import a metapost extension

2020-09-01 Thread Wolfgang Schuster

Taco Hoekwater schrieb am 01.09.2020 um 19:12:

Hi,


On 1 Sep 2020, at 16:46, Hans Hagen  wrote:

On 9/1/2020 3:04 PM, Fabrice Couvreur wrote:

Hi Taco,
Thank you for your help. I specify that this extension works perfectly by 
compiling the following file.

A logfile of a failed run would have been more helpful in trying to track down 
the problem. But I did notice that there is a LaTeX file loaded in your 
succesful run. So perhaps the extension depends on LaTeX


I looked for the file online [1] and it uses LaTeX commands (even 
begin/end blocks) for all text boxes.


[1] https://melusine.eu.org/syracuse/poulecl/mp-scratch/

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
___


Re: [NTG-context] Mathematical symbol of non-inclusion

2020-08-29 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 29.08.2020 um 19:27:

Hello,
The result is not what you expected.
How can I correct this problem?


1. Wait for a fix.

2. Use \nsubset.

\starttext
\m{A \nsubset B}
\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
___


Re: [NTG-context] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 27.08.2020 um 19:16:

On 8/27/20 6:16 PM, Wolfgang Schuster wrote:

Pablo Rodriguez schrieb am 27.08.2020 um 17:56:

[...]
\startxmlsetups xml:special
  \startitem
  \cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
 "\\letterpercent")}
  \stopitem
\stopxmlsetups

[...]
and to escape special characters you can use context.escape()

Many thanks for your reply, Wolfgang.

I’m afraid that I need to keep $ in order to get some formulas:

\cldcontext{(string.gsub([[\xmlraw{#1}{.}]],
   '', '$'):gsub("",
   "\\ifmmode $\\fi"))}}

Actually this is way more complex, but I need to catch % and have to
substitution above.


You have to replace %% with \letterpercent\letterpercent because you're 
still playing with TeX rules.


\startxmlsetups xml:special
    \startitem
\cldcontext{string.gsub("\xmlraw{#1}{.}","\letterpercent\letterpercent","\\letterpercent{}")}
    \stopitem
\stopxmlsetups

To avoid these limitations create a new Lua function and call only this 
function in the setup:


\startluacode

moduledata = moduledata or { }

function moduledata.special(str)
    return string.gsub(str,"%%","\\letterpercent{}")
end

\stopluacode

\startxmlsetups xml:special
    \startitem
    \cldcontext{moduledata.special([[\xmlraw{#1}{.}]])}
    \stopitem
\stopxmlsetups

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
___


Re: [NTG-context] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 27.08.2020 um 17:56:

On 8/27/20 5:30 PM, Taco Hoekwater wrote:

[...]
Using Lua gsub(), I need to replace something like:

  string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")


Double it: %%

See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the
mention of %% is a bit hidden.


Many thanks for your replies, Taco and Hans.

I’m afraid this doesn’t work (and I need \xmlraw there):

   \startbuffer[demo]
   

  
  The % best paragraph.
  

   
   \stopbuffer

   \startxmlsetups xml:initialize
 \xmlsetsetup{#1}{html}{xml:gen}
   \stopxmlsetups

   \xmlregistersetup{xml:initialize}

   \startxmlsetups xml:gen
 \startitemize
 \xmlfilter{#1}{/**/span[@class='special']/command(xml:special)}
 \stopitemize
   \stopxmlsetups

   \startxmlsetups xml:special
 \startitem
 \cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
"\\letterpercent")}
 \stopitem
   \stopxmlsetups



This works fine with your example

\startxmlsetups xml:special
\startitem
\xmlflush{#1}
\stopitem
\stopxmlsetups

and to escape special characters you can use context.escape()

\startxmlsetups xml:special
\startitem
\cldcontext{context.escape([[\xmlraw{#1}{.}]])}
\stopitem
\stopxmlsetups

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
___


Re: [NTG-context] setuplayout vs Indesign!

2020-08-27 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 26.08.2020 um 19:39:

On 8/26/20 12:13 PM, jbf wrote:

[...]
Maybe, one of these days, someone with experience in both ConTeXt and
InDesign (since InDesign is used by very many commercial publishers, but
I am trying to convince one of them of the value of ConTeXt) could offer
a comparison of the layout terminology/measurements/requirements for
both. I for one would find that very helpful.

Hi Julian,

https://wiki.contextgarden.net/Layout#Typesetting_areas contains a
graphical description of the areas and


I don't think the graphic is very useful to recreate a layout because 
there are

too many areas which are unimportant for the margins on each side.

A simpler step by step introduction where you can see leftmargin
doesn't matter for the layout is the better way (see attachment).

Wolfgang



layout.pdf
Description: Adobe PDF document
___
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] odd behaviour with \definefontfamily

2020-08-25 Thread Wolfgang Schuster

jbf schrieb am 26.08.2020 um 05:42:

MWE as follows:

\definefontfamily [mainface] [rm] [baskervaldadfstd] 
[tf=file:BaskervaldADFStd.otf]
\definefontfamily [mainface] [ss] [librisadfstd] 
[tf=file:LibrisADFStd-Regular.otf]

\definefontfamily [mainface] [mm] [TeX Gyre Pagella Math]

\setupbodyfont[mainface]

\starttext
\tf ffi,

\it ffi,

\bf ffi,

\bi ffi.

\ss THIS IS A TITLE IN SANS SERIF

\tt Monospaced

\stoptext

Context then tells me that:

/mkiv lua stats  > loaded fonts: 6 files: baskervaldadfstd-bold.otf, 
baskervaldadfstd-bolditalic.otf, baskervaldadfstd-italic.otf, 
baskervaldadfstd.otf, librisadfstd-bolditalic.otf, texgyrepagella-math.otf/


So, in this instance, and as you explained would be the case, it is 
loading the sans serif family (Libris) but I note that it is not giving 
me what I asked for, which was /LibrisADFStd-Regular.otf/. Instead it 
has given me /LibrisADFStd-BoldItalic.otf/


And I deliberately did not include any maths, or itemize or anything 
that might involve those symbols, thinking it would not then load the 
Pagella Maths file, but it did. So my two questions now are


1. Why is it loading Libris BoldItalic and not Regular as asked for?


You used \bi before you switched to the sans serif font and the style is 
still active. To prevent this problem add around around style changes, 
e.g. {\bi ...}.



2. If I am not using Maths so far, why is it loading the Pagella math file?


ConTeXt checks the math font when you change the font with 
\setupbodyfont and at this point the math font gets loaded.


You can prevent the loading of the math font with \textonly but you 
should use this only when you're 100% sure you never use math in your 
document. As Aditya already ConTeXt can use math for itemize symbols 
(which isn't the default behavior anymore) and it's better to keep math 
to avoid problems.


%% begin example
\textonly

\starttext
\unknown
\stoptext
%% end example

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
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 24.08.2020 um 19:37:

Am 24.08.2020 um 17:36 schrieb Wolfgang Schuster 
:

Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:

Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :

I think there was a question on this very recently but I don;t think it got an 
answer and I can't find it to reply to, so apologies for the extra noise. I 
have a large text with floats numbered sequentially by chapter and then 
figure/table number, but at the last minute I've had a request for two figures 
in a particular chapter to become 27.1a and 27.1b instead of 27.1 and 27.2. 
It's not a combination - they are separate figures on different pages.

I've experimented with the options I can see, but it's not obvious if there is 
a facility to override the numbering of two figures in a stream of normally 
numbered figures like this. I was thinking of the equivalent of the old 
\sym{symbol} command that used to work as a way to override a single item in an 
otherwise sequential list.

I guess there's a brute force method of setting up a new type of figure with the label 
"Figure 27.1" and having them numbered as lowercase alpha, but if there's an 
easier way that would be great.

I’m also interested in overriding automatical numbering, e.g. of chapters or 
itemization items.
E.g. in my songbook, I’d like to have the verses numbered but interrupted by a chorus numbered as 
"C" (i.e. "R" in German).
Similarly the paragraphs of some (by)laws that were changed a lot and use a 
numbering like 1, 2, 3, 3a, 4, 7...
Something like
\startitem[number={R}]
or
\startsection[number={3a}]
would be nice.
If I set it to an integer, ConTeXt should set the counter accordingly, 
otherwise continue counting from the previous calculated number. Would that be 
possible?


You can set your own section numbers but the counter isn't stopped.

Thank you! I overlooked "ownnumber". It works for sections, but not for items 
or floats.

\setnumber[section][10] doesn’t work, \setcounter the same (according to the 
source they’re synonymous) – does section use a different counter name or is it 
no counter at all?

\setnumber[figure][10] works (but only with integers, not some alphanumerical 
stuff, sorry Duncan).


\setupnumber is a synonym of \setupcounter and exists for backwards 
compatibility.



Hraban


\useMPlibrary[dum]

\starttext

\startsection[title=One]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\startsection[title=Two]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[figure][5] % next figure is no.6

\startsection[ownnumber=10,title=???] % ownnumber doesn’t work
\startplacefigure[title=Test,ownnumber=10]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[section][5] % doesn’t work


\setupheadnumber[section][5]


\startsection[title=Three]
\startitemize[n]
   \item one
   \item two
   \item three
   \startitem[ownnumber=9] five\stopitem  % ownnumber doesn’t work



\starttext
\startitemize
\txt{I.} \unknown
\sym{7.} \unknown
\stopitemize
\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
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:




Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :

I think there was a question on this very recently but I don;t think it got an 
answer and I can't find it to reply to, so apologies for the extra noise. I 
have a large text with floats numbered sequentially by chapter and then 
figure/table number, but at the last minute I've had a request for two figures 
in a particular chapter to become 27.1a and 27.1b instead of 27.1 and 27.2. 
It's not a combination - they are separate figures on different pages.

I've experimented with the options I can see, but it's not obvious if there is 
a facility to override the numbering of two figures in a stream of normally 
numbered figures like this. I was thinking of the equivalent of the old 
\sym{symbol} command that used to work as a way to override a single item in an 
otherwise sequential list.

I guess there's a brute force method of setting up a new type of figure with the label 
"Figure 27.1" and having them numbered as lowercase alpha, but if there's an 
easier way that would be great.


I’m also interested in overriding automatical numbering, e.g. of chapters or 
itemization items.

E.g. in my songbook, I’d like to have the verses numbered but interrupted by a chorus numbered as 
"C" (i.e. "R" in German).
Similarly the paragraphs of some (by)laws that were changed a lot and use a 
numbering like 1, 2, 3, 3a, 4, 7...

Something like
\startitem[number={R}]
or
\startsection[number={3a}]
would be nice.
If I set it to an integer, ConTeXt should set the counter accordingly, 
otherwise continue counting from the previous calculated number. Would that be 
possible?



You can set your own section numbers but the counter isn't stopped.

\starttext

\startsection[title=One]
\stopsection

\startsection[title=Two]
\stopsection

\startsection[ownnumber=X,title=???]
\stopsection

\startsection[title=Three]
\stopsection

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


Re: [NTG-context] Label to delete in the table of contents

2020-08-24 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 24.08.2020 um 15:32:

Hi Wolfgang,
Thank you for your reply. Probably my fault but now I get the number 0 
on the word "Summary".

Fabrice
contents.png


\setuphead
  [title]
  [command=,
   numbercommand=]

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
___


Re: [NTG-context] Label to delete in the table of contents

2020-08-24 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 23.08.2020 um 16:02:

Hello,
For the title of the chapters I use the following command.

\unexpanded\def\HeadTitle#1#2%
   {\framed
[frame=off,
       width=fit,
       align=flushleft]
 {\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
\blank#1\blank#2}

When I compile my project, I have the label "Chapitre" above the word 
"Sommaire" in the table of contents : how to delete it ?


1. Don't apply the command to \title

\setuphead[title][command=]


2. Make the command local to bodypart of your document, this works only 
when you use section blocks (e.g. \startbodymatter)


\startsectionblockenvironment[bodypart]
    \setuphead[chapter][command=\HeadTitle]
\stopsectionblockenvironment


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
___


Re: [NTG-context] Chapter numbering after \part

2020-08-20 Thread Wolfgang Schuster

jbf schrieb am 21.08.2020 um 04:27:
By default, chapter numbers coming after \part are numbered 1.1... 
2.1... and so on. But in my case I need them to still be simply 1,2... 
for each part. Is there a way I can get this numbering to occur? I 
thought I could do it using ownnumber=, but that doesn't work. Then I 
tried a makeup, because I thought that would create a 'Part' page 
independent of chapter numbers - but that doesn't work either:-).  Am 
sure it is achievable, however


\setuphead
  [chapter]
  [sectionsegmments=chapter]

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
___


Re: [NTG-context] [BUG] \registerexternalfigure doesn't work

2020-08-20 Thread Wolfgang Schuster

Henri Menke schrieb am 20.08.2020 um 07:05:

Dear list,

To get properties of a figure without actually typesetting it, it is
handy to use \registerexternalfigure.  However, trying to use it fails.
Consider the following MWE:

 \starttext
 \registerexternalfigure[cow.pdf]
 \stoptext


Wrong command, use \getfiguredimensions[...]


Looking at the definition in grph-inc.mkiv reveals that is it complete
bogus.


Is this necessary?

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
___


Re: [NTG-context] TOC chapter and section numbering

2020-08-19 Thread Wolfgang Schuster

Adrian schrieb am 18.08.2020 um 06:40:

Hello,

I'm attempting to typeset a short book using ConTeXt 
(current version: 2020.08.09 22:03).


*EXAMPLE*:

[...]

I would like all the chapters to be prefixed with "Chapter RN." and the 
sections to keep a single count,

for example:

*Chapter I. Introductory .*
    1. The concept of a function
    2. Extension and intension
    3. Functions of several variables
    4. Abstraction
*Chapter II. Lambda Conversion .*
    5. Primitive symbols and formulas
    6. Conversion
    7. Fundamental theorems on well-formed formulas and on the normal form

I tried to the following for the chapters:

\defineconversion[church][Chapter \Romannumerals.\quad]
\setuphead[chapter][conversion=church]

Which appeared to generate the prefix correctly but it overlapped the 
title.


\setuplabeltext
  [en] [chapter=Chapter ]

\defineresetset
  [default] [0,0,0] [1]

\defineconversionset
  [section] [n,R,n] [n]

\setuphead
  [chapter]
  [sectionconversionset=section,
   sectionstopper=.]

\setuphead
  [section]
  [sectionsegments=section,
   sectionconversionset=section,
   sectionstopper=.]

\setuphead
  [title]
  [alternative=middle,
   style=WORD]

\setuplist
  [chapter]
  [label=yes,
   style=bold,
   width=fit,
   distance=\spaceamount]

\setuplist
  [section]
  [margin=3em,
   width=1.5em]

\starttext

\completecontent

...

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


Re: [NTG-context] Chapter number with Luametafun

2020-08-18 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 18.08.2020 um 16:24:

Hello,
How to get the number of the current chapter ?


\namedheadnumber{chapter}


How to get the label "Chapitre" ?


\labeltext{chapter}

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
___


Re: [NTG-context] About documented code

2020-08-16 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 15.08.2020 um 16:24:
Hi list! I have some questions about the template used by module 
documentation. When I apply


context --extra=module t-mymodule.mkvi --autopdf

I obtain a nice file, but, among other things, 1) the cover page seems 
to be a bit... greenish? So I want to know how to customize it, at 
least at a minimum, and 2) \showframe is enabled by default. How to 
disable it? Maybe 1) can answer 2) too. Thank you very much.


There is no way to change the color of the title page from your module 
itself, the only way is to change the value module (s-module-basic.mkiv) 
which is used to create the formatted source.


The same has to be done to disable the frame where you have to comment 
the \showframe line in the module mentioned above.


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
___


Re: [NTG-context] Embedding fonts from a file

2020-08-14 Thread Wolfgang Schuster

Krešimir Cindrić schrieb am 14.08.2020 um 14:28:

Hello,

About a year ago, I asked on this list how to embed OpenType fonts from 
files (that is, use fonts that are not installed on the system), because 
one of my projects needed portability (be entirely contained in one 
directory that I could share). I was given a great answer by Hans and 
this minimal example

```
\starttext

     % \ctxlua{fonts.names.addruntimepath("./myfonts")}
      \ctxlua{os.setenv("RUNTIMEFONTS","./myfonts")}

      Hello World!

      \definefont[myfont][file:myfont.otf]

      {\myfont Hello World!}

\stoptext
```
This worked beautifully (with some caveats, like having to clear the 
cache regularly), but for some reason, it stopped working. I don't know 
exactly when, because I haven't compiled that project in months, and in 
the meantime I reinstalled Linux. But now, all embedded fonts are not 
loading and I get "'fallback modern-designsize rm 12pt' is loaded" as an 
error message.


Any assistance would be appreciated.



\usefontpath[myfont]

\starttext

Hello \CONTEXT!

{\definedfont[file:myfont*default]Hello \CONTEXT!}

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


Re: [NTG-context] compilation error in LMTX

2020-08-14 Thread Wolfgang Schuster

Jannik Voges schrieb am 14.08.2020 um 11:29:

Hello Hans,

I get the error with the newest upload too.


You have to provide a minimal example which produces the error.

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
___


Re: [NTG-context] headers again

2020-08-14 Thread Wolfgang Schuster

jbf schrieb am 14.08.2020 um 02:28:


I will let the people with far superior knowledge than I have work 
through this, but I am following it with interest. All I can say is 
that by adopting Aditya's solution, ensuring that for the unnumbered 
titles I also included 'number=no', the numbered chapters did 
increment correctly, after being interrupted by an unnumbered one.





\starttext

\startchapter[title={Chapter one}] \stopchapter

\startchapter[title={Chapter two},number=no] \stopchapter

\startchapter[title={Chapter three}] \stopchapter

\startchapter[title={Chapter four},number=no] \stopchapter

\startchapter[title={Chapter five}] \stopchapter

\startchapter[title={Chapter six},number=no] \stopchapter

\startchapter[title={Chapter seven}] \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
___


Re: [NTG-context] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Wolfgang Schuster schrieb am 13.08.2020 um 20:47:

Pablo Rodriguez schrieb am 13.08.2020 um 20:30:

On 8/13/20 6:06 PM, Wolfgang Schuster wrote:

[...]
What am I doing wrong here? (To avoid an error, I get other errors.)


There are not enough information to help you.


I discovered what was wrong: I had an xtable on the footer to set the
page numbering.

So I replaced it with the following tabulation:

\starttabulate
 [|lw(.22\textwidth)|
   cw(.24\textwidth)|
   cw(.08\textwidth)|
   cw(.24\textwidth)|
   rw(.22\textwidth)|]
 [unit=0pt]
\NC\pinter\NC\latint\NC\pcentr\NC\latext\NC\pexter\NC\NR
\stoptabulate


You can use nested frames:

\startsetups[...]
     \startframed[offset=overlay,frame=off]
     \framed[width=.22\textiwdth]{\pinter}
     \framed[width=.24\textiwdth]{\latint}
     \framed[width=.08\textiwdth]{\pcentr}
     \framed[width=.24\textiwdth]{\latext}
     \framed[width=.22\textiwdth]{\pexter}
     \stopframed
\stopsetups


To get the correct width with column change \textwidth
to \makeupwidth or just use \hsize which is the width
of the footer.

\startsetups[...]
\startframed[offset=overlay,frame=off]
\framed[width=.22\hsize]{...}
\framed[width=.24\hsize]{...}
\framed[width=.08\hsize]{...}
\framed[width=.24\hsize]{...}
\framed[width=.22\hsize]{...}
\stopframed
\stopsetups

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
___


Re: [NTG-context] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.08.2020 um 20:30:

On 8/13/20 6:06 PM, Wolfgang Schuster wrote:

[...]
What am I doing wrong here? (To avoid an error, I get other errors.)


There are not enough information to help you.


I discovered what was wrong: I had an xtable on the footer to set the
page numbering.

So I replaced it with the following tabulation:

\starttabulate
 [|lw(.22\textwidth)|
   cw(.24\textwidth)|
   cw(.08\textwidth)|
   cw(.24\textwidth)|
   rw(.22\textwidth)|]
 [unit=0pt]
\NC\pinter\NC\latint\NC\pcentr\NC\latext\NC\pexter\NC\NR
\stoptabulate


You can use nested frames:

\startsetups[...]
\startframed[offset=overlay,frame=off]
\framed[width=.22\textiwdth]{\pinter}
\framed[width=.24\textiwdth]{\latint}
\framed[width=.08\textiwdth]{\pcentr}
\framed[width=.24\textiwdth]{\latext}
\framed[width=.22\textiwdth]{\pexter}
\stopframed
\stopsetups

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
___


Re: [NTG-context] headers again

2020-08-13 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 13.08.2020 um 04:53:

On Thu, 13 Aug 2020, jbf wrote:


Where running heads (headers) are concerned, if I use \chapter I have no
problems, nor should I expect any. But because I am also using \title,
given that I need some unnumbered chapters interspersed  among them, I
run into difficulties with headers. Numbered chapters have the correct
headers, unnumbered ones (with \title) either don't have them, or do not
have the proper chapter header (they pick up the header from the
previous numbered chapter).

At the moment the only thing I have in the preamble is the expected set
of commands for the numbered chapters:

   [{\hfill\getmarking[chapter]\hfill}][]
    [{\hfill\documentvariable{metadata:title}\hfill}][]

I thought that might work for the unnumbered ones (\title), thinking
that maybe \title inherits from \chapter, but it doesn't. But no amount
of variations on the above commands (repeating them but replacing
'chapter' with 'title'; adding [title] or just title, in the first set
of commands in various positions...) gives me the correct result.

I am assuming, of course, that there is a solution to this difficulty,
and that it may be simple. But I haven't found it. Is the problem that I
am using \title in the main body to get my unnumbered chapters? I
wouldn't think so? It produces the correct result, utlimatley, in the
TOC, Is it possible that I may have something else in my preamble that
is causing the problem? If so, I can't expect someone to 'guess' that
from outside! But at the moment I don't think that is the problem.

If not a direct solution, are there any clues someone might give me that
will lead me to finding my own solution? It would be much appreciated.


A rose by any other name would smell as sweet ...

\showframe
\setupheadertexts[\setups{header}]

\startsetups header
   \getmarking[chapter]
\stopsetups

\starttext
\startchapter[title={This is a chapter}]
   \input knuth
   \page
   \input knuth
\stopchapter

\startchapter[title={This is a title}, number=no]
   \input ward
   \page
   \input knuth
\stopchapter
\stoptext


Don't do this, unnumbered chapter still increase the counter and
when you add another chapter afterwards you wonder why the number
is wrong. The correct way here is to reset the marking entries
at the begin of a new chapter or title with

\setuphead
  [chapter,title]
  [marking=reset]

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
___


Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-13 Thread Wolfgang Schuster

Nicola schrieb am 13.08.2020 um 18:06:

Thanks. That works with my MWE, but in my document I actually have
a chapter, and chapters start on the right page, even if I add page=no
to \setuppagenumbering:


Can you start a new thread when you have a new question. When other
people have the same problem they can see on the subject if this is
the right thread to find a solution for it.


 \setuppagenumbering[alternative=doublesided,page=no]


The page key in \setuppagenumbering is used to add the final page
in a doublesided document to have a even number of pages.


 \definemakeup[ToC][align=middle,pagestate=start,doublesided=no]
 \starttext
 \startfrontmatter
   \startmakeup[ToC]
 \placecontent
   \stopmakeup
   \chapter{Preface}
 \stopfrontmatter
 \startbodymatter
   \dorecurse{10}{\chapter{Foo}}
 \stopbodymatter
 \stoptext

I have no idea how to allow chapters to start at arbitrary pages when
alternative=doublesided.


\setuphead[chapter][page=yes]

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
___


Re: [NTG-context] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 13.08.2020 um 16:18:

On 8/13/20 3:11 PM, Wolfgang Schuster wrote:

[...]
With the options "split=no" and "split=repeat" ConTeXt puts the table in
a \vbox but with "split=yes" this doesn't happen.

To check is this is the problem he can put the table in a float
environment and disable the caption and counter.

\startplacetable[location={force,none}]
    \startembeddedxtable
    ...
    \stopembeddedxtable
\stopplacetable

Many thanks for your reply, Wolfgang.

These are my defaults for tables in the document:

   \setupxtable
 [frame=off,
  option=stretch,
  split=repeat,
  header=repeat]

The following avoids the reported break, but it doesn’t split the table:

\startxmlsetups xml:table:split
 \blank
 \startplacetable[location={force,none}]
 \startembeddedxtable[split=yes]
 \xmlflush{#1}
 \stopembeddedxtable
 \stopplacetable
 \blank
\stopxmlsetups

If I add "split" to \startplacetable, I get the same \prevdepth error in
the second run.

What am I doing wrong here? (To avoid an error, I get other errors.)


There are not enough information to help you.

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
___


Re: [NTG-context] weird issue with xtable

2020-08-13 Thread Wolfgang Schuster

Taco Hoekwater schrieb am 13.08.2020 um 14:33:

On 13 Aug 2020, at 14:15, Pablo Rodriguez  wrote:


My questions are: what is the restricted horizontal mode (as different
from the horizontal mode)?

I forgot to answer this. Simple explanation:

* 'restricted horizontal mode' is inside an \hbox{} or something similar like a 
header/footer,
   where line breaks are forbidden
* ‘horizontal mode’ is inside a paragraph, where line breaks are possible

But the ‘restricted’ part is not relevant to your problem, \prevdepth is 
forbidden in horizontal mode  regardless of restrictions; it is only allowed in 
vertical mode.


Somehow your table ends up being typeset in a horizontal context, based on the 
error message (at least, if we assume that the error message was triggered by a 
table).

But why that is? I do not have any other good ideas. And unfortunately lots of 
different things in ConTeXt can trigger an implicit horizontal context.


With the options "split=no" and "split=repeat" ConTeXt puts the table in 
a \vbox but with "split=yes" this doesn't happen.


To check is this is the problem he can put the table in a float 
environment and disable the caption and counter.


\startplacetable[location={force,none}]
  \startembeddedxtable
  ...
  \stopembeddedxtable
\stopplacetable

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
___


Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-11 Thread Wolfgang Schuster

Nicola schrieb am 11.08.2020 um 22:21:

On 2020-08-11, Pablo Rodriguez  wrote:

On 8/11/20 9:24 PM, Nicola wrote:

Thank Pablo, Wolfgang,
I have learned more by reading your replies than by myself in the rest
of the afternoon.


Hi Nicola,

if you found replies useful, please update the wiki (this may help others).


Just one more thing:
[...]
I'd prefer all the titles to be aligned:

  Preface
I XYZ
   ...
VIII XYZ
   ...

I have tried to do my homework by playing with \setuphead, but I am
afraid I need your help on this.


Sorry, but too tired to type a sample.

How about setting distance for \setuplist[chapter] in the sectionblock
frontpart with the desired width?


That does not seem to change the layout, unfortunately. I have tried
with `margin` and `aligntitle` as well:

\setuplist[chapter][distance=1cm,aligntitle=yes]
\startsectionblockenvironment[frontpart]
\setuplist[chapter][aligntitle=yes,margin=2cm,distance=2cm]
\stopsectionblockenvironment

I'll take a fresh look tomorrow.


When you a unnumbered section with the list alternatives a-c your're out 
of luck with the regular \setuplist options because it always use a 
width of 0pt for regular section number. The aligntitle works only for 
numbered entries to align them when you disable the number entry in the TOC.


To show the section entry and align all entries on the same line you can 
use the following method:


  1. Set the width and distance for the section number to 0pt.

  2. Set the margin key to a value large enough to fit all numbers

  3. Apply a command to the numbercommand key where you shift the 
number to the left in the margin area you set in the previous step


 begin example
\define[1]\ChapterListNumbercommand
  {\offset[x=-1cm,width=0pt]{\simplealignedbox{1cm}{flushleft}{#1}}}

\setuplist
  [chapter]
  [distance=0cm,
   width=0cm,
   margin=1cm,
   numbercommand=\ChapterListNumbercommand]

\starttext

\startfrontmatter
  \completecontent
  \chapter{Preface}
\stopfrontmatter

\startbodymatter
  \chapter{Introduction}
  \chapter{Workflow}
  \chapter{Input}
  \chapter{Output}
\stopbodymatter

\startbackmatter
  \chapter{Index}
\stopbackmatter

\stoptext
 end example

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
___


Re: [NTG-context] Help on tweaking alignment, page numbers and ToC

2020-08-11 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 11.08.2020 um 14:53:

On 8/11/20 1:32 PM, Nicola wrote:

Hi,
first of all, let me say *thank you* for the vast improvements on
ConTeXt Garden! Browsing the documentation and finding stuff is so
much easier and pleasant than it used to be (also the site seems
faster).


Hi Nicola,

Garulfo invested a lot of time and effort in the new wiki layout and
contents.

Taco is always improving the software that runs the wiki (and the source).

Many thanks to them and to all other developers.


Thanks to the docs, dropcaps and protrusion have no secrets for me,
but I am still struggling with some basic tasks (see the document
below):

0. Push text to the bottom of the text area (see copyright).


Well, \setupalignment tweaks position in line (I’d rather say). Bottom
isn’t an option there.

Adding \null\vfill before the alignment does the job.



I think a makeup environment fits here better.

\definemakeup
  [copyright]
  [page=yes,
   pagestate=start,
   doublesided=no,
   align=flushright,
   bottom=]

\startmakeup[copyright]
Copyright © 2020 Author
\stopmakeup



1. Increase the space between Roman numbers and titles in the ToC.


distance with dimension is the key in \setuplist.



Correct but it's also important to set "width" to a value which is large 
enough to fit the number.




2. Vertically center the ToC (wrt to the text area).


Use a makeup for the TOC (if and only if it takes a single page).


3. Suppress page numbers and headers in all blank pages.


Break pages with \page[yes, blank].



Not the best solution for empty pages before a new chapter.

\setuphead
  [chapter]
  [page={yes,header,footer,right}]



4. Suppress headers in the front matter.


This would be my educated guess:

   \startsectionblockenvironment[frontpart]
  \setupheader[state=stop]
   \stopsectionblockenvironment


5. Style and position page numbers differently in the front and body
matter (e.g., centered only in the front matter).


Alignment only (style comes with the proper option ):

   \setuppagenumbering[location={bottom, inmargin}]

   \startsectionblockenvironment[frontpart]
 \setuppagenumbering[location={bottom, centered}]
   \stopsectionblockenvironment


As my full document uses environments, I would like most setups to
be in the environment, if possible. E.g., is it possible to replace

 \setuphead[chapter][after={}]

(see below) with an environment setup that applies only to the ToC?


Either you create and set up a \chapter command for the TOC (such as
\chapterTOC) to use it only once, or you create a sectionblock that you
apply only for the TOC (and define the chapter settings for that
sectionblock).

I never used environments (other than the ones to typeset XML sources),
so this is my best option .


A environment is nothing more than a external file for the style, the 
only difference between \input{...} and \environment[...] is that 
ConTeXt loads environment files only once.


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
___


Re: [NTG-context] custom header/footer for 1st/other pages of section

2020-08-11 Thread Wolfgang Schuster

Mike Cooper schrieb am 11.08.2020 um 19:20:




-Original Message-
From: Wolfgang Schuster [mailto:wolfgang.schuster.li...@gmail.com]
Sent: Tuesday, August 11, 2020 10:07 AM
To: mailing list for ConTeXt users
Cc: Mike Cooper
Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section


Mike Cooper schrieb am 10.08.2020 um 23:40:



Thank you Wolfgang!

I tried to change your code from chapters to sections (since that's what I was

already using) but it didn't work.  So, I switched my sections to chapters and 
it
works great!  But it also caused me to run into other things I'd set up 
manually that
I'm having to figure out---good way to learn!  Haha!

You can only set header or footer settings when the section starts on a
new page. Permitting these two values for every section without this
restrictions can lead to problems because there can be cases where you
have different section levels on the same page and the setting from the
last command on the page counts.


That makes sense.  I wasn't really thinking of my sections as "chapters" per se.  
And I was forcing sections (each >5 pages) to start on new (odd) pages.  But switching to 
chapters is fine and takes care of some other stuff I was forcing.



You don't have to use \chapter as first level section which starts on a 
new page, you can do the same with \section when you use


  \setuphead
[section]
[page={yes,odd}]



One thing I *CANNOT* figure out:  I've been using \doifoddpageelse to put in a

blank/empty page at the end of a section (if needed) so that new sections always
start on an odd page.  This is still working with the change to chapters from
sections, EXCEPT for the first chapter (after TOC)!  Totally stuck with that 
one...

Let me guess you divide your document into section blocks (frontmatter,
bodymatter etc.).

When this is the case you have to first disable the page setting for
these blocks because they interfere with the header/footer setting. To
disable the page breaks add

\setupsectionblock
  [frontpart,bodypart]
  [page=no]

to your document setups.


How does this interact with \startsectionblockenvrironment?  I found this on 
wiki.contextgarden.net/Table_of_Contents for suppressing header/footer on TOC.  
I did not specify frontmatter before, but moving the header/footer content into 
the environment file messed up my formerly clean TOC page.  :-)   So, I've 
currently got:

\startsectionblockenvironment[frontpart]
   \setupheader[state=none]
   \setupfooter[state=none]
\stopsectionblockenvironment

Do I keep this and also include your code above?  Or can both things be taken 
care of together somehow?



Both a different setups for different purposes.


In my setup I tell ConTeXt not to force a page break when it encounters 
\startfrontmatter or \stopfrontmatter because I insert the break with 
\chapter.



With the sectionblockenvironment-environment you can set a list of 
settings which are inserted at the start of block, i.e. your settings 
above do the same as


  \startfrontmatter

  \setupheader[...]
  \setupfooter[...]

  ...

  \stopfrontmatter

where I added the setting to the start of the block. The advantage of 
\startsectionblockenvironment is that you have separated the layout from 
the content.


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
___


Re: [NTG-context] custom header/footer for 1st/other pages of section

2020-08-11 Thread Wolfgang Schuster

Mike Cooper schrieb am 11.08.2020 um 19:01:




-Original Message-
From: ntg-context [mailto:ntg-context-boun...@ntg.nl] On Behalf Of Henning
Hraban Ramm
Sent: Tuesday, August 11, 2020 12:37 AM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section


One thing I *CANNOT* figure out:  I've been using \doifoddpageelse to put in a

blank/empty page at the end of a section (if needed) so that new sections always
start on an odd page.  This is still working with the change to chapters from
sections, EXCEPT for the first chapter (after TOC)!  Totally stuck with that 
one...

Ehm... Why don’t you just use \setuphead[section][page=right] ?

Hraban



Haha!  Well...  because I never found that approach in my searching.

But now, I'm not using it because it doesn't work for me.  I was in the middle 
of guessing I needed to set up doublesided or some such in order for it to work 
when Wolfgang's other solution came in.


When you use "page=left" or "page=right" you need a doublesided document 
but for a singlesided document you can use "page=even" or "page=odd".



There is also another layout method which combines both. The layout is 
taken from a singlesided document which means the left and right margins 
are the same on odd and even page but checks for left or right pages 
work like in a doublesided document.


You can test this with the example below when you uncomment the second 
and third pagenumbering setup-


\setuppagenumbering
  [alternative={singlesided,doublesided}]

%\setuppagenumbering
%  [alternative=singlesided]

%\setuppagenumbering
%  [alternative=doublesided]

\setuphead
  [chapter]
  [page=right]

\showframe

\starttext

\dorecurse{3}
  {\expanded{\chapter{Chapter \recurselevel}}
   \dorecurse{4}{\samplefile{weisman}}}

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


Re: [NTG-context] custom header/footer for 1st/other pages of section

2020-08-11 Thread Wolfgang Schuster


Mike Cooper schrieb am 10.08.2020 um 23:40:




-Original Message-
From: ntg-context [mailto:ntg-context-boun...@ntg.nl] On Behalf Of Wolfgang
Schuster
Sent: Thursday, August 06, 2020 2:58 PM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section

Mike Cooper schrieb am 06.08.2020 um 17:15:

Hola,

I imagine this is probably simple but I can’t find it…

I want the first page only of each section to have particular content in
header/footer, then all the following pages to different specific
content.Right now, I am manually entering it in each section.I’m hoping
there’s a way to automate this; put it into the environment file for all
sections.


Of course you can set different header/footer layouts for chapter pages.

With  \setupheadertexts and \setupfootertexts you set first the text
which should appear on regular pages.

To have a different text on a chapter page you can use the \definetext
command to set them (third first argument is the name of the setup and
the second argument the location). These setups than can applied to the
chapter with the header and footer key in \setuphead.

 begin example
\setupheadertexts
[Page \userpagenumber\ of \lastuserpagenumber]

\definetext
[chapterheader] % name
[header] % vertical position
[This is a chapter page] % content

\definetext
[chapterfooter]
[footer]
[pagenumber]

\setuphead
[chapter]
[header=chapterheader,
 footer=chapterfooter]

\starttext

\dorecurse{10}
{\expanded{\chapter{Chapter \recurselevel}}
 \dorecurse{\numexpr2*\recurselevel\relax}{\samplefile{knuth}}}

\stoptext
 end example

Wolfgang



Thank you Wolfgang!

I tried to change your code from chapters to sections (since that's what I was 
already using) but it didn't work.  So, I switched my sections to chapters and 
it works great!  But it also caused me to run into other things I'd set up 
manually that I'm having to figure out---good way to learn!  Haha!


You can only set header or footer settings when the section starts on a 
new page. Permitting these two values for every section without this 
restrictions can lead to problems because there can be cases where you 
have different section levels on the same page and the setting from the 
last command on the page counts.



One thing I *CANNOT* figure out:  I've been using \doifoddpageelse to put in a 
blank/empty page at the end of a section (if needed) so that new sections 
always start on an odd page.  This is still working with the change to chapters 
from sections, EXCEPT for the first chapter (after TOC)!  Totally stuck with 
that one...


Let me guess you divide your document into section blocks (frontmatter, 
bodymatter etc.).


When this is the case you have to first disable the page setting for 
these blocks because they interfere with the header/footer setting. To 
disable the page breaks add


  \setupsectionblock
[frontpart,bodypart]
[page=no]

to your document setups.

No you can change the settings for the page break at the begin of each 
chapter to


  \setuphead
[chapter]
[page={yes,header,footer,right}]

which

  1. Finishes the last page of the previous chapter
  2. Disables the header and footer for the next (empty) page
  3. Adds a empty page when necessary to start the new chapter on a 
right page


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
___


Re: [NTG-context] How to set pdfminorversion in LMTX?

2020-08-10 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 10.08.2020 um 09:11:

On Mon, 10 Aug 2020, Henri Menke wrote:


On 10/08/20, 01:20, Aditya Mahajan wrote:

Hi,

How do I set pdfminorversion in LTMX. Both \pdfminorversion and 
\pdfvariable minorversion fail with undefined control sequence.


Does lpdf.setversion(major, minor) work in LMTX?


It does not give an error, but it doesn't change the minor version 
either.


1. A better solution for this is to add a key to \setupbackend.

2. It doesn't work because when you set the version it's too late 
because ConTeXt already wrote the PDF header (the relevant code is in 
lpdf-lmt.lmt).


This is a problem because when you set a PDF format the version entry is 
ignored in the header (but it's correct in catalogue entry).



%% begin example
\setupbackend[format=PDF/X-1a:2003]

\starttext
Hello TeX.
\stoptext
%% end example

%% begin pdf file (snippet from the example above, compare the version 
numbers)

%PDF-1.7
%ÃÏÎÔÅØÔÐÄÆ
...
<< /Lang (en) /Metadata 7 0 R /PageLabels << /Nums [ 0 << /S /D /St 1 >> 
] >> /PageMode /UseNone /Pages 15 0 R /Type /Catalog /Version /1.4.0 >>

...
%% end pdf file

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
___


Re: [NTG-context] Using \applytosplitstringwordspaced and allies

2020-08-09 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 08.08.2020 um 16:31:

Thank you very much! Something else happens:

\applytosplitstringwordspaced\somemacro{Content and {\tt typewriter} 
more content}


either ignores braced groups or ignores macros AND prints braces "{" 
and "}" as if it were in verbatim mode depending on the content being 
on the document or loaded via Lua, even when context.escape is used. 
How to keep {\it braced content}? Thank you in advance.


Are you trying to typeset interlinear text?

http://mirrors.ctan.org/macros/generic/expex/expex-doc.pdf

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
___


Re: [NTG-context] floats side by side

2020-08-08 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 08.08.2020 um 17:51:

Hello again,

I need to place several figures side by side (e.g. pictures of persons).
I know I can use combinations, but I need the figures with captions included in the 
usual numbering of figures and not one number & caption for the combination.
How can I achieve this?


Use a float combination:

\useMPlibrary[dum]

\starttext

\input ward

\startplacefigure[title={Dummy}]
\externalfigure[dummy]
\stopplacefigure

\input jojomayer

\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={Left dummy}]
\externalfigure[dummy]
\stopplacefigure
\startplacefigure[title={Right dummy}]
\externalfigure[dummy]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input weisman

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


Re: [NTG-context] context --luatex does not redirect to LuaTeX

2020-08-08 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 08.08.2020 um 17:17:

Hi again!

When context --luatex is used with current version: 2020.08.07 23:37 
LuaMetaTeX is still used. --engine=luatex has no effect, either. Is that 
a bug? Thanks


I have no problems using LuaTeX on Windows.

You can try a new installation and check again.

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
___


Re: [NTG-context] Wrong counting of lines and paragraphs

2020-08-08 Thread Wolfgang Schuster

Marcus Vinicius Mesquita schrieb am 07.08.2020 um 21:10:

Dear list,

In the MWE below you don't get lines and paragraphs numbered correctly:

[...]

Have I hit a bug?


No, this is a side effect from your sections which start the paragraphs.

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
___


Re: [NTG-context] Using \applytosplitstringwordspaced and allies

2020-08-08 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 08.08.2020 um 10:14:

Hi, list! :D
I've found \applytosplitstringwordspaced and many other commands reading 
on the mailing list and TeX StackExchange. An issue with those is: the 
following does not work:


\applytosplitstringwordspaced\somemacro{\input knuth}

It only works with explicit TeX "words". How to circumvent this 
inconvenience? Thanks in advance.


You can't feed knuth.tex to the command because it contains multiple 
paragraphs but even when your file contains only a single paragraph it 
isn't perfect because the linebreak after the last line contains as 
extra word (seen in the first paragraph below).


To use \input as argument for \applytosplitstringwordspaced you need a 
few \expandafter's to ensure the file is read before the argument is 
passed to Lua. A easier method is to move everything to Lua where you 
read the file and put it in a string, afterward you can use the CLD 
mechanism to call \applytosplitstringwordspaced from Lua.


\unexpanded\def\somemacro#1{[#1]}

\starttext

\expandafter\applytosplitstringwordspaced\expandafter\somemacro\expandafter{\input 
weisman }


\blank

\startluacode

-- local ward = io.loaddata(resolvers.findfile("ward.tex"))
local ward = string.fullstrip(io.loaddata(resolvers.findfile("ward.tex")))

context.applytosplitstringwordspaced ( "\\somemacro", ward )

\stopluacode

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


Re: [NTG-context] About the numbering of theorems

2020-08-07 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 07.08.2020 um 16:30:

Hello,
I have a little problem with the numbering of theorems when there is no 
subsection. I would like to know :


Theorem 1.1
Theorem 1.2

Theorem 2.3
Theorem 2.4

Thank you
Fabrice


Use a conversion set to set the number conversion for you sections and 
remove the conversion setting (\setuphead[...][conversion=...]) from the 
setups.


\defineconversionset [fabrice] [n,n,R,n] [n]

\setupheads
  [sectionconversionset=fabrice]

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
___


Re: [NTG-context] teaser

2020-08-07 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 07.08.2020 um 11:14:

Nice, I've just tested it and it works fine. Thank you, Hans.

I would ensure to avoid a page break between the language blocks
which is currently missing but when you need this in a document
it makes sense to write something around it.

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
___


Re: [NTG-context] custom header/footer for 1st/other pages of section

2020-08-06 Thread Wolfgang Schuster

Mike Cooper schrieb am 06.08.2020 um 17:15:

Hola,

I imagine this is probably simple but I can’t find it…

I want the first page only of each section to have particular content in 
header/footer, then all the following pages to different specific 
content.Right now, I am manually entering it in each section.I’m hoping 
there’s a way to automate this; put it into the environment file for all 
sections.


Of course you can set different header/footer layouts for chapter pages.

With  \setupheadertexts and \setupfootertexts you set first the text 
which should appear on regular pages.


To have a different text on a chapter page you can use the \definetext 
command to set them (third first argument is the name of the setup and 
the second argument the location). These setups than can applied to the 
chapter with the header and footer key in \setuphead.


 begin example
\setupheadertexts
  [Page \userpagenumber\ of \lastuserpagenumber]

\definetext
  [chapterheader] % name
  [header] % vertical position
  [This is a chapter page] % content

\definetext
  [chapterfooter]
  [footer]
  [pagenumber]

\setuphead
  [chapter]
  [header=chapterheader,
   footer=chapterfooter]

\starttext

\dorecurse{10}
  {\expanded{\chapter{Chapter \recurselevel}}
   \dorecurse{\numexpr2*\recurselevel\relax}{\samplefile{knuth}}}

\stoptext
 end example

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
___


Re: [NTG-context] teaser

2020-08-06 Thread Wolfgang Schuster

Hans Hagen schrieb am 06.08.2020 um 19:26:

Hi,

I uploaded a new lmtx version ... it has a new mechanism for 
manipulating boxes:


http://www.pragma-ade.com/general/magazines/mag-1105-mkiv.pdf

(also in distribution)

Of course experimental but I bet that some can think of usage.


The \copyboxline command doesn't stop at the end of the requested line.

BTW: Is it possible to have unbox command to get the width of the 
content in the lines without the spaces at the begin end. This is useful 
to get the width of first/last line in a box.


%% begin example
\starttext

\setbox0\vbox
  {\hsize=4cm
   one\par
   two\par
   three\par
   four}

\setbox2\ruledhbox{\copyboxline 0 2}
\setbox4\ruledhbox{\boxline 0 3}
%\setbox6   \boxline 0 5 % error

[2] [\box2] \par
[3] [\box4] \par
[5] [\box6] \par

\stoptext
%% end example

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
___


Re: [NTG-context] Bug with \wordright in LMTX version 2020-08-03 14:25

2020-08-05 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 05.08.2020 um 19:33:

Hello,
I also use a square to complete a demonstration. I tried this without 
success

Thank you
Fabrice

\definesymbol[Fin][\mathematics{\square}]
\def\qed{\strut\wordright{\symbol[Fin]}}

\defineenumeration
   [proof]
   [...,
    closesymbol={\symbol[\qed]}]


1. \symbol is meant to access pre defined symbols, as fallback method 
when the requested symbol doesn't exist ConTeXt outputs the argument. 
This fallback is in my opinion problematic because it's easy to miss it.


\starttext

\symbol[square]

\symbol[quadrat]

\stoptext


2. When you use the closesymbol for a enumeration ConTeXt uses also the 
argument of the closecommand to apply something to the symbol, by 
default the argument to the closecommand key is \wordright.


This means you're putting \wordright (which itself is flushed as symbol) 
within \wordright which has to fail at some point.



Below is a cleaner version to put a symbol at the end of each proof. The 
\blank setting in the \PlaceProofSymbol definition moves the symbol back 
in the math formula to avoid the vertical space between them, you can 
remove it but I would at leas use \blank[back] to get rid of the empty 
line between the formula and the symbol.


\define[1]\PlaceProofSymbol
  {\blank[back,overlay]%
   \dontleavehmode\wordright{#1}}

\defineenumeration
  [proof]
  [ closesymbol={\symbol[square]},
   closecommand=\PlaceProofSymbol]

\starttext

\startproof
  \startformula
a^2 + b^2 = c^2
  \stopformula
\stopproof

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


Re: [NTG-context] Placing a section ending depending on odd/even sectionnumber

2020-08-04 Thread Wolfgang Schuster

Willi Egger schrieb am 04.08.2020 um 18:56:

Hi,

now I have another hurdle to be taken :-) — Depending on the odd or even number 
of the section I have to place an ornament at the end of the section.

I have sofar the following setup:

[...]

However the the evaluation of the sectionnumber results always in “false”, 
having therefore always odd as a sectionending.


You have two problem:

1. To get the current value for \currentheadnumber you have use 
\determineheadnumber[section] before you use it but the example below 
shows a better method.


2. What you do with \doifelse{...}{even} is to compare the numeric value 
of the section with the string "even" which is always false. To check 
whether the value is odd or even you have to use the \ifodd command.



What to change in order to get the desired result?


 begin example
\startsetups [section:odd]
  \vfill
  \bold {End of odd numbered section}
\stopsetups

\startsetups [section:even]
  \vfill
  \bold {End of even numbered section}
\stopsetups

\startsetups [section:end]
  \ifodd\namedheadnumber{section}
\directsetup{section:odd}
  \else
\directsetup{section:even}
  \fi
\stopsetups

\setuphead
  [section]
  [aftersection=\directsetup{section:end}]

\starttext

\startsection[title=Ward]
\input ward
\stopsection

\page

\startsection[title=Knuth]
\input knuth
\stopsection

\stoptext
 end example

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
___


Re: [NTG-context] Fwd: \emph not working in LMTX (bug?)

2020-08-03 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 04.08.2020 um 06:07:


The following worked some days ago. Now it crashes:

\setuphead[chapter][alternative=middle,textstyle=\cap,numbercommand=\WORDS]
\setuphead[section][sectionsegments=section,align=middle,textstyle={\bf},conversion=R,numbercommand={\bf}]
\setuphead[subsection][numbercommand=,textstyle={\it},sectionsegments=subsection,conversion=n]
\starttext
\startchapter[title=Dummy chapter]
\startsection[title=Dummy section]
\startsubsection[title=Dummy subsection]
\input knuth
\stopsubsection
\stopsection
\stopchapter
\stoptext


This caused by the second related problem mentioned in my answer, you 
get the error message for the \cap and \WORDS command.


In this case there is a easy fix and also better chapter setup:

\setuphead
  [chapter]
  [alternative=middle,
   textstyle=cap,
   numberstyle=WORD]

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
___


Re: [NTG-context] \emph not working in LMTX (bug?)

2020-08-03 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 04.08.2020 um 03:37:

The following crashes with LMTX (current version: 2020.08.03 14:25):


\starttext
\emph{Hola}
\stoptext

Log:


\emphasiscorrection ->\ifhmode \ifnum \currentgrouptype =\aligngroupcode

\else \expandafter \expandafter \expandafter \font_emphasis_look \fi \fi

 \egroup

\egroup

l.2 \emph{Hola}

Is it a bug? \emph worked for older versions. Thank you in advance.


Yes and it was already reported by Pablo but don't hesitate report 
future bugs.


https://www.mail-archive.com/ntg-context@ntg.nl/msg95268.html

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
___


  1   2   3   4   5   6   7   8   9   10   >