Re: [NTG-context] headers again

2020-08-12 Thread jbf
Rightly so, and as I was producing such an MWE (stripping away a lot of 
other 'clutter') I found what was causing the problem. At one stage, 
trying to solve the problem, I had created a MyChapter definition and 
had left a command referencing it in the following:


\setuphead
  [chapter][header=empty,alternative=middle,style=\tfa, 
numbercommand=\groupedcommand{}{\blank[1cm]},after={\blank[3cm]},command=\MyChapter]


Give that I was now no longer using MyChapter to solve the problem, that 
command=\MyChapter was causing a conflict. I removed it and, using your 
earlier


\setupheadertexts[\setups{header}]

\startsetups header
  \getmarking[chapter]
\stopsetups

and referencing it in the \chapter or \title items, was able to achieve 
the desired result in every way, including that missing  header on one page.

Thank you.
J

On 13/8/20 3:36 pm, Aditya Mahajan wrote:

On Thu, 13 Aug 2020, jbf wrote:


Almost as perfect as Shakespeare's Juliet! Is there any reason why the header
for the Introduction, done using your approach (it is in frontmatter), does
not produce the header on the last recto page? This intro consists of 8 pages.
Page 7 does not produce the 'Introduction' header. The other relevant recto
pages are all headed 'Introduction' as they should be.

A minimal working example will help in diagnosing what is going on ...

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

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

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

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


Re: [NTG-context] headers again

2020-08-12 Thread Aditya Mahajan
On Thu, 13 Aug 2020, jbf wrote:

> Almost as perfect as Shakespeare's Juliet! Is there any reason why the header
> for the Introduction, done using your approach (it is in frontmatter), does
> not produce the header on the last recto page? This intro consists of 8 pages.
> Page 7 does not produce the 'Introduction' header. The other relevant recto
> pages are all headed 'Introduction' as they should be.

A minimal working example will help in diagnosing what is going on ...

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

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


Re: [NTG-context] headers again

2020-08-12 Thread jbf
Almost as perfect as Shakespeare's Juliet! Is there any reason why the 
header for the Introduction, done using your approach (it is in 
frontmatter), does not produce the header on the last recto page? This 
intro consists of 8 pages. Page 7 does not produce the 'Introduction' 
header. The other relevant recto pages are all headed 'Introduction' as 
they should be.


J

On 13/8/20 12:53 pm, Aditya Mahajan wrote:

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

Aditya

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] headers again

2020-08-12 Thread Aditya Mahajan
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

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

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


[NTG-context] headers again

2020-08-12 Thread jbf
Understandably, with work going on for the new \command pages, 
heatwaves, upcoming ConTeXt meeting, people are very busy. I understand 
that. In the meantime, I haven't yet found a solution (though I have 
tried many) to my own problem, small though it is by comparison. So let 
me try again, putting it  simply:


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.


Julian

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

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


[NTG-context] Wiki New Extension Preview

2020-08-12 Thread Taco Hoekwater
Hi,

Some of you already know that I have been working on a wiki extension to 
control the editing of /Command pages.

The goal is to eventually be able to easily export all of the reference 
documentation in the wiki to a separate system (for instance, Paul Mazaitis 
plans to create a full-blown reference manual). In the current situation, this 
is nearly impossible because there is so much variation in the content and 
quality of the wiki /Command pages (not to mention that many are missing). We 
also want it to be possible to merge improvements to the interface xml 
definitions by Wolfgang without loosing any existing documentation work.

After some evenings and weekends of steady discussion with Paul, Wolfgang and 
some others on the wiki mailing list and a fair bit of hacking, this plan is 
now starting to come together. In short, we will switch to XML as the page 
model for newly created /Command pages. This makes editing a bit harder, but it 
allows much better quality control and (fairly) easy export and import.

The new extension is not installed on the normal wiki yet, because it makes 
sense to see if we can get some of the bugs ironed out before we start working 
on actual /Command pages. It is my first ever Wiki extension and even my first 
non-trivial php code, thus I am certain there will be bugs. So, while the 
documentation pages are already on the normal wiki, any testing and/or 
experimenting has to be done on the test wiki.

The documentation pages are here:

  https://wiki.contextgarden.net/Command
  https://wiki.contextgarden.net/Help:Command
  https://wiki.contextgarden.net/Extension:ConTeXtXML

