Re: [NTG-context] page number with brief centered line above

2020-05-14 Thread jbf
Thanks Wolfgang. It seems I was almost there, but had forgotten the 
braces for \pagenumber!  I am grateful for the observation. \framed is 
definitely the preferred solution.


Julian

On 15/5/20 1:28 am, Wolfgang Schuster wrote:

jbf schrieb am 14.05.2020 um 07:30:

Hi list,

I am trying to achieve a layout where there is a brief line above the 
bottom-centered page number (of a double-sided document). I am able 
to achieve the centered bottom-located page number easily and 
obviously enough with:


\setuppagenumbering
  [alternative=doublesided,location={footer,middle}]
\setupfooter
  [style=bold]

And I was able to achieve a result with a short line above where the 
page number should be - but by adopting the solution below I have now 
lost the page number.


\setuppagenumbering
  [alternative=doublesided,location={footer,middle}]
\setupfootertexts[{\framed[frame=off,topframe=on,width=.5\textwidth]}]

You forgot the braces for the argument of \framed.
So then I thought that having left out any reference to page numbers 
I had better put it in, so I added [pagenumber] to the above, but I 
ended up with two page numbers, one centered, the other to the inner 
or outer margins (depending on recto/verso), and the line was 
likewise to the right or left of the centred number. So clearly not 
what I want.


Maybe the solution lies with some combination of the above I haven't 
thought of, or maybe there is another solution altogether. Any thoughts?


1. Add a rule at the top of the footer.

\setuppagenumbering
  [location=footer]

\setupfooter
  [text]
  [before=\hrule]

\starttext
\page[dummy]
\stoptext


2. Put the page number in a frame (preferred method).

\setuppagenumbering
  [location=]

\setupfootertexts
  [{\framed[width=max,frame=off,topframe=on]{\pagenumber}}]

\starttext
\page[dummy]
\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] Blank page added after pagecolumns

2020-05-14 Thread Joey McCollum
Okay, I think I'm getting close, but I'm not quite there yet. The
pagecolumns source code is found in page-pcl.mkiv (
source.contextgarden.net/tex/context/base/mkiv/page-pcl.mkiv), and in that
code, the \page_col_stop_yes macro seems to have something to do with the
issue:

```
\unexpanded\def\page_col_stop_yes
  {\column % \page_otr_eject_page
   \page
   \endgroup
 % \setupoutputroutine[\s!singlecolumn]%
   \page_otr_command_set_vsize
   \page_otr_command_set_hsize
   \page
   \endgroup}
```

If I redefine this macro in my MWE as follows, I can remove the extra page
that is added when the last page ends with text in the last column:

```

\unprotect

\def\page_col_stop_yes

{\column %\page_otr_eject_page

%\page

\endgroup

% \setupoutputroutine[\s!singlecolumn]%

\page_otr_command_set_vsize

\page_otr_command_set_hsize

%\page

\endgroup}

\protect
```

Commenting out the \page calls does the trick in this case, but now, if the
last page ends with its text in a column before the last one, then the last
page is not typeset at all, and a blank page takes its place.

On Sun, May 10, 2020 at 8:34 PM Thangalin  wrote:

> Bump.
>
> See also: https://tex.stackexchange.com/q/542993/2148
>
> On Mon, May 4, 2020 at 11:46 AM Joey McCollum
>  wrote:
> >
> > After continuing to look into this a bit, I noticed that a similar issue
> involving the insertion of a blank page after a columnset environment has
> been discussed on the mailing list in the thread "Blank page inserted when
> text reaches column's end" (dated 08 Dec 2019). In that thread, a proposed
> solution was to redefine the \page_grd_stop macro found in page-cst.mkiv as
> follows:
> >
> > ```
> > \unprotect
> > \def\page_grd_stop{%
> >   \endgraf % needed, else wrong vsize in one par case
> >   \vfill % otherwise weird \placenotes[endnotes]
> >   \page_grd_command_set_vsize % needed
> >   \penalty\c_page_otr_eject_penalty
> >   %\page_grd_command_flush_page
> >   \page_otr_fill_and_eject_page
> >   \page_grd_command_set_vsize % why here
> >   \egroup
> >   \page_otr_command_set_vsize
> >   \page_otr_command_set_hsize
> > }
> > \protect
> > ```
> >
> > Unfortunately, this approach was found to have potential issues in that
> thread, and it does not fix the problem with pagecolumns in my MWE. Are
> pagecolumns commands aliased to pagegrid commands like columnset commands
> are, or are they defined somewhere else? I checked page-col.mkiv, but it
> seems to be too short to be the file that defines pagecolumns behavior.
> >
> > Joey
> >
> > On Sat, May 2, 2020 at 11:46 AM Joey McCollum <
> jmccollum20140...@gmail.com> wrote:
> >>
> >> I recently found the pagecolumns manual (
> http://www.pragma-ade.com/general/manuals/pagecolumns.pdf), and in
> several of the examples (including those for side floats and footnotes),
> the addition of a blank page after the end of the pagecolumns environment
> also seems to occur. So when the manual says, "We always start at a new
> page and end on a new one," does it mean that this is a feature of
> pagecolumns? And if so, is there any way to disable it? I have no problem
> with a page break after the end of the pagecolumns environment, but an
> empty page added after the break seems unnecessary. I checked for a wiki
> page on the \definepagecolumns command to get more information on its
> accepted inputs, but there doesn't appear to be a page for this command.
> >>
> >> Joey
> >>
> >> On Tue, Apr 28, 2020 at 1:40 PM Joey McCollum <
> jmccollum20140...@gmail.com> wrote:
> >>>
> >>> I am typesetting a document using pagecolumns to ensure that my
> footnotes are set ragged-bottom in columns. I have observed some unexpected
> behavior whenever the last column on a page is left incomplete: a blank
> page is added at the end of the document. A minimal working example follows:
> >>>
> >>> ```
> >>>
> >>> \starttext
> >>>
> >>> \startpagecolumns[n=2]
> >>>
> >>> \dorecurse{3}{\par\input zapf}
> >>>
> >>> \stoppagecolumns
> >>>
> >>> \stoptext
> >>>
> >>> ```
> >>>
> >>> I typeset this using ConTeXt version 2020.03.10, as released with
> TeXLive 2020. Notably, if \dorecurse{3} is changed to \dorecurse{2} or
> \dorecurse{6} (so that the text ends in the first column of a page), then
> there is no problem. I have tried to fix this by specifying page=no in the
> \startpagecolumns arguments, but it did not change anything. Is there
> something else I am missing?
> >>>
> >>> Thank you,
> >>>
> >>> Joey
> >
> >
> ___
> > 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 transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Thank you. That works.

> On 14 May 2020, at 17:13, Wolfgang Schuster 
>  wrote:
> 
> Gerben Wierda schrieb am 14.05.2020 um 11:47:
>> Is it possible to get a transparent background in a textext()? The following 
>> minimal example doesn’t work.
>> \starttext
>> \setupMPpage
>>   [background=color,
>>backgroundcolor=gray]
>> \startMPpage
>> draw textext("\definecolor[labelbackground][a=0.2,r=1,g=1,b=1]
> 
> \definecolor[labelbackground][a=1,t=0.2,r=1,g=1,b=1]
> 
> Wolfgang


G
___
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] left protruding quotations

2020-05-14 Thread Wolfgang Schuster

Rik Kabel schrieb am 14.05.2020 um 17:31:


On 5/14/2020 11:21, Wolfgang Schuster wrote:

Michael Guravage schrieb am 14.05.2020 um 10:37:
When I start a paragraph with a \quote or a \quotation the left 
quotemark does not protrude, but when I use Unicode quotes it does. 
I would prefer to use the commands. Any suggestions on how I can 
achieve proper left protrusion without resorting to Unicode characters?


\setupquotation [method=font]
\setupquote [method=font]

Interestingly, \setupquotation in this situation provides protrusion 
for both \quote and \quotation open marks, while \setupquote does so 
only for \quote open marks, so only one is needed if you want it for 
both, and neither works if you want it for only \setupquotation. 
Perhaps it is different with some other language-specific marks.


\quote inherits its values from \quotation but you can always set value 
only for \quote, e.g.


\setupquotation [method=font]
\setupquote [method=]

enables hanging punctuation for \quotation only.

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 color schemes in t-vim

2020-05-14 Thread Aditya Mahajan

On Thu, 14 May 2020, Nicola wrote:


Quick question: Is \startcolorscheme... \stopcolorscheme (still)
supported by t-vim?

In a template I wrote long time ago to typeset code, I have:

   \usemodule[vim]
   \unprotect
   \startcolorscheme[oceansunset]
 \definesyntaxgroup[Comment][\c!color={colortwo},\c!style=italic]
 % etc.
   \stopcolorscheme
   \protect

which I use as described in the wiki:

   \definevimtyping
[...]
[...
 alternative=oceansunset,
 ...]

But that does not seem to have any effect (if I change the colors, the
syntax highlighting does not change). I can use pscolor and
blackandwhite, though. I see that \startcolorscheme is not documented,
so maybe there is another mechanism?


It is supposed to work. If it doesn't, then it is a bug. Could you provide a 
complete MWE.

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] left protruding quotations

2020-05-14 Thread Rik Kabel


On 5/14/2020 11:21, Wolfgang Schuster wrote:

Michael Guravage schrieb am 14.05.2020 um 10:37:
When I start a paragraph with a \quote or a \quotation the left 
quotemark does not protrude, but when I use Unicode quotes it does. I 
would prefer to use the commands. Any suggestions on how I can 
achieve proper left protrusion without resorting to Unicode characters?


\setupquotation [method=font]
\setupquote [method=font]


Interestingly, \setupquotation in this situation provides protrusion for 
both \quote and \quotation open marks, while \setupquote does so only 
for \quote open marks, so only one is needed if you want it for both, 
and neither works if you want it for only \setupquotation. Perhaps it is 
different with some other language-specific marks.


--
Rik

___
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] page number with brief centered line above

2020-05-14 Thread Wolfgang Schuster

jbf schrieb am 14.05.2020 um 07:30:

Hi list,

I am trying to achieve a layout where there is a brief line above the 
bottom-centered page number (of a double-sided document). I am able to 
achieve the centered bottom-located page number easily and obviously 
enough with:


\setuppagenumbering
  [alternative=doublesided,location={footer,middle}]
\setupfooter
  [style=bold]

And I was able to achieve a result with a short line above where the 
page number should be - but by adopting the solution below I have now 
lost the page number.


\setuppagenumbering
  [alternative=doublesided,location={footer,middle}]
\setupfootertexts[{\framed[frame=off,topframe=on,width=.5\textwidth]}]

You forgot the braces for the argument of \framed.
So then I thought that having left out any reference to page numbers I 
had better put it in, so I added [pagenumber] to the above, but I 
ended up with two page numbers, one centered, the other to the inner 
or outer margins (depending on recto/verso), and the line was likewise 
to the right or left of the centred number. So clearly not what I want.


Maybe the solution lies with some combination of the above I haven't 
thought of, or maybe there is another solution altogether. Any thoughts?


1. Add a rule at the top of the footer.

\setuppagenumbering
  [location=footer]

\setupfooter
  [text]
  [before=\hrule]

\starttext
\page[dummy]
\stoptext


2. Put the page number in a frame (preferred method).

\setuppagenumbering
  [location=]

\setupfootertexts
  [{\framed[width=max,frame=off,topframe=on]{\pagenumber}}]

\starttext
\page[dummy]
\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] left protruding quotations

2020-05-14 Thread Wolfgang Schuster

Michael Guravage schrieb am 14.05.2020 um 10:37:
When I start a paragraph with a \quote or a \quotation the left 
quotemark does not protrude, but when I use Unicode quotes it does. I 
would prefer to use the commands. Any suggestions on how I can 
achieve proper left protrusion without resorting to Unicode characters?


\setupquotation [method=font]
\setupquote [method=font]

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 transparency in METAPOST within textext()

2020-05-14 Thread Wolfgang Schuster

Gerben Wierda schrieb am 14.05.2020 um 11:47:
Is it possible to get a transparent background in a textext()? The 
following minimal example doesn’t work.


\starttext
\setupMPpage
   [background=color,
    backgroundcolor=gray]
\startMPpage
draw 
textext("\definecolor[labelbackground][a=0.2,r=1,g=1,b=1]


\definecolor[labelbackground][a=1,t=0.2,r=1,g=1,b=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
___


[NTG-context] Using transparency in METAPOST within textext()

2020-05-14 Thread Gerben Wierda
Is it possible to get a transparent background in a textext()? The following 
minimal example doesn’t work.

\starttext
\setupMPpage
  [background=color,
   backgroundcolor=gray]
\startMPpage
draw 
textext("\definecolor[labelbackground][a=0.2,r=1,g=1,b=1]\framed[height=1.2em,background=color,backgroundcolor=labelbackground,foregroundcolor=black]{Text
 in Label}");
\stopMPpage

\stoptext


Thx.

G


___
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] Retrieving original value of enviroment variable HOME

2020-05-14 Thread context

Hello Hans,

I made some observations and ... - shortly, the simpliest solution seems 
to me:


Would it be accptable for your to replace

  "
  local homedir = osgetenv(ostype == "windows" and 'USERPROFILE' or 
'HOME') or ''

  "

with:

  "
  local homedir= ostype=="windows" and (osgetenv('HOME') or 
osgetenv('USERPROFILE')) or osgetenv('HOME') or ''

  "

- I made that replacement in:

  tex\texmf-mswin\bin\mtxrun.lua

and

  tex\texmf-context\tex\context\base\mkiv\data-ini.lua

(I have also another solution, but you might find it more hacky, so 
let's keep it in silence so far...)


Best regards,

Lukas


On 2020-05-12 13:53, Hans Hagen wrote:

On 5/12/2020 11:36 AM, cont...@vivaldi.net wrote:

And - once I "inject" an extra debug info - do I have to call 
"context.exe --make --generate" (or similar)?

You need to remake the fomat (and make sure you have the right
mtxrun/context scripts).

Hans

___
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] Custom color schemes in t-vim

2020-05-14 Thread Nicola
Quick question: Is \startcolorscheme... \stopcolorscheme (still)
supported by t-vim?

In a template I wrote long time ago to typeset code, I have:

\usemodule[vim]
\unprotect
\startcolorscheme[oceansunset]
  \definesyntaxgroup[Comment][\c!color={colortwo},\c!style=italic]
  % etc.
\stopcolorscheme
\protect

which I use as described in the wiki:

\definevimtyping
 [...]
 [...
  alternative=oceansunset,
  ...]

But that does not seem to have any effect (if I change the colors, the
syntax highlighting does not change). I can use pscolor and
blackandwhite, though. I see that \startcolorscheme is not documented,
so maybe there is another mechanism?

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
___


[NTG-context] left protruding quotations

2020-05-14 Thread Michael Guravage
When I start a paragraph with a \quote or a \quotation the left quotemark
does not protrude, but when I use Unicode quotes it does. I would prefer to
use the commands. Any suggestions on how I can achieve proper left
protrusion without resorting to Unicode characters?

Cheers,

Michael
% Setup hanging punctuation, less severe style
\definefontfeature
  [default]
  [default]
  %%[protrusion=quality,expansion=quality]
  [protrusion=punctuation,expansion=quality]

\setupalign[hz,hanging]

% Setup white space between paragraphs
\setupwhitespace[medium]

% Choose a font
\setupbodyfont[pagella,11pt]
\setupbodyfontenvironment[default][em=italic]

\showframe

\starttext
  
  \input tufte

  \quotation{We thrive in information||thick worlds} because of our
  marvelous and everyday capacity to select, edit, single out,
  structure, highlight, group, pair, merge, harmonize, synthesize,
  focus, organize, condense, reduce, boil down, choose, categorize,
  catalog, classify, list, abstract, scan, look into, idealize,
  isolate, discriminate, distinguish, screen, pigeonhole, pick over,
  sort, integrate, blend, inspect, filter, lump, skip, smooth, chunk,
  average, approximate, cluster, aggregate, outline, summarize,
  itemize, review, dip into, flip through, browse, glance into, leaf
  through, skim, refine, enumerate, glean, synopsize, winnow the wheat
  from the chaff and separate the sheep from the goats.

  “We thrive in information||thick worlds” because of our marvelous
  and everyday capacity to select, edit, single out, structure,
  highlight, group, pair, merge, harmonize, synthesize, focus,
  organize, condense, reduce, boil down, choose, categorize, catalog,
  classify, list, abstract, scan, look into, idealize, isolate,
  discriminate, distinguish, screen, pigeonhole, pick over, sort,
  integrate, blend, inspect, filter, lump, skip, smooth, chunk,
  average, approximate, cluster, aggregate, outline, summarize,
  itemize, review, dip into, flip through, browse, glance into, leaf
  through, skim, refine, enumerate, glean, synopsize, winnow the wheat
  from the chaff and separate the sheep from the goats.

\stoptext

hangit.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] Is it possible to make xml.load a bit more 'verbose' when it encounters errors?

2020-05-14 Thread Hans van der Meer
Gerben,Maybe this is of some use. The Lua code in the file checks the xml and returns info when something is wrong.I am using it for example in my takenotes module as:And this is a sketch of how it is embedded in that module:	% Prerun an xml check.	\doifinset{\xmlatt{#1}{checkxml}}{yes,on,true}%		{\xmlcommand{#1}{.}{xmlcommon:checkxml}}	% Execute this code if no error was found.		etc.
dr. Hans van der Meer

\startluacode
-- Define our namespace as hvdm
hvdm = hvdm or {}

-- Function checks the correctness of an XML tree.
hvdm.checkXMLtree = function (xml, linesep)

local xml = xml and xml or ""
local linesep = linesep and linesep or "\n"
local badspace = {}

-- Empty files do not need processing.
if xml == "" then
return ""
end

-- Step one is remove leading characters before first node.
local leadingnode = string.find(xml, "<", 1) or 1
if leadingnode ~= 1 then
xml = string.sub(xml, leadingnode, -1)
end

-- Strip all comments  but node pairs inside make it 
complicated.
local c1, c2 = string.find(xml, "", c2 + 1, true)
if c3 then
-- Remove comment.
xml = string.sub(xml, 1, c1 - 1) .. string.sub(xml, c4 
+ 1, -1)

-- Search for next comment.
c1, c2 = string.find(xml,