Re: [NTG-context] letters in context mkiv

2017-07-31 Thread Schmitz Thomas A.

> On 31. Jul 2017, at 18:58, r.erm...@hccnet.nl wrote:
> 
> Would it be wise to perhaps follow the path set out by Thomas? In that case 
> there should be a way to shift the address.

What efforts have you made to “shift the address”? Here is one way:

\startbuffer[participants]

  
Hendriks
Karel
mr.
K.
Arnhem

  Mr. K. Hendriks
  Grotestraat 5
  1234 BB Arnhem

1234bb5
  
  
Janssen
Piet
P.
mr.
Nijmegen

 Mr. P. Janssen
 Kortestraat 8
 1234 AA Nijmegen

1234aa8
  

\stopbuffer

\startxmlsetups xml:setups
\xmlsetsetup{#1}{contacts|contact|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setups}

\startxmlsetups xml:contacts
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
\xmlflush{#1}\par
\stopxmlsetups

\startxmlsetups xml:contact

\setlayer[address][x=20mm,y=40mm]{\framed[width=74mm,height=35mm,frame=on,offset=2mm,align=right]{\ignorespaces\xmltext{#1}{/address}}}
\strut
\blank [35mm]
Subject: your life in \xmltext{#1}{/city}
\blank [2*line]
Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},
\blank [line]
\input knuth \relax

Kind regards
\blank [line]
X
\page
\stopxmlsetups

\setuppagenumbering [state=stop]

\definelayer[address][width=\paperwidth,height=\paperheight]

\setupbackgrounds [page][background={address}]

\starttext
\xmlprocessbuffer{main}{participants}{}

\stoptext

I still don’t see you trying to learn a new language one step at a time. 

Thomas
___
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] \startplacefloat query

2017-07-31 Thread Alan Bowen
Thanks, Aditya. That is a great help!

Alan


On Mon, Jul 31, 2017 at 4:43 PM, Aditya Mahajan  wrote:

> On Mon, 31 Jul 2017, Alan Bowen wrote:
>
> When placing a float to the left or right of text, is there a way to place
>> a given number of lines of text directly above it? Or is this not the
>> right
>> mechanism to achieve this?
>>
>
> Using 3*hang instead of 3*line
>
> What I have now is:
>> \starttext
>> \startplacefigure[title=Cow,
>> location={left, 3*line, force, high}]
>> {\externalfigure[cow.pdf][width=.2\textwidth]}
>> \stopplacefigure
>> \input knuth
>> \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/list
> info/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] \startplacefloat query

2017-07-31 Thread Aditya Mahajan

On Mon, 31 Jul 2017, Alan Bowen wrote:


When placing a float to the left or right of text, is there a way to place
a given number of lines of text directly above it? Or is this not the right
mechanism to achieve this?


Using 3*hang instead of 3*line


What I have now is:
\starttext
\startplacefigure[title=Cow,
location={left, 3*line, force, high}]
{\externalfigure[cow.pdf][width=.2\textwidth]}
\stopplacefigure
\input knuth
\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] \startplacefloat query

2017-07-31 Thread Alan Bowen
When placing a float to the left or right of text, is there a way to place
a given number of lines of text directly above it? Or is this not the right
mechanism to achieve this?

What I have now is:
\starttext
\startplacefigure[title=Cow,
location={left, 3*line, force, high}]
{\externalfigure[cow.pdf][width=.2\textwidth]}
\stopplacefigure
\input knuth
\stoptext

which gives:

   X
   x
   x
[cow image] x
   x
   x
x
x


What I would prefer is a pattern like this:

X
x
   x
[cow image] x
   x
   x
x
x

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

2017-07-31 Thread Aditya Mahajan

On Mon, 31 Jul 2017, Fabrice Couvreur wrote:


https://tex.stackexchange.com/questions/84425/fancyhdr-equivalent-in-context

Hello,
I considered the solution proposed by Aditya. How to have a larger space
between the title and the bottomframe ?


What do you mean by "title"? If you mean the space between the bottom rule 
of the header and where the text starts in the page, you can change that 
using


\setuplayout
   [
 ...,
 headerdistance=...,
 
   ]

If you mean the space between the header and the bottom frame of the 
header, you can play around with


\defineframed
[headerframed]
[
  ...,
  bottomoffset=...,
  ...,
]


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] Bibliography in MKIV, custom rendering

2017-07-31 Thread Gerion Entrup
Am Montag, 31. Juli 2017, 04:23:16 CEST schrieb Gerion Entrup:
> Hi,
> 
> I need your help again. I've a bibliography and some entries references to 
> websites. Unfortunately the URL is not always rendered and the name ist 
> always 
> parsed as name of a person, not from an organisation etc.
> 
> What I want to achieve is to use the standard aps style, but with 
> additionally 
> the following two rules:
> 1. The name is always rendered without abbrevations (I guess, this is 
> authorconversion=normal).
> 2. If an URL is given, it is always rendered.
> 
> My input is a bib-file. Here is a minimal example:
> 
> input.bib
> ```
> @misc{objective-c,
> author = "Apple Inc.",
> note = "Online; accessed at 31-July-2017",
> title = "About Objective-C",
> url = 
> "https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html;,
> year = "2014"
> }
> ```
> 
> test.tex
> ```
> \usebtxdataset[default][input.bib]
> \usebtxdefinitions[aps]
> \setupbtx[default:cite][alternative=num]
> \setupbtx[default:list][authorconversion=normal]
> 
> \starttext
> According to Apple Inc., Objective-C is the main programming language, when 
> writing software for MacOS~\cite[objective-c].
> 
> \placelistofpublications
> \stoptext
> ```
> 
> I've tried to understand the manual, yout can see some of my attempts in the 
> minimal example. But I don't get really far.
> 
> Can you give me a hint?

I have "fixed" this with directly modifying the publ-imp-aps.mkvi. I guess,
this is the worst way to achive this thing, but I don't know a better one.

Here is the patch, if someone is interested.

Gerion

--- publ-imp-aps.mkvi.original  2017-07-31 21:23:14.736856430 +0200
+++ publ-imp-aps.mkvi   2017-07-31 21:24:46.860462851 +0200
@@ -58,7 +58,7 @@
 \definebtx
   [aps:\s!list]
   [aps]
-  [\c!authorconversion=normalshort]
+  [\c!authorconversion=normal]
 
 \definebtx
   [aps:\s!list:author]
@@ -1117,6 +1117,12 @@
 
 \startsetups btx:aps:list:misc
 \fastsetup{btx:aps:list:electronic}
+\btxdoif {url} {
+\btxspace
+\btxleftparenthesis
+\goto{\hyphenatedurl{\btxflush{url}}}[url(\btxflush{url})]
+\btxrightparenthesis
+}
 % Note that organization is an "ignored" field.
 \stopsetups

___
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] Kerning between primes and left parenthesis (again)

2017-07-31 Thread Mikael P. Sundqvist
On Mon, Jul 31, 2017 at 9:15 PM, Hans Hagen  wrote:
> On 7/31/2017 8:02 PM, Mikael P. Sundqvist wrote:
>>
>> On Mon, Jul 31, 2017 at 5:37 PM, Hans Hagen  wrote:
>>>
>>> On 7/31/2017 11:21 AM, Mikael P. Sundqvist wrote:


 On Thu, Jul 20, 2017 at 2:53 PM, Hans Hagen  wrote:
>
>
> On 7/20/2017 7:18 AM, Mikael P. Sundqvist wrote:
>
>> Den 12 juli 2017 10:17 fm skrev "Mikael P. Sundqvist"
>> > >:
>>
>>   Dear Hans,
>>
>>   now, in luatex 1.05, that the primes are "constructed" in new
>> manner,
>>   I wonder if there is a way to specify in a goodie file the
>> kerning
>>   between characters, in particular primes and the left
>> parenthesis?
>>
>>   I tried
>>
>>kernpairs = {
>>   [0x2032] = {[0x0028] = -1000, }, -- prime and (
>>},
>>
>>   but that does not seem to have any effect.
>>
>>   The pre-1.05 modification
>>
>>dimensions = {
>>default = {
>>[0x2044] = { xoffset = 275, width = 600 },
>>[0x2032] = { xoffset = 50, width = 290 }, --
>> prime
>>[0x2033] = { xoffset = 50, width = 690 }, --
>> double
>>   prime
>>[0x2034] = { xoffset = 50, width = 1090}, --
>> triple
>>   prime
>>[0x2057] = { xoffset = 50, width = 1490}, --
>>   quadruple prime
>>},
>>},
>>
>>   (which is a non-optimal way of solving this issue since it has
>> side
>>   effects) does not change anything anymore.
>>
>>   So, is there now a way to do this cleanly now that the mechanism
>> is
>>   changed?
>>
>>   /Mikael
>>
>>
>> Hi,
>>
>> should I interpret the silence that this is currently not possible, or
>> that you, Hans, is completely fed up with this subject? :-)
>
>
>
> you rule out the possibility that i have other things to do
>
> anyway, use
>
>   0xFE932
>
> etc instead as primes get remapped
>
> -
> 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
>
>
> ___



 I'm sorry but I cannot get it to work.

 %%% my local lucida-opentype-math.lfg, located in the same directory
 as the tex file (and loaded)
 - kern_250 = { bottomright = { { kern = -250 } }, force = true }

 local function FixRadicalDisplayStyleVerticalGap(value,target,original)
   local o = original.mathparameters.RadicalVerticalGap -- 50
   return 2 * o * target.parameters.factor
 end

 return {
   name = "lucida-opentype-math",
   version = "1.00",
   comment = "Goodies that complement lucida opentype.",
   author = "Hans Hagen",
   copyright = "ConTeXt development team",
   mathematics = {
   parameters = {
   RadicalDisplayStyleVerticalGap =
 FixRadicalDisplayStyleVerticalGap,
   },
   kernpairs = {
  [0x1D44E] = {[0x1D44F] = 1000,}, -- 푎푏 demo
  [0xFE932] = {[0x0028] = 1000,} -- remapped prime and (
   },
 }
 }
 %%%

 %%% the tex file
 \setupbodyfont[lucidaot]
 \setupmathematics[kernpairs=yes]

 \starttext
 $f'(x)ab$
 \stoptext
 %%%

 The result is attached. It works ok for the pair ab, but not for prime
 and (. Is the ( also remapped (while greping for it in the source, I
 could not find any clue).

 Maybe it is better to ping the maintainers of the font?
>>>
>>>
>>> just change the dimensions
>>>
>>>  dimensions = {
>>>  default = { -- experimental values
>>>  [0x2044] = { xoffset = 275, width = 600 },
>>>  

Re: [NTG-context] Kerning between primes and left parenthesis (again)

2017-07-31 Thread Hans Hagen

On 7/31/2017 8:02 PM, Mikael P. Sundqvist wrote:

On Mon, Jul 31, 2017 at 5:37 PM, Hans Hagen  wrote:

On 7/31/2017 11:21 AM, Mikael P. Sundqvist wrote:


On Thu, Jul 20, 2017 at 2:53 PM, Hans Hagen  wrote:


On 7/20/2017 7:18 AM, Mikael P. Sundqvist wrote:


Den 12 juli 2017 10:17 fm skrev "Mikael P. Sundqvist" >:

  Dear Hans,

  now, in luatex 1.05, that the primes are "constructed" in new
manner,
  I wonder if there is a way to specify in a goodie file the kerning
  between characters, in particular primes and the left parenthesis?

  I tried

   kernpairs = {
  [0x2032] = {[0x0028] = -1000, }, -- prime and (
   },

  but that does not seem to have any effect.

  The pre-1.05 modification

   dimensions = {
   default = {
   [0x2044] = { xoffset = 275, width = 600 },
   [0x2032] = { xoffset = 50, width = 290 }, -- prime
   [0x2033] = { xoffset = 50, width = 690 }, --
double
  prime
   [0x2034] = { xoffset = 50, width = 1090}, --
triple
  prime
   [0x2057] = { xoffset = 50, width = 1490}, --
  quadruple prime
   },
   },

  (which is a non-optimal way of solving this issue since it has side
  effects) does not change anything anymore.

  So, is there now a way to do this cleanly now that the mechanism is
  changed?

  /Mikael


Hi,

should I interpret the silence that this is currently not possible, or
that you, Hans, is completely fed up with this subject? :-)



you rule out the possibility that i have other things to do

anyway, use

  0xFE932

etc instead as primes get remapped

-
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

___



I'm sorry but I cannot get it to work.

%%% my local lucida-opentype-math.lfg, located in the same directory
as the tex file (and loaded)
- kern_250 = { bottomright = { { kern = -250 } }, force = true }

local function FixRadicalDisplayStyleVerticalGap(value,target,original)
  local o = original.mathparameters.RadicalVerticalGap -- 50
  return 2 * o * target.parameters.factor
end

return {
  name = "lucida-opentype-math",
  version = "1.00",
  comment = "Goodies that complement lucida opentype.",
  author = "Hans Hagen",
  copyright = "ConTeXt development team",
  mathematics = {
  parameters = {
  RadicalDisplayStyleVerticalGap =
FixRadicalDisplayStyleVerticalGap,
  },
  kernpairs = {
 [0x1D44E] = {[0x1D44F] = 1000,}, -- 푎푏 demo
 [0xFE932] = {[0x0028] = 1000,} -- remapped prime and (
  },
}
}
%%%

%%% the tex file
\setupbodyfont[lucidaot]
\setupmathematics[kernpairs=yes]

\starttext
$f'(x)ab$
\stoptext
%%%

The result is attached. It works ok for the pair ab, but not for prime
and (. Is the ( also remapped (while greping for it in the source, I
could not find any clue).

Maybe it is better to ping the maintainers of the font?


just change the dimensions

 dimensions = {
 default = { -- experimental values
 [0x2044] = { xoffset = 275, width = 600 },
  -- [0x2032] = { yoffset = -10 },
[0xFE932] = { width = 200 },
[0xFE933] = { width = 500 },
[0xFE934] = { width = 800 },
 },
 },



-
   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

Re: [NTG-context] Kerning between primes and left parenthesis (again)

2017-07-31 Thread Mikael P. Sundqvist
On Mon, Jul 31, 2017 at 5:37 PM, Hans Hagen  wrote:
> On 7/31/2017 11:21 AM, Mikael P. Sundqvist wrote:
>>
>> On Thu, Jul 20, 2017 at 2:53 PM, Hans Hagen  wrote:
>>>
>>> On 7/20/2017 7:18 AM, Mikael P. Sundqvist wrote:
>>>
 Den 12 juli 2017 10:17 fm skrev "Mikael P. Sundqvist" >:

  Dear Hans,

  now, in luatex 1.05, that the primes are "constructed" in new
 manner,
  I wonder if there is a way to specify in a goodie file the kerning
  between characters, in particular primes and the left parenthesis?

  I tried

   kernpairs = {
  [0x2032] = {[0x0028] = -1000, }, -- prime and (
   },

  but that does not seem to have any effect.

  The pre-1.05 modification

   dimensions = {
   default = {
   [0x2044] = { xoffset = 275, width = 600 },
   [0x2032] = { xoffset = 50, width = 290 }, -- prime
   [0x2033] = { xoffset = 50, width = 690 }, --
 double
  prime
   [0x2034] = { xoffset = 50, width = 1090}, --
 triple
  prime
   [0x2057] = { xoffset = 50, width = 1490}, --
  quadruple prime
   },
   },

  (which is a non-optimal way of solving this issue since it has side
  effects) does not change anything anymore.

  So, is there now a way to do this cleanly now that the mechanism is
  changed?

  /Mikael


 Hi,

 should I interpret the silence that this is currently not possible, or
 that you, Hans, is completely fed up with this subject? :-)
>>>
>>>
>>> you rule out the possibility that i have other things to do
>>>
>>> anyway, use
>>>
>>>  0xFE932
>>>
>>> etc instead as primes get remapped
>>>
>>> -
>>>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
>>>
>>> ___
>>
>>
>> I'm sorry but I cannot get it to work.
>>
>> %%% my local lucida-opentype-math.lfg, located in the same directory
>> as the tex file (and loaded)
>> - kern_250 = { bottomright = { { kern = -250 } }, force = true }
>>
>> local function FixRadicalDisplayStyleVerticalGap(value,target,original)
>>  local o = original.mathparameters.RadicalVerticalGap -- 50
>>  return 2 * o * target.parameters.factor
>> end
>>
>> return {
>>  name = "lucida-opentype-math",
>>  version = "1.00",
>>  comment = "Goodies that complement lucida opentype.",
>>  author = "Hans Hagen",
>>  copyright = "ConTeXt development team",
>>  mathematics = {
>>  parameters = {
>>  RadicalDisplayStyleVerticalGap =
>> FixRadicalDisplayStyleVerticalGap,
>>  },
>>  kernpairs = {
>> [0x1D44E] = {[0x1D44F] = 1000,}, -- 푎푏 demo
>> [0xFE932] = {[0x0028] = 1000,} -- remapped prime and (
>>  },
>> }
>> }
>> %%%
>>
>> %%% the tex file
>> \setupbodyfont[lucidaot]
>> \setupmathematics[kernpairs=yes]
>>
>> \starttext
>> $f'(x)ab$
>> \stoptext
>> %%%
>>
>> The result is attached. It works ok for the pair ab, but not for prime
>> and (. Is the ( also remapped (while greping for it in the source, I
>> could not find any clue).
>>
>> Maybe it is better to ping the maintainers of the font?
>
> just change the dimensions
>
> dimensions = {
> default = { -- experimental values
> [0x2044] = { xoffset = 275, width = 600 },
>  -- [0x2032] = { yoffset = -10 },
> [0xFE932] = { width = 200 },
> [0xFE933] = { width = 500 },
> [0xFE934] = { width = 800 },
> },
> },
>
>
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> 

Re: [NTG-context] letters in context mkiv

2017-07-31 Thread Pablo Rodriguez
On 07/31/2017 06:58 PM, r.erm...@hccnet.nl wrote:
> Dear Pablo,
> 
> Thank you for your insightful remarks. I tried your suggestions. As
> you predicted, the Knuth tex is processed when put here, without using
> the buffer mechanism.

Dear Robert,

it wasn’t a prediction, I tested it myself ;-).

> Yet any codes (\TeX\) are not. 
> 
> Nevertheless, I consider this a step forward. In the same way, my
> letter texts, which contain regular codes, such as \startitemize …
> \stopitemize and {\bf bold} are not processed properly.
> 
> The whole thing is much more complicated than I thought. Wolfgang
> already mentioned that the letter module is not specifically equipped
> for xml.

What I would like to know is how one can get full expansion (I
experienced your issue before in another scenario).

Or at least, I want to know why only the first level of commands is
expanded. (An \expandafter or something like that?)

> Would it be wise to perhaps follow the path set out by Thomas? In
> that case there should be a way to shift the address.

You may use layers to locate the address where you want.

Or even you may use an extra margin (it cannot be that hard).

Just in case it helps,

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] (again) \typebufferinline for XML inline code

2017-07-31 Thread Pablo Rodriguez
Hans,

sorry for asking for this again, but I really need it to write some
documents about ConTeXt.

I have the following sample:

\startTEXpage[offset=1em]
only \type{a

b

c} one line
\stopTEXpage
\stoptext

\type

Would it be possible to have a new \typebufferinline that behaves such
as \type above (and has the same options in \setuptype)?

The most important part isn’t the suppression of line breaks inside, but
avoiding the addition of line breaks after and before the typed buffer.

I have been reading buff-ver.mkiv, but I’m afraid I cannot contribute
such a patch.

This is essential to have \xmlprettyprintinline and
\xmlprettyprintinlinetext in order to handle inline code in XML.

Many thanks for your help,

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] letters in context mkiv

2017-07-31 Thread r . ermers
Dear Pablo,

Thank you for your insightful remarks. I tried your suggestions. As you 
predicted, the Knuth tex is processed when put here, without using the buffer 
mechanism.

\startsetups[letter:section:content]
\input knuth \relax
\stopsetups

Yet any codes (\TeX\) are not. 

Nevertheless, I consider this a step forward. In the same way, my letter texts, 
which contain regular codes, such as \startitemize … \stopitemize and {\bf 
bold} are not processed properly.

The whole thing is much more complicated than I thought. Wolfgang already 
mentioned that the letter module is not specifically equipped for xml.

Would it be wise to perhaps follow the path set out by Thomas? In that case 
there should be a way to shift the address.

Regards,

Robert



___
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] Kerning between primes and left parenthesis (again)

2017-07-31 Thread Hans Hagen

On 7/31/2017 11:21 AM, Mikael P. Sundqvist wrote:

On Thu, Jul 20, 2017 at 2:53 PM, Hans Hagen  wrote:

On 7/20/2017 7:18 AM, Mikael P. Sundqvist wrote:


Den 12 juli 2017 10:17 fm skrev "Mikael P. Sundqvist" >:

 Dear Hans,

 now, in luatex 1.05, that the primes are "constructed" in new manner,
 I wonder if there is a way to specify in a goodie file the kerning
 between characters, in particular primes and the left parenthesis?

 I tried

  kernpairs = {
 [0x2032] = {[0x0028] = -1000, }, -- prime and (
  },

 but that does not seem to have any effect.

 The pre-1.05 modification

  dimensions = {
  default = {
  [0x2044] = { xoffset = 275, width = 600 },
  [0x2032] = { xoffset = 50, width = 290 }, -- prime
  [0x2033] = { xoffset = 50, width = 690 }, -- double
 prime
  [0x2034] = { xoffset = 50, width = 1090}, -- triple
 prime
  [0x2057] = { xoffset = 50, width = 1490}, --
 quadruple prime
  },
  },

 (which is a non-optimal way of solving this issue since it has side
 effects) does not change anything anymore.

 So, is there now a way to do this cleanly now that the mechanism is
 changed?

 /Mikael


Hi,

should I interpret the silence that this is currently not possible, or
that you, Hans, is completely fed up with this subject? :-)


you rule out the possibility that i have other things to do

anyway, use

 0xFE932

etc instead as primes get remapped

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


I'm sorry but I cannot get it to work.

%%% my local lucida-opentype-math.lfg, located in the same directory
as the tex file (and loaded)
- kern_250 = { bottomright = { { kern = -250 } }, force = true }

local function FixRadicalDisplayStyleVerticalGap(value,target,original)
 local o = original.mathparameters.RadicalVerticalGap -- 50
 return 2 * o * target.parameters.factor
end

return {
 name = "lucida-opentype-math",
 version = "1.00",
 comment = "Goodies that complement lucida opentype.",
 author = "Hans Hagen",
 copyright = "ConTeXt development team",
 mathematics = {
 parameters = {
 RadicalDisplayStyleVerticalGap = FixRadicalDisplayStyleVerticalGap,
 },
 kernpairs = {
[0x1D44E] = {[0x1D44F] = 1000,}, -- 푎푏 demo
[0xFE932] = {[0x0028] = 1000,} -- remapped prime and (
 },
}
}
%%%

%%% the tex file
\setupbodyfont[lucidaot]
\setupmathematics[kernpairs=yes]

\starttext
$f'(x)ab$
\stoptext
%%%

The result is attached. It works ok for the pair ab, but not for prime
and (. Is the ( also remapped (while greping for it in the source, I
could not find any clue).

Maybe it is better to ping the maintainers of the font?

just change the dimensions

dimensions = {
default = { -- experimental values
[0x2044] = { xoffset = 275, width = 600 },
 -- [0x2032] = { yoffset = -10 },
[0xFE932] = { width = 200 },
[0xFE933] = { width = 500 },
[0xFE934] = { width = 800 },
},
},


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

Re: [NTG-context] Couple of questions

2017-07-31 Thread Jan Willem Flamma
Dear Pablo,

I experienced the same caption numbering issue late 2015.
See https://www.mail-archive.com/ntg-context@ntg.nl/msg80129.html 
 and 
https://www.mail-archive.com/ntg-context@ntg.nl/msg80131.html 


Can’t really recall exactly but probably found the answer eventually via the 
test suite (see http://www.pragma-ade.com/download-1.htm 
)

Regards,
Jan Willem



> On 31 Jul 2017, at 17:15, Pablo Rodriguez  wrote:
> 
> On 07/31/2017 08:01 AM, Jan Willem Flamma wrote:
>> Dear Gerion,
>> 
>> Add 
>> 
>> \setuphead[subsubsection]
>>[incrementnumber=no]
> 
> Dear Jan Willem,
> 
> do you have an explanation for that behaviour?
> 
> At least to me, it isn’t very intuitive (I’m trying to understand).
> 
> Many thanks for your help,
> 
> 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://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] letters in context mkiv

2017-07-31 Thread Pablo Rodriguez
On 07/31/2017 12:48 PM, r.erm...@hccnet.nl wrote:
> Dear Contex’ers,
> 
> This morning I have been experimenting with the solutions suggested by
> Thomas and Wolfgang.
> 
> Thomas’ solution works, it produces two distinct letters, yet the
> address is probably on another layer. This means that it is not shifted
> to the right, at least not with the command
> (\setupletterlayer[address]), so that it will be visible through the
> envelope window.
> 
> With Wolfgang’s solution the address is moved to its desired place, and
> the letter text is printed as well.
> 
> However, inserting a text (by means of \input) is problematic (see pdf),
> with or without \relax.

Hi Robert,

it isn’t the use of \input. The problem is that you only get one level
of expansion.

If you add \input directly to letter:section:content, such as in:

\startsetups[letter:section:content]
\input knuth \relax
\stopsetups

You will have \input expanded. But in the text itself \TeX\ and
large||scale won’t be expanded.

I have no idea why this happens. And I don’t know how to fix it. Maybe
Wolfgang knows what is happening here.

If I had to guess, it might be that \directsetups only allows a level of
expansion. But I may be plainly wrong.

A way to avoid the issue is to add the letter content directly to the
\startsetups[letter:section:context]. And rememmber that you have only
one level of expansion.

Just in case it might help,

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Couple of questions

2017-07-31 Thread Pablo Rodriguez
On 07/31/2017 08:01 AM, Jan Willem Flamma wrote:
> Dear Gerion,
> 
> Add 
> 
> \setuphead[subsubsection]
> [incrementnumber=no]

Dear Jan Willem,

do you have an explanation for that behaviour?

At least to me, it isn’t very intuitive (I’m trying to understand).

Many thanks for your help,

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Couple of questions

2017-07-31 Thread Gerion Entrup
Am Montag, 31. Juli 2017, 08:01:49 CEST schrieb Jan Willem Flamma:
> Dear Gerion,
> 
> Add 
> 
> \setuphead[subsubsection]
> [incrementnumber=no]
This works :). Thank you very much!


Gerion

> > On 30 Jul 2017, at 22:51, Gerion Entrup  wrote:
> > 
> > Am Samstag, 29. Juli 2017, 11:13:21 CEST schrieb Pablo Rodriguez:
> >> On 07/29/2017 04:45 AM, Gerion Entrup wrote:
> >>> Was not that simple, but I found the problem, that causes it:
> >>> subsubsections without numbers.
> >>> [...]
> >>> Is there a way to fix this?
> >> 
> >> I would say this may be a bug.
> > Does someone know a way to workaround?
> > 
> > This only way I see is to simply simulate a subsubsection (with some blanks
> > and a big font).
> > 
> > Gerion
> > 
> > 
> >> I don’t know how it is implemented, but prefixsegments (or prefixes) for
> >> captions only work when number is enabled.
> >> 
> >> This makes sense if the section is part of the prefixsegments, but not
> >> if it isn’t.
> >> 
> >> Another sample that shows the problem:
> >> 
> >>\mainlanguage[de]
> >>\setupexternalfigures[location=default]
> >>\setuphead[subsection][number=no]
> >>\setupcaptions[prefixsegments=chapter]
> >>\setuphead[subsubsection][number=yes]
> >> 
> >>\starttext
> >> 
> >>\chapter[title=Kapitel]
> >>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
> >> 
> >>\section[title=Abschnitt]
> >>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
> >> 
> >>\subsection[title=Hier gibt’s ein Problem]
> >>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
> >> 
> >>\subsection[title=Und hier gibt’s ein Problem auch]
> >>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
> >> 
> >>\subsubsection[title=Aber hier gibt’s kein Problem]
> >>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
> >>\stoptext
> >> 
> >> If this isn’t a bug, the code to avoid the problem is too tricky for me
> >> (and simply far beyond my knowledge).
> >> 
> >> Excuse my ignorance,
> >> 
> >> Pablo
> >> 
> > 
> > 
> > ___
> > 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
> ___


___
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] letters in context mkiv

2017-07-31 Thread r . ermers
Dear Contex’ers,This morning I have been experimenting with the solutions suggested by Thomas and Wolfgang.Thomas’ solution works, it produces two distinct letters, yet the address is probably on another layer. This means that it is not shifted to the right, at least not with the command (\setupletterlayer[address]), so that it will be visible through the envelope window.With Wolfgang’s solution the address is moved to its desired place, and the letter text is printed as well.However, inserting a text (by means of \input) is problematic (see pdf), with or without \relax.I then experimented with alternatives like \startbuffer[lettercontent] … endbuffer. The \input problem remains: it appears that the buffer takes any command (\foo) as literal text.I tried moving the setbuffer … endbuffer part to elswhere in the document. I also experimented with \input a sample text of my own on my harddisk. I tried deleting the \placeletter command - no difference.So, I feel I am close, but not yet there, one more step …Robert\usemodule[letter]\startbuffer[participants]      Hendriks    Karel    mr.    K.    Arnhem      Mr. K. Hendriks  Grotestraat 5  1234 BB Arnhem        1234bb5        Janssen    Piet    P.    mr.    Nijmegen     Mr. P. Janssen Kortestraat 8 1234 AA Nijmegen        1234aa8  \stopbuffer\startxmlsetups xml:setups\xmlsetsetup{#1}{document|contacts|contact|prefix|initials|address|city|text|kix|p}{xml:*}\stopxmlsetups\xmlregistersetup{xml:setups}\setuplettersection[content][alternative=setups]\startsetups[letter:layer:address]    \correspondenceparameter{toname}\\    \correspondenceparameter{toaddress}\stopsetups\setuplettertext[en][date=]\setuplettertext[nl][date=]\startxmlsetups xml:contacts\xmlflush{#1}\stopxmlsetups\startxmlsetups xml:p\xmlflushtext{#1}\par\stopxmlsetups\setupletterlayer  [address]  [alternative=setups,   y=6cm,   x=12cm,   color=red,   style=\ss\tfa]\startsetups[letter:section:content]    \getbuffer[lettercontent]\stopsetups%\startbuffer[lettercontent]%content of the letter \xmltext{#1}{/city}%\input knuth \relax%\stopbuffer\startxmlsetups xml:contact    \setupletter  [toaddress={\xmlall{#1}{/address/p}\par  \xmltext{#1}{/kix}}, opening={Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},}, closing={Kind regards,}, subject={subject: your life in \xmltext{#1}{/city}},   signature={Herman}]\setbuffer[lettercontent]%This is the content of the letter.\input knuth \relax\endbuffer\placeletter\stopxmlsetups\setuppagenumbering [state=stop]\starttext\xmlprocessbuffer{main}{participants}{}\stoptext

brieven2mkiv3.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
___

[NTG-context] About \setupbackgrounds

2017-07-31 Thread Fabrice Couvreur
https://tex.stackexchange.com/questions/84425/fancyhdr-equivalent-in-context

Hello,
I considered the solution proposed by Aditya. How to have a larger space
between the title and the bottomframe ?
Thank you
Fabrice

\setupbodyfont[11pt]
\setupcolors[state=start]
\setuplayout
  [header=2\lineheight,
   headerdistance=\lineheight,
   backspace=2cm,
   width=middle,
   topspace=2cm]

\setupbackgrounds[header][text][frame=off, bottomframe=on]


\setupheader[style=bold]


\defineframed[headerframed]
 [frame=off,
  align=middle,
  width=fit]

\setupheadertexts[\headerframed{\red contrôle n\high{o}1 \\ }]
\setupheadertexts[\headerframed{Lycée JANSON DE SAILLY\\ 31 juillet
2017}][\headerframed{T ES 2 \\ Durée 1 heure 30}]

\starttext
\input knuth
\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] Kerning between primes and left parenthesis (again)

2017-07-31 Thread Mikael P. Sundqvist
On Thu, Jul 20, 2017 at 2:53 PM, Hans Hagen  wrote:
> On 7/20/2017 7:18 AM, Mikael P. Sundqvist wrote:
>
>> Den 12 juli 2017 10:17 fm skrev "Mikael P. Sundqvist" > >:
>>
>> Dear Hans,
>>
>> now, in luatex 1.05, that the primes are "constructed" in new manner,
>> I wonder if there is a way to specify in a goodie file the kerning
>> between characters, in particular primes and the left parenthesis?
>>
>> I tried
>>
>>  kernpairs = {
>> [0x2032] = {[0x0028] = -1000, }, -- prime and (
>>  },
>>
>> but that does not seem to have any effect.
>>
>> The pre-1.05 modification
>>
>>  dimensions = {
>>  default = {
>>  [0x2044] = { xoffset = 275, width = 600 },
>>  [0x2032] = { xoffset = 50, width = 290 }, -- prime
>>  [0x2033] = { xoffset = 50, width = 690 }, -- double
>> prime
>>  [0x2034] = { xoffset = 50, width = 1090}, -- triple
>> prime
>>  [0x2057] = { xoffset = 50, width = 1490}, --
>> quadruple prime
>>  },
>>  },
>>
>> (which is a non-optimal way of solving this issue since it has side
>> effects) does not change anything anymore.
>>
>> So, is there now a way to do this cleanly now that the mechanism is
>> changed?
>>
>> /Mikael
>>
>>
>> Hi,
>>
>> should I interpret the silence that this is currently not possible, or
>> that you, Hans, is completely fed up with this subject? :-)
>
> you rule out the possibility that i have other things to do
>
> anyway, use
>
> 0xFE932
>
> etc instead as primes get remapped
>
> -
>   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
> ___

I'm sorry but I cannot get it to work.

%%% my local lucida-opentype-math.lfg, located in the same directory
as the tex file (and loaded)
- kern_250 = { bottomright = { { kern = -250 } }, force = true }

local function FixRadicalDisplayStyleVerticalGap(value,target,original)
local o = original.mathparameters.RadicalVerticalGap -- 50
return 2 * o * target.parameters.factor
end

return {
name = "lucida-opentype-math",
version = "1.00",
comment = "Goodies that complement lucida opentype.",
author = "Hans Hagen",
copyright = "ConTeXt development team",
mathematics = {
parameters = {
RadicalDisplayStyleVerticalGap = FixRadicalDisplayStyleVerticalGap,
},
kernpairs = {
   [0x1D44E] = {[0x1D44F] = 1000,}, -- 푎푏 demo
   [0xFE932] = {[0x0028] = 1000,} -- remapped prime and (
},
}
}
%%%

%%% the tex file
\setupbodyfont[lucidaot]
\setupmathematics[kernpairs=yes]

\starttext
$f'(x)ab$
\stoptext
%%%

The result is attached. It works ok for the pair ab, but not for prime
and (. Is the ( also remapped (while greping for it in the source, I
could not find any clue).

Maybe it is better to ping the maintainers of the font?

/Mikael


ctx-listexample36.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] About Layout

2017-07-31 Thread Fabrice Couvreur
Hi Pablo,
Thank you for your answer.
You're right about the geometry package, here are the dimensions I get:


1 one inch + \ hoffset
2 \ oddsidemargin = -15pt
3 \ headheight = 26pt
4 \ textheight = 731pt
5 \ marginparsep = 10pt
6 \ footskip = 18pt
7 \ hoffset = 0pt
8 \ paperwidth = 597pt
9 one inch + \ voffset
10 \ topmargin = -52pt
11 \ headsep = 25pt
12 \ textwidth = 483pt
13 \ marginparwidth = 50pt
14 \ marginparpush = 5pt (not shown)
15 \ voffset = 0pt
16 \ paperheight = 845pt

Fabrice

2017-07-29 13:03 GMT+02:00 Pablo Rodriguez :

> On 07/29/2017 12:07 PM, Fabrice Couvreur wrote:
> > Hello,
> > With Latex, for my layout, I used this :
> >
> > \documentclass[a4paper,11pt]{article}
> > \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
> >
> > With Context, I did this :
> >
> > \setuppapersize[A4][A4]
> > \setuplayout
> >   [ topspace=2cm,
> > header=0pt,
> > footer=1.5cm,
> > bottomspace=0pt,
> > backspace=2cm,
> > cutspace=0pt,
> > width=middle]
> >
> > Is it correct ?
> Hi Fabrice,
>
> the \setuplayout values are fine. Do they contain the same dimensions as
> in the LaTeX geometry options? Let me see ;-).
>
> You remove header in ConTeXt, but it seems not to be removed in LaTeX.
> This may make a different point to start placing text in the page (if
> you have header space defined in LaTeX [whether you use it or not]).
>
> You set the footer in ConTeXt. I don’t remember where LaTeX places the
> page number and how LaTeX handles the footer. You might end having a
> different point to end placing text in the page.
>
> Paper size in ConTeXt defaults to A4, so you may remove that line.
>
> BTW, you forgot to mention \setupbodyfont[11pt]. Body font size defaults
> to 12pt in ConTeXt.
>
> A way to check this is the following sample:
>
> \setuplayout
> [topspace=2cm,
>  height=middle,
>  header=0pt,
>  footer=1.5cm,
>  backspace=2cm,
>  width=middle]
> \showframe
> \starttext
> \showlayout
> \input zapf
> \stoptext
>
> You don’t have to set bottomspace or cutspace with height or width set
> to middle.
>
> Just in case it helps,
>
> 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://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] letters in context mkiv

2017-07-31 Thread r . ermers
Thank you Thomas and Wolfgang,

About startletter / starttext: the contents of my test file reflect a moment. I 
have made numerous tests with and without starttext/stoptext. The state of the 
test file is one in an endless row of tests.

I am not without total experience in programing. I more or less understand 
program scripts when they are not too complicated and I like tweaking them, yet 
I cannot think up a new program from scratch.

But anyway, I will go ahead with your suggestions!

Thank you very much again!

Robert



> Op 30 jul. 2017, om 17:38 heeft Schmitz Thomas A. 
>  het volgende geschreven:
> 
> 
>> On 30. Jul 2017, at 14:15, r.erm...@hccnet.nl wrote:
>> 
>> Let me as a turcologist compare my problem to learning Kazakh: I am prepared 
>> to give you a manual with the grammatical rules, provide you with lists of 
>> nouns, verbs, adjectives and postpositions, explain the application of 
>> phonological rules, transliterations of the alphabet, give you a insight in 
>> the nominal cases and verb structure, and read with you a text in Kazakh. 
>> Nevertheless, without being rude, I bet that even then you are unable to 
>> flawlessly produce a poem or even a brief text in Kazakh yourself.
> 
> OK, I see your desperation, and I take your analogy (I’m a scholar myself, 
> not a programmer): if someone came to you with the Iliad and explained that 
> he doesn’t know a word of Kazakh but wants all of Homer’s poem, every line, 
> every word, every nuance, expressed in Kazakh with the help of a grammar and 
> a dictionary, you’d reply that this is not how learning languages works. You 
> begin with simple sentences and work your way up. You have shown us several 
> times examples that don’t work, and I have expressed my suspicion that this 
> may be due to using the correspondence module. You weren’t sure whether you 
> need it or not; which is something only you can know. What does this module 
> offer that can’t be accomplished otherwise? If you look at the documentation 
> of the module, you see that the \startletter … \stopletter pair starts an 
> environment within a \starttext … \stoptext context document. When you look 
> at your setup, you will see that you have a \startletter … \stopletter, then 
> a few setups, and then a \starttext … \stoptext document. I’m not a 
> programmer, but I see that this will not work. 
> 
> So for some simple rules: when you process an xml buffer (or document), you 
> define xmlsetups for the different xml elements. When you write 
> \xmlprocessbuffer, that’s when these elements will be processed - which 
> means: that’s when your document will be built. You can’t go through your xml 
> buffer/document and then add further text (well you can, but that’s more 
> complicated), so what you have to do is add your text (for the sake of this 
> example: \input knuth) WITHING THESE SETUPS. So let’s start with a simple 
> document that will work:
> 
> \startbuffer[participants]
> 
>  
>Hendriks
>Karel
>mr.
>K.
>Arnhem
>
>  Mr. K. Hendriks
>  Grotestraat 5
>  1234 BB Arnhem
>
>1234bb5
>  
>  
>Janssen
>Piet
>P.
>mr.
>Nijmegen
>
> Mr. P. Janssen
> Kortestraat 8
> 1234 AA Nijmegen
>
>1234aa8
>  
> 
> \stopbuffer
> 
> \startxmlsetups xml:setups
> \xmlsetsetup{#1}{contacts|contact|formalname|informalname|prefix|initials|address|city|text|kix|p}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:setups}
> 
> \startxmlsetups xml:contacts
>   \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:p
>   \xmlflush{#1}\par
> \stopxmlsetups
> 
> \startxmlsetups xml:contact
>   \xmltext{#1}{/address}
>   \blank [3*line]
>   Subject: your life in \xmltext{#1}{/city}
>   \blank [2*line]
>   Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},
>   \blank [line]
>   \input knuth \relax
> 
>   Kind regards
>   \blank [line]
>   X
>   \page
> \stopxmlsetups
> 
> \setuppagenumbering [state=stop]
> 
> \starttext
> \xmlprocessbuffer{main}{participants}{}
> \stoptext
> 
> So you see what I’m doing here: I process every simple  element, and 
> I add all the stuff that will go into the letter for every single contact. 
> Start with this document and then find out what you need in addition: a logo, 
> some fancy lines across the letters, a special placement for the address and 
> the subject, etc.? I’m guessing that it would be easier to do this with 
> simple setup commands rather than using the correspondence module, but we 
> have no idea what you need to accomplish. Once you find out what’s missing, 
> you can modify the example and ask additional questions. But, to take your 
> analogy: don’t start with irregular verbs and special cases that will 
> complicate the picture. How is this line
> 
> \setuplanguage[nl][date={year, –, mm, –, dd}] % ISO 8601 date
> 
> from your original example relevant to your problem? And again: 

Re: [NTG-context] Couple of questions

2017-07-31 Thread Jan Willem Flamma
Dear Gerion,

Add 

\setuphead[subsubsection]
[incrementnumber=no]

Regards,
Jan Willem Flamma


> On 30 Jul 2017, at 22:51, Gerion Entrup  wrote:
> 
> Am Samstag, 29. Juli 2017, 11:13:21 CEST schrieb Pablo Rodriguez:
>> On 07/29/2017 04:45 AM, Gerion Entrup wrote:
>>> Was not that simple, but I found the problem, that causes it:
>>> subsubsections without numbers.
>>> [...]
>>> Is there a way to fix this?
>> 
>> I would say this may be a bug.
> Does someone know a way to workaround?
> 
> This only way I see is to simply simulate a subsubsection (with some blanks
> and a big font).
> 
> Gerion
> 
> 
>> I don’t know how it is implemented, but prefixsegments (or prefixes) for
>> captions only work when number is enabled.
>> 
>> This makes sense if the section is part of the prefixsegments, but not
>> if it isn’t.
>> 
>> Another sample that shows the problem:
>> 
>>\mainlanguage[de]
>>\setupexternalfigures[location=default]
>>\setuphead[subsection][number=no]
>>\setupcaptions[prefixsegments=chapter]
>>\setuphead[subsubsection][number=yes]
>> 
>>\starttext
>> 
>>\chapter[title=Kapitel]
>>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
>> 
>>\section[title=Abschnitt]
>>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
>> 
>>\subsection[title=Hier gibt’s ein Problem]
>>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
>> 
>>\subsection[title=Und hier gibt’s ein Problem auch]
>>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
>> 
>>\subsubsection[title=Aber hier gibt’s kein Problem]
>>\placefigure{Eine Kuh}{\externalfigure[cow.pdf][scale=250]}
>>\stoptext
>> 
>> If this isn’t a bug, the code to avoid the problem is too tricky for me
>> (and simply far beyond my knowledge).
>> 
>> Excuse my ignorance,
>> 
>> Pablo
>> 
> 
> 
> ___
> 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
___