and there is a small todo list here:

  https://wiki.contextgarden.net/User_talk:Taco

For playing around / experimenting / testing, have fun at

  https://wikitest.contextgarden.net/

(but read at least Help:Command first!)

A useful landing page on the test wiki to start playing around is:

  https://wikitest.contextgarden.net/Allcommands

which is a list of all the commands that are included in Wolfgang’s interface 
xml (and thus available to be documented using the new wiki extension). 

All the bright red links are currently undocumented commands. Clicking on one 
should bring you to the edit screen automatically, with a blob of XML 
preloaded, ready for you to start writing.

All the dark red links are existing /Command pages. Almost all of those are 
traditional wiki text pagse. Following those links will bring you to a normal 
/Command page just like on the main wiki. If you want to see how one of those 
pages would look like in the new system, you’ll have to rename the existing 
page first. 

Be assured that nothing on the wikitest is permanent! As long as the browser 
url says “ https://wikitest.contextgarden.net/ ” you cannot destroy anything 
important. But don’t spend hours improving existing pages yet, this preview is 
intended for catching bugs in the extension only.

Comments, Suggestions and Bug reports are more than welcome. 

Please direct those to me personally or (better) to the wiki mailing list:

https://lists.contextgarden.net/mailman/listinfo/wiki

Have fun!

Taco


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

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


Re: [NTG-context] \checkpage in the TOC

2020-08-12 Thread Willi Egger
Beste Hans!

thank you so much for your solution!

After plying I will remember your last statement in your answer :-)

Kind regards

Willi

> On 12 Aug 2020, at 02:04, Hans Hagen  wrote:
> 
> On 8/10/2020 11:02 PM, Willi Egger wrote:
>> Hello!
>> humble, in another book I am trying to improve the list of contents. On 
>> different places occur page breaks which should be addressed and corrected.
>> I tried to use the method \checkpage[][], however my attempts are not 
>> succesful.
>> For your reference I include a screenshot of the problematic pagebreak.
>> \definepagechecker
>>   [willi]
>>   [method=1,before=,after=,inbetween={\page}]
>> \setuplist
>> [chapter]
>> [prefix=no,
>> sectionnumber=no,
>> headnumber=no,
>>   alternative=command,
>>   command=\Mychaptercommand,
>>  inbetween={\checkpage[willi][lines=4]}
>> Thank you for advice!
>> Kind regards
>> Willi
>> ]
> Here's an example of an actually already quite old mechanism ..
> 
> \showinjector
> 
> \setinjector[register][3][\column]
> \setinjector[list][2][{\blank[3*big]}]
> 
> \starttext
>   \placelist[section][criterium=text]
>   \blank[3*big]
>   \placeregister[index][criterium=text]
>   \page
>   \startsection[title=Alpha] first  \index{first}  \stopsection
>   \startsection[title=Beta]  second \index{second} \stopsection
>   \startsection[title=Gamma] third  \index{third}  \stopsection
>   \startsection[title=Delta] fourth \index{fourth} \stopsection
> \stoptext
> 
> .. so you now have something to wikify ..
> 
> Hans
> 
> -
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>  tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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


[NTG-context] \setfirstline is applied to whole paragraph

2020-08-12 Thread Nicola
When I typeset the example at

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

(reported below for your convenience), \setfirstline is applied to the
whole first paragraph, which is laid out on a single line (hence, it is
cropped at the edge of the page). Besides, the second \setfirstline is
not applied at all, i.e., there are no small caps. If I comment out the
first \setfirstline, then the second one does produce small caps, but
again, a whole paragraph is set in small caps, not just the first line.

$ context --version
mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | main context file: 
/Users/nicola/Applications/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2020.08.11 15:59
mtx-context | main context file: 
/Users/nicola/Applications/context-osx-64/tex/texmf-context/tex/context/base/mkiv/context.mkxl
mtx-context | current version: 2020.08.11 15:59

Nicola


\setupbodyfont [heros] %% important: smallcaps capable font!

\definefirstline [italicfirstline] [
  alternative=line,
  style=italic,
]

\definefirstline [smallcapsfirstline] [
  alternative=line,
  color=darkred,
  style=smallcaps,
]

\starttext

  % \setfirstline[italicfirstline]\input knuth \par
  \setfirstline[smallcapsfirstline] \input knuth \par

\stoptext



