[NTG-context] What’s wrong with \nomarking{\crlf}?

2014-03-06 Thread Henning Hraban Ramm
Hi,

I’m trying to get a linebreak into a heading, but not in the ToC.
I thought \nomarking{\crlf} would be the way to go, but \crlf seems to be 
undefined, as well as \nomarking??

(Latest beta on OSX.)

\starttext

\startchapter[title={It’s a long way to Tipperary,\nomarking{\crlf} it’s a long 
way to go}]

\include knuth

\stopchapter

\completecontent

\stoptext



Greetlings, Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] What’s wrong with \nomarking{\crlf}?

2014-03-06 Thread Thangalin
Hi,

From the docs:

http://wiki.contextgarden.net/MkIV_Differences#Nomarking.2FSelect

\nomarking is currently broken and will likely be removed from mkiv;
use \select instead...
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Trimming strings and Lua string.trim question

2014-03-06 Thread Hans Hagen

On 3/6/2014 12:00 AM, Rik Kabel wrote:

On 2014-03-05 10:54, Wolfgang Schuster wrote:


Am 05.03.2014 um 16:18 schrieb Wolfgang Schuster
schuster.wolfg...@gmail.com mailto:schuster.wolfg...@gmail.com:



Am 05.03.2014 um 16:07 schrieb Rik Kabel cont...@rik.users.panix.com
mailto:cont...@rik.users.panix.com:


striplong



It would be nice if striplong worked, but the example fails when
string.striplong is used in place of string.strip. The log says:

! LuaTeX error [string \directlua ]:1: attempt to call field
'striplong' (a nil value)
stack traceback:
[string \directlua ]:1: in main chunk.

Is the format of the call different than shown in the wiki, or is a
different mechanism required to quote a potentially long string?


The name of the function is “strings.striplong”.


This should be “utilities.strings.striplong” but it has no effect
because when take a look
at the saved string in Lua you can see that blank lines are removed
from the text.

Wolfgang


Indeed. This does build without error, but the
utilities.strings.striplong result is worse than the string.strip
result, with some additional whitespace at the end of the test string
from the earlier example.


the definition of 'worse' depends on expectations and given the fact 
that in tex a newline or two newlines in a row have a different meaning 
it is just a guess what you want to achieve


anyway, the next beta will have

local str = table.concat( {
  ,
aap,
  noot mies,
  ,
,
 zuswim jet,
zuswim jet,
   zuswim jet,
,
}, \n)

utilities.strings.striplines(str,'prune'):

[[aap
noot mies


zuswim jet
zuswim jet
zuswim jet]]

utilities.strings.striplines(str,'prune and collapse'):

[[aap
noot mies

zuswim jet
zuswim jet
zuswim jet]]

utilities.strings.striplines(str,'prune and no empty'):

[[aap
noot mies
zuswim jet
zuswim jet
zuswim jet]]

utilities.strings.striplines(str,'retain'):

[[
aap
noot mies


zuswim jet
zuswim jet
zuswim jet
]]

utilities.strings.striplines(str,'retain and collapse'):

[[
aap
noot mies

zuswim jet
zuswim jet
zuswim jet
]]

utilities.strings.striplines(str,'retain and no empty'):

[[
aap
noot mies
zuswim jet
zuswim jet
zuswim jet
]]

so you can choose what you like

Hans




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Bug: Columnar itemized text

2014-03-06 Thread Thangalin
Hi,

I believe I have isolated the problem:

\starttext
  balance
  \startmixedcolumns[balance=yes,]
\dorecurse{8}{\input{ward}}
  \stopmixedcolumns
  %\page

  strut
  \startmixedcolumns[grid=strut,]
\dorecurse{4}{\input{knuth}}
  \stopmixedcolumns
\stoptext

When balanced mixedcolumns are followed by mixedcolumns using a strut
grid, then the content of the second mixedcolumns will extend into the
footer area on the next page. However, if the content of the strut
grid mixedcolumns is long enough to incur a page break on that next
page, then no content spills into the footer.

How can I help fix this?
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug: Columnar itemized text

2014-03-06 Thread Hans Hagen

On 3/6/2014 11:46 AM, Thangalin wrote:

Hi,

I believe I have isolated the problem:

\starttext
   balance
   \startmixedcolumns[balance=yes,]
 \dorecurse{8}{\input{ward}}
   \stopmixedcolumns
   %\page

   strut
   \startmixedcolumns[grid=strut,]
 \dorecurse{4}{\input{knuth}}
   \stopmixedcolumns
\stoptext

When balanced mixedcolumns are followed by mixedcolumns using a strut
grid, then the content of the second mixedcolumns will extend into the
footer area on the next page. However, if the content of the strut
grid mixedcolumns is long enough to incur a page break on that next
page, then no content spills into the footer.

How can I help fix this?


can you experiment with this:

\unprotect

\setvalue{\??mixedcolumnsstop\s!otr}%
  {\par
   \ifcase\c_page_mix_otr_nesting\or
 \doifelse{\mixedcolumnsparameter\c!balance}\v!yes
   {\c_page_mix_routine\c_page_mix_routine_balance}%
   {\penalty-\plustenthousand}% weird hack, we need to trigger the 
otr sometimes

 \page_otr_trigger_output_routine
   \fi}

\protect

(put it in cont-new.mkiv)

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] What’s wrong with \nomarking{\crlf}?

2014-03-06 Thread Wolfgang Schuster

Am 06.03.2014 um 11:02 schrieb Thangalin thanga...@gmail.com:

 Hi,
 
 From the docs:
 
 http://wiki.contextgarden.net/MkIV_Differences#Nomarking.2FSelect
 
 \nomarking is currently broken and will likely be removed from mkiv;
 use \select instead…

You don’t need select, when you use MkIV you can set different texts
for the heading, list entry, bookmarks and header.

\startchapter
  [title=…,
   list=…,
   bookmark=…,
   marking=…]

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Trimming strings and Lua string.trim question

2014-03-06 Thread Rik Kabel

On 2014-03-06 05:38, Hans Hagen wrote:

On 3/6/2014 12:00 AM, Rik Kabel wrote:

On 2014-03-05 10:54, Wolfgang Schuster wrote:


Am 05.03.2014 um 16:18 schrieb Wolfgang Schuster
schuster.wolfg...@gmail.com mailto:schuster.wolfg...@gmail.com:



Am 05.03.2014 um 16:07 schrieb Rik Kabel cont...@rik.users.panix.com
mailto:cont...@rik.users.panix.com:


striplong



It would be nice if striplong worked, but the example fails when
string.striplong is used in place of string.strip. The log says:

! LuaTeX error [string \directlua ]:1: attempt to call field
'striplong' (a nil value)
stack traceback:
[string \directlua ]:1: in main chunk.

Is the format of the call different than shown in the wiki, or is a
different mechanism required to quote a potentially long string?


The name of the function is “strings.striplong”.


This should be “utilities.strings.striplong” but it has no effect
because when take a look
at the saved string in Lua you can see that blank lines are removed
from the text.

Wolfgang


Indeed. This does build without error, but the
utilities.strings.striplong result is worse than the string.strip
result, with some additional whitespace at the end of the test string
from the earlier example.


the definition of 'worse' depends on expectations and given the fact 
that in tex a newline or two newlines in a row have a different 
meaning it is just a guess what you want to achieve


anyway, the next beta will have

local str = table.concat( {
  ,
aap,
  noot mies,
  ,
,
 zuswim jet,
zuswim jet,
   zuswim jet,
,
}, \n)

utilities.strings.striplines(str,'prune'):

[[aap
noot mies


zuswim jet
zuswim jet
zuswim jet]]

utilities.strings.striplines(str,'prune and collapse'):

[[aap
noot mies

zuswim jet
zuswim jet
zuswim jet]]

utilities.strings.striplines(str,'prune and no empty'):

[[aap
noot mies
zuswim jet
zuswim jet
zuswim jet]]

utilities.strings.striplines(str,'retain'):

[[
aap
noot mies


zuswim jet
zuswim jet
zuswim jet
]]

utilities.strings.striplines(str,'retain and collapse'):

[[
aap
noot mies

zuswim jet
zuswim jet
zuswim jet
]]

utilities.strings.striplines(str,'retain and no empty'):

[[
aap
noot mies
zuswim jet
zuswim jet
zuswim jet
]]

so you can choose what you like

Hans


indeed, beauty is in the eye of the beholder.

Thank you for the flexible solution that allows each of us to find beauty.

Could you please ensure that this handles text in buffers the same way 
that it handles other strings? I noticed that this is handled a bit 
differently, as the following shows,but perhaps it is my clumsy coding. 
The buffer result is closer to what I expect in terms of internal 
whitespace, but still does not show expected trimming of leading and 
trailing whitespace. That trimming, of course, is the point of the exercise.



   \def\StringsStripLong#1%
  {\ctxlua{context(utilities.strings.striplong([==[#1]==]))}}

   \def\StringStrip#1%
  {\ctxlua{context(string.strip([==[#1]==]))}}

   \startbuffer[testbuffer]

   B This is a test.

   And it has an unexpected result.


   \stopbuffer

   \long\def\testmacro{

   M This is a test.

   And it has an unexpected result.


   }

   \starttext

   \subject{Lua string.strip passed TeX buffer}
   ¦\StringStrip{\getbuffer[testbuffer]}¦

   \subject{Lua string.strip passed TeX macro}
   ¦\StringStrip{\testmacro}¦

   \subject{Lua utilities.strings.striplong passed TeX buffer}
   ¦\StringsStripLong{\getbuffer[testbuffer]}¦

   \subject{Lua utilities.strings.striplong passed TeX macro}
   ¦\StringsStripLong{\testmacro}¦

   \stoptext

--
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Trimming strings and Lua string.trim question

2014-03-06 Thread Wolfgang Schuster

Am 06.03.2014 um 16:04 schrieb Rik Kabel cont...@rik.users.panix.com:

 Could you please ensure that this handles text in buffers the same way that 
 it handles other strings? I noticed that this is handled a bit differently, 
 as the following shows,but perhaps it is my clumsy coding. The buffer result 
 is closer to what I expect in terms of internal whitespace, but still does 
 not show expected trimming of leading and trailing whitespace. That trimming, 
 of course, is the point of the exercise.

This can’t work because \getbuffer is a unexpandable command and what you pass 
to Lua is the string

  \getbuffer[testbuffer]

and not the content of the buffer. When you want to manipulate the content of a 
buffer you have to access the content at the Lua side with the 
buffers.getcontent(…) function.

BTW: You don’t need \long in MkIV because definitions use it by default.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug: Columnar itemized text

2014-03-06 Thread Thangalin
Fixed.

Thank you!
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] option suggestion for \setupindenting

2014-03-06 Thread Pablo Rodriguez
On 03/06/2014 08:38 PM, Wolfgang Schuster wrote:
 Am 06.03.2014 um 19:35 schrieb Pablo Rodriguez:

  \leftskip2em
  \parindent-2em

 Would it be possible to have a reverse option in \setupindenting, whic
 could be applied with the other options?

 Many thanks for your help,
 
 \definestartstop
   [weird]
   [before={\startnarrow[left=2em,default=left]\setupindenting[yes,-2em]},
after={\stopnarrow}]
 
 \setupindenting[yes,2em]

Many thanks for your fast reply, Wolfgang.

I have a book that I want to typeset using ConTeXt, to show its author
the results.

\leftskip and \parindent work fine for me. The problem is the length. I
need the reverse indenting only in the final chapter (it’s a book list,
that I would like to avoid to input as a BibTeX bibliography).

The book will have a general \setupindenting, but I don’t know whether
it will be small, medium or big. And in the last chapter, I want this
vaules to be the same, but with a reverse indenting.

Here is the sample.

\setupindenting[yes,medium]

\starttext

\dorecurse{5}{\input knuth\par}

I can change indenting value, but I cannot get an inverse indenting.

\setupindenting[yes,small]

\dorecurse{5}{\input knuth\par}

\stoptext


I think that \setupindenting[reverse] makes sense as an option. So the
user can set inverse indentings for the whole document. And (s)he will
have to change the value only once, if applied before as standard indenting.

Many thanks for your help again,


Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] option suggestion for \setupindenting

2014-03-06 Thread Hans Hagen

On 3/6/2014 9:06 PM, Pablo Rodriguez wrote:

On 03/06/2014 08:38 PM, Wolfgang Schuster wrote:

Am 06.03.2014 um 19:35 schrieb Pablo Rodriguez:


\leftskip2em
\parindent-2em

Would it be possible to have a reverse option in \setupindenting, whic
could be applied with the other options?

Many thanks for your help,


\definestartstop
   [weird]
   [before={\startnarrow[left=2em,default=left]\setupindenting[yes,-2em]},
after={\stopnarrow}]

\setupindenting[yes,2em]


Many thanks for your fast reply, Wolfgang.

I have a book that I want to typeset using ConTeXt, to show its author
the results.

\leftskip and \parindent work fine for me. The problem is the length. I
need the reverse indenting only in the final chapter (it’s a book list,
that I would like to avoid to input as a BibTeX bibliography).

The book will have a general \setupindenting, but I don’t know whether
it will be small, medium or big. And in the last chapter, I want this
vaules to be the same, but with a reverse indenting.

Here is the sample.

 \setupindenting[yes,medium]

 \starttext

 \dorecurse{5}{\input knuth\par}

 I can change indenting value, but I cannot get an inverse indenting.

 \setupindenting[yes,small]

 \dorecurse{5}{\input knuth\par}

 \stoptext


I think that \setupindenting[reverse] makes sense as an option. So the
user can set inverse indentings for the whole document. And (s)he will
have to change the value only once, if applied before as standard indenting.


reverse is a somewhat weird option specific for your case; what if you 
also want to change other things; better is:


\defineindenting[whatever][yes,2cm]
%defineindenting[whatever][yes,-2cm]

\starttext
\setupindenting[yes,-2em] \input ward \par
\setupindenting[yes,2em]  \input ward \par
\setupindenting[whatever] \input ward \par
\stoptext

so i'll make a \defineindenting
-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Problem with an environment

2014-03-06 Thread Fabrice Couvreur
I'm trying to built a template for evaluations of my students.
I have a problem with the head environment that does not take into account
the selected font and size.
Regards,
Fabrice


\environment environ-2

\environment environ-3

\environment header

\starttext

\MyOtherHeader{Seconde GTA}{20}{3}{2014}{{\ss \tfd \bf Correction du devoir
maison de Mathématiques} }{{\ss \bf \tfd 9}}

\startex
 \input knuth
 \stopex
\stoptext

##

\startenvironment environ-2

\loadtypescriptfile[mathdesign]

\definetypeface [mainface] [rm] [serif] [palatino] [default]

\definetypeface [mainface] [tt] [mono]  [modern] [default] [rscale=0.9]

\definetypeface [mainface] [mm] [math]  [xits] [default]

\setupbodyfont[mainface,11pt]

\setuppagenumbering[location=]

\setupexternalfigures[location={local,global,default}]

\setupexternalfigures[directory=/home/fab/Seconde/2013_2014/Figures/]

\mainlanguage[fr]

\stopenvironment


Thanks Hans for this header


% macros=mkvi

\startenvironment header

\environment environ-2

\starttexdefinition MyOtherHeader #where #day #month #year #title #number

\defineoverlay[whatever][\useMPgraphic{whatever}]

\startuseMPgraphic{whatever}
 path p;
 p:=fullsquare xyscaled (\overlaywidth,\overlayheight) squeezed 1pt;
 fill p withcolor white ;
 draw p withpen pencircle scaled 2pt withcolor 0.625white ;
 picture d ;
 d :=
textext(\quad#where\space\endash\space\date[d=#day,m=#month,y=#year]\quad)
 shifted .5[ulcorner p,urcorner p];
 fill boundingbox d withcolor white ; draw d ;
setbounds currentpicture to p ;
\stopuseMPgraphic

\framed [
width=\hsize,
height=5em,
foregroundstyle=\itxx,
background=whatever,
frame=off,
]
   {#title
\space
{\ss\tfc\bf n \high{\tfa \bf o}}
\space
#number
}

\stoptexdefinition

\stopenvironment


Thanks Wolfgang for this environment

#
\startenvironment environ-3

\defineenumeration
  [ex]
  [text={Exercice},
   headstyle={\bf\feature[+][f:smallcaps]},
   inbetween={\blank[small]},
   stopper={.}]



\stopenvironment

#
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___