___
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-12 Thread Nicola
On 2020-08-12, Wolfgang Schuster  wrote:
> 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

Thanks, nice trick!

Nicola

___
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 can I use ConTeXt from TeXLive2020 ?

2020-08-12 Thread Axel Kielhorn


> Am 11.08.2020 um 16:57 schrieb Otared Kavian :
> 
> I don't have these files at this place, but in
>   /opt/local/etc/texmf/
> I do have 
>   /opt/local/etc/texmf/texmf.cnf
>   /opt/local/etc/texmf/texmfcnf.lua
> the first one being created automatically when I tried to do mtxrun 
> --generate after installing TeXLive2020. Ir says its content should not be 
> modified directly and that its content is based on of the file
>   /opt/local/etc/texmf/texmf.cnf.d
> The content of the above directory dates from 2019, and maybe that is why my 
> logfile reports things being done with TeXLive2019. 
> 
> The content of the file 
>   /opt/local/etc/texmf/texmfcnf.lua
> is written by Hans in date = "2012-05-24" time = "12-12-12".
> 
> Replacing /opt/local/etc/texmf/texmf.cnf with some other texmf.cnf does not 
> help, since it is overwritten when one does 
>   mtxrun --generate
> 
> So the problem remains… Maybe I have to contact people who prepare MacTeX2020 
> and ask for help with them.

This looks like a Macports installation.

When I call the Macports version of context I get:

context --help
resolvers   | caches | path '/Users/axel/.texlive2020/texmf-var' created
mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'

If you want to use the Macports version of ConTeXt please install

port install textlive-context

after installing that I get:

context --help
mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | basic options:
mtx-context |
mtx-context | --run  process (one or more) files (default 
action)
mtx-context | --make create context formats
mtx-context |
mtx-context | --ctx=name use ctx file (process management 
specification)
mtx-context | --noctxignore ctx directives and flags
mtx-context | --interfaceuse specified user interface (default: 
en)
mtx-context |
mtx-context | --autopdf  close pdf file in viewer and start pdf 
viewer afterwards
mtx-context | --purgepurge files either or not after a run 
(--pattern=...)
mtx-context | --purgeall purge all files either or not after a 
run (--pattern=...)
mtx-context |
mtx-context | --usemodule=list   load the given module or style, 
normally part of the distribution
mtx-context | --environment=list load the given environment file first 
(document styles)
mtx-context | --mode=listenable given the modes (conditional 
processing in styles)
mtx-context | --path=listalso consult the given paths when 
files are looked for
mtx-context | --arguments=list   set variables that can be consulted 
during a run (key/value pairs)
mtx-context | --randomseed=numberset the randomseed
mtx-context | --result=name  rename the resulting output to the 
given name
mtx-context | --trackers=listset tracker variables (show list with 
--showtrackers)
mtx-context | --directives=list  set directive variables (show list 
with --showdirectives)
mtx-context | --silent=list  disable logcatgories (show list with 
--showlogcategories)
mtx-context | --stripstrip Lua code (only meant for 
production where no errors are expected)
mtx-context | --errors=list  show errors at the end of a run, quit 
when in list (also when --silent)
mtx-context | --htmlerrorpagegenerate html error page instead 
(optional: =scite)
mtx-context | --noconsoledisable logging to the console 
(logfile only)
mtx-context | --purgeresult  purge result file before run
mtx-context |
mtx-context | --forcexml force xml stub
mtx-context | --forcecld force cld (context lua document) stub
mtx-context | --forcelua force lua stub (like texlua)
mtx-context | --forcemp  force mp stub
mtx-context |
mtx-context | --arrange  run extra imposition pass, given that 
the style sets up imposition
mtx-context | --noarrangeignore imposition specifications in 
the style
mtx-context |
mtx-context | --jit  use luajittex with jit turned off 
(only use the faster virtual machine)
mtx-context | --jitonuse luajittex with jit turned on (in 
most cases not faster, even slower)
mtx-context |
mtx-context | --once only run once (no multipass data file 
is produced)
mtx-context | --runs process at most this many times
mtx-context | --forcedruns   process this many times (permits for 
optimization trial runs)
mtx-context |
mtx-context | --batchmoderun without stopping and do not show 
messages on the console
mtx-context | --nonstopmode  run without stopping
mtx-context |
mtx-context | --nosynctexnever