[NTG-context] Bibliography in MKIV, custom rendering

2017-07-30 Thread 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?

Gerion
___
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] source code and result side by side

2017-07-30 Thread Aditya Mahajan

On Sun, 30 Jul 2017, Henning Hraban Ramm wrote:


Am 2017-07-29 um 00:57 schrieb Aditya Mahajan :


On Fri, 28 Jul 2017, Henning Hraban Ramm wrote:


Ahoi again,

I’m preparing some ConTeXt docs with a lot of examples and would like to 
reproduce what we have in the wiki as


...


i.e. sourcecode beside the result.

Often the shown source is exactly what I want to show, in other cases I need 
some additional setup that I don’t want to show.

Which approach would you suggest? Combinations?


\startbuffer[example-1]

\stopbuffer


\placesidebyside
   {\typebuffer[example-1]}
   {\getbuffer[setups, example-1]}



Thank you again, that should be enough for most of my small examples.
I guess I never heard of or forgot about \placesidebyside as well as 
\placeontopofeachother.

But I’d like to show a lot of similar examples to explain several options.
Therefore, if I’d like to simplify my code, but this doesn’t work:

\def\CodeExample#1{%
\startbuffer[zB]
#1
\stopbuffer
\typebuffer[zB]
\getbuffer[zB]
}

\CodeExample{\framed[frame=off,leftframe=on,rulethickness=1em,framecolor=blue]{Klotz
 am Bein}}


You can't do that with buffers. If you need to define your own macros that 
behave like buffers, you need to use \grabbufferdata (see buff-ini.mkiv). 
But in this case, there is a simpler solution:


\defineframed
  [CodeExampleFramed]
  [
frame=off,
width=0.5\textwidth,
align=normal,
  ]

\definebuffer
[CodeExample]

\define\stopCodeExample
{\placesidebyside
{\CodeExampleFramed{\typeCodeExample}}
{\CodeExampleFramed{\getCodeExample}}}


\starttext
\startCodeExample
\framed
  [
frame=off,
leftframe=on,
rulethickness=1em,
framecolor=blue,
  ]{Klotz am Bein}
\stopCodeExample


\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] Couple of questions

2017-07-30 Thread Gerion Entrup
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
___

[NTG-context] imposition with some rotated pages

2017-07-30 Thread Pablo Rodriguez
Dear list,

I have a PDF document in A4 paper size with some rotated pages.

I would like to make a booklet of it:

\setuppapersize [A5][A4, landscape]
\setuparranging [2UP]
\setuplayout
  [backspace=0pt,
topspace=0pt,
   width=middle,
  height=middle,
location=middle,
  header=0pt,
  footer=0pt]
\setupinteractionscreen[option={landscape, paper}, copies=1]
\starttext
\filterpages[report.pdf][1:25][width=0pt]
\filterpages[report.pdf][27:30][width=0pt]%they are rotated
\filterpages[report.pdf][31:100][width=0pt]
\stoptext

The rotated pages in the source PDF document are a problem here.

The wiki contains the info that \filterpages may be rotated with
[orientation=90]. But this seems to be old, since it doesn’t work.

If I add
\rotate[rotation=90]{\filterpages[report.pdf][27:30][width=0pt]},
automatic scaling doesn’t work. And all pages will be considered as a
single image.

Is there any way to have rotation for some pages in the source document
to get the right imposition?

I’m afraid rotation comes from the source PDF document in this case.

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] source code and result side by side

2017-07-30 Thread Pablo Rodriguez
On 07/30/2017 07:13 PM, Henning Hraban Ramm wrote:
> [...]
> But I’d like to show a lot of similar examples to explain several options.
> Therefore, if I’d like to simplify my code, but this doesn’t work:
> 
> \def\CodeExample#1{%
> \startbuffer[zB]
> #1
> \stopbuffer
> \typebuffer[zB]
> \getbuffer[zB]
> }
> 
> \CodeExample{\framed[frame=off,leftframe=on,rulethickness=1em,framecolor=blue]{Klotz
>  am Bein}}
> 
> Compilation just stops, maybe some infinite loop?

This is what I get from your sample above.

> Simpler:
> 
> \def\CodeExample#1{%
> \startTEX
> #1
> \stopTEX
> #1
> }
> 
> Stops with the error:

Without or without definitions, there should be no expansion inside
\starttyping...\stoptyping.

Even with some expansion, I get an infinite loop:

\starttext
\setuptyping[TEX][escape=yes]
\def\CodeExample#1{%
\startTEX
/BTEX #1/ETEX
\stopTEX
#1
}
\CodeExample{\framed[frame=off,leftframe=on,rulethickness=1em,framecolor=blue]{Klotz
am Bein}}

\stoptext

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] source code and result side by side

2017-07-30 Thread Henning Hraban Ramm
Am 2017-07-29 um 00:57 schrieb Aditya Mahajan :

> On Fri, 28 Jul 2017, Henning Hraban Ramm wrote:
> 
>> Ahoi again,
>> 
>> I’m preparing some ConTeXt docs with a lot of examples and would like to 
>> reproduce what we have in the wiki as
>> 
>> 
>> ...
>> 
>> 
>> i.e. sourcecode beside the result.
>> 
>> Often the shown source is exactly what I want to show, in other cases I need 
>> some additional setup that I don’t want to show.
>> 
>> Which approach would you suggest? Combinations?
> 
> \startbuffer[example-1]
> 
> \stopbuffer
> 
> 
> \placesidebyside
>{\typebuffer[example-1]}
>{\getbuffer[setups, example-1]}


Thank you again, that should be enough for most of my small examples.
I guess I never heard of or forgot about \placesidebyside as well as 
\placeontopofeachother.

But I’d like to show a lot of similar examples to explain several options.
Therefore, if I’d like to simplify my code, but this doesn’t work:

\def\CodeExample#1{%
\startbuffer[zB]
#1
\stopbuffer
\typebuffer[zB]
\getbuffer[zB]
}

\CodeExample{\framed[frame=off,leftframe=on,rulethickness=1em,framecolor=blue]{Klotz
 am Bein}}


Compilation just stops, maybe some infinite loop?

Simpler:

\def\CodeExample#1{%
\startTEX
#1
\stopTEX
#1
}


Stops with the error:
Use of \m_syst_action_yes doesn't match its definition




Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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-30 Thread Schmitz Thomas A.

> 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: please don’t 
give me the “I’m not a programmer” response; I’m not a programmer either, but I 
know that you have to reduce the complexity in problems to find a solution. 
You’re adding extra complexity.

The way I describe above is the easiest path. There are other approaches, of 
course: you can combine elements from several xml documents, or you can process 
the xml data with Lua. All of this may be unnecessary in your case, but nobody 
will be able to help unless we understand what you need. And to explain this, 
you will have to start with simple examples, not with a complex document.

Sorry for being somewhat stern, but I’m sure you would give similar advice to 
your students…

All best

Thomas

___
If your question is 

Re: [NTG-context] ligatures/substituation at word boundaries

2017-07-30 Thread Hans Hagen

On 7/30/2017 11:39 AM, Ulrike Fischer wrote:

Am Fri, 28 Jul 2017 23:21:18 +0200 schrieb Hans Hagen:


Is it possible to refer in fonts.handlers.otf.addfeature to the word
boundary? The luatex manual speaks of a virtual "left_boundary"
char, but I couldn't find a way to use it.



It is possible to check against spaces in contextual lookups. There
isn't something like left boundary. I added some test code to the beta
but keep in mind that this will only work with self-made features.


Thanks. It seems to work quite good and after some playing around I
also got the knack of the syntax.

A few questions:

1. "lookups = { 1 }," refers to the first lookup. Is it possible to
name the lookups and to refer to this name?.


no, because order matters


2. 0xFFFC refers more or less to the begin and end of line, right?
Why doesn't it interfere with hyphenations? I tried to get
   ab-
ab

and the second wasn't replaced (as wanted) and I wondered how it
worked.


0xFFFC is just the same as "anything other than glyph or discretionary"


3. Why is in the following example "abcd" not replaced by "12"?


i'll have a look at this (advancing in somewhat messy defined)


\startluacode
  fonts.handlers.otf.addfeature {
  name= "test-a",
  type= "chainsubstitution",
  lookups = {
  {
  type = "ligature",
  data = {
  ['1'] = { "a", "b" },
  ['2'] = { "c", "d" },
  },
  },
  },
  data = {
  rules = {
  {
  before  = { { " ", 0xFFFC } },
  current = { { "a" }, { "b" } },
  lookups = { 1 },
  },
  {
  current = { { "c" }, { "d" } },
  after   = { { 0xFFFC, " " } },
  lookups = { 1 },
  },
  },
  },
  }


\stopluacode

\definefontfeature[test-a][test-a=yes]

\startbuffer
xxx abcd abxcd xxx
\stopbuffer

\starttext

\typebuffer

\definedfont[file:dejavu-serif.ttf*default] \getbuffer \blank
\definedfont[file:dejavu-serif.ttf*default,test-a] \getbuffer \blank

\stoptext



--

-
  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] texture as background?

2017-07-30 Thread Henning Hraban Ramm
Am 2017-07-29 um 01:01 schrieb Aditya Mahajan :

> On Fri, 28 Jul 2017, Henning Hraban Ramm wrote:
> 
>> Ahoi,
>> 
>> is there are way to use a texture (i.e. a repeated pixel image) as a 
>> background of a frame?
> 
> Use \backgroundimage
> 
> See https://tex.stackexchange.com/a/69138/323

Thank you very much!
Wikified: http://wiki.contextgarden.net/Command/backgroundimage


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] Problems with heads using margintext alternative

2017-07-30 Thread Hans Hagen

On 7/30/2017 9:30 AM, Pablo Rodriguez wrote:

On 07/29/2017 11:44 PM, Hans Hagen wrote:

On 7/29/2017 7:34 PM, Rik wrote:

Indeed, the extra line before the text occurs only when inter-paragraph
whitespace is set and start/stop is used. This does indeed appear to be
something that can be repaired.

to some extend ... i added some hack in the upcoming beta btu keep in
mind that a section head carries some information so there's always
something (invisible) there that can generate whitespace


Many thanks for this fix and the one with itlc and ligatures, Hans.

I’m afraid I’m not able to align text in margin data:

 \setuphead
 [chapter]
 [style=\tfxx,
  number=no,
  alternative=margintext,
  align=middle]
 \setupmargindata
 [inmargin]
 [style=\tfxx,
  align=middle]
 \starttext
 \chapter{Chapter}
 \input jojomayer
 \blank
 \inmargin{marginal\\data\blank}\input jojomayer
 \stoptext

Is this a bug or am I missing something?

\setuplayout
  [backspace=4cm,
   margin=3cm,
   margindistance=5mm,
   width=middle]

\showframe

\setuphead
[chapter]
[style=\tfxx,
 number=no,
 alternative=margintext,
 align=middle]

\setupmargindata
[inmargin]
[width=3cm,
 style=\tfxx,
 margin=normal, % makes distance work
 distance=1cm]

\setupmarginframed
[inmargin]
[width=2cm,
 frame=on,
 align=middle]

\starttext
\chapter{Chapter}
\input jojomayer
\blank
\inmargin{marginal\\data\blank}\input jojomayer

\inleft{L}test
\inright{R}test

\definemargindata[Xinleft] [width=3cm,location=left, align=flushleft]
\definemargindata[Xinright][width=3cm,location=right,align=flushright]

\Xinleft {L}test
\Xinright{R}test

\stoptext



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

[NTG-context] letters in context mkiv

2017-07-30 Thread r . ermers
Dear Contex’ers,I still desperately need your help. I would like to use Context mkiv for compiling serial letters with an xml database of addresses. I used to do this in mkii.The problem may seem trivial to experienced programmers like yourselves, but yes, I am stuck.I have several mkiv manuals, I tried dozens of lines of luacode, but somehow ...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.The same applies to information on complicated programming languages such as lua and TeX (steep learning curves - remember!).Yet even for non-programmers it it is fun to use TeX and Context.Therefore, knowledgeable list members, please help us. Have compassion and patience with the non-programmers amongst you who struggle with the application of the available information on Context. Who sometimes do not know how to accurately formulate their problems in programmer-ish. Who are  specialists in their own fields, but feel humble in this area.….Regarding my file, I have found out how to process the xml data from an xml file (now in the buffer). The recipient’s address neatly shows up in the designed place. (See pdf). So far, everything seems OK. Yet when I add text, only the text appears, and all address data from the xml file disappear.You can try it out by uncommenting the %\input knuth or %tekst lines.I have tried various options, but for now I have no idea how to proceed further.Context Version: 2017.07.17 00:20Lua 5.2.4, This is LuaTeX, Version 1.05.0.Your help is much appreciated!Раһмет!Kind regards,Robert\usemodule[letter]\setuplanguage[nl][date={year, –, mm, –, dd}] % ISO 8601 date\setupletteroptions[language=netherlands,bodyfont={rm,10pt},whitespace=1.5ex]\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:*}%\xmlsetsetup{\xmldocument}{text:p}{xml:paragraph}\stopxmlsetups\xmlregistersetup{xml:setups}\startxmlsetups xml:contacts\xmlflush{#1}\stopxmlsetups\startxmlsetups xml:contact\setupletter[toaddress={\xmlall{#1}{/address/p}\par\xmltext{#1}{/kix}}]\defineletterelement[layer][address][example]%    {\correspondenceparameter{toname}\\\correspondenceparameter{toaddress}\par}%toname is not used in setupletter because toaddress contains all data.%kix is used for adding a barcode to the address.\setupletterlayer[address][alternative=example,y=6cm,x=12cm,color=red,style=\tfa\sans]\startletter  [opening={Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},},   closing={Kind regards,},   subject={subject: your life in \xmltext{#1}{/city}},   signature={X}]\stopletter\stopxmlsetups\startxmlsetups xml:address\xmlflush{#1}\stopxmlsetups\startxmlsetups xml:p\xmlflushtext{#1}\par\stopxmlsetups\starttext%\input knuth%tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst\xmlprocessbuffer{main}{participants}{}\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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/wiki : http://contextgarden.net___

brieven2mkiv.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] ligatures/substituation at word boundaries

2017-07-30 Thread Ulrike Fischer
Am Fri, 28 Jul 2017 23:21:18 +0200 schrieb Hans Hagen:

>> Is it possible to refer in fonts.handlers.otf.addfeature to the word
>> boundary? The luatex manual speaks of a virtual "left_boundary"
>> char, but I couldn't find a way to use it.

> It is possible to check against spaces in contextual lookups. There 
> isn't something like left boundary. I added some test code to the beta 
> but keep in mind that this will only work with self-made features. 

Thanks. It seems to work quite good and after some playing around I
also got the knack of the syntax.

A few questions: 

1. "lookups = { 1 }," refers to the first lookup. Is it possible to
name the lookups and to refer to this name?.

2. 0xFFFC refers more or less to the begin and end of line, right?
Why doesn't it interfere with hyphenations? I tried to get 
  ab-
ab 

and the second wasn't replaced (as wanted) and I wondered how it
worked. 

3. Why is in the following example "abcd" not replaced by "12"? 


\startluacode
 fonts.handlers.otf.addfeature {
 name= "test-a",
 type= "chainsubstitution",
 lookups = {
 {
 type = "ligature",
 data = {
 ['1'] = { "a", "b" },
 ['2'] = { "c", "d" },
 },
 },
 },
 data = {
 rules = {
 {
 before  = { { " ", 0xFFFC } },
 current = { { "a" }, { "b" } },
 lookups = { 1 },
 },
 {
 current = { { "c" }, { "d" } },
 after   = { { 0xFFFC, " " } },
 lookups = { 1 },
 },
 },
 },
 }


\stopluacode

\definefontfeature[test-a][test-a=yes]

\startbuffer
xxx abcd abxcd xxx
\stopbuffer

\starttext

\typebuffer

\definedfont[file:dejavu-serif.ttf*default] \getbuffer \blank
\definedfont[file:dejavu-serif.ttf*default,test-a] \getbuffer \blank

\stoptext





-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

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

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

Re: [NTG-context] (bug?) itlc removes liga

2017-07-30 Thread Jan U. Hasecke
Am 29.07.2017 um 21:51 schrieb Hans Hagen:
> On 7/29/2017 5:40 PM, Jean-Pierre Delange wrote:
>>
>> Hello Pablo,
>>
>> I am very sad to inform you, dear Pablo, that there is the same bug
>> with ligatures on (OS Linux x64) CTX current version: 2016.11.22
>> aswell as on mtx-context | current version: 2017.07.28 22:51 ...;-)
> it's indeed an older issue

Before I updated, I tried with a version from 04.2017 and had no problems.

juh
___
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] width of floats

2017-07-30 Thread Pablo Rodriguez
On 07/28/2017 10:14 PM, Henning Hraban Ramm wrote:
> Ahoi,
> I wonder how I can limit the width of a custom float, neither
> "width" nor "maxwidth" seems to have any effect:
> [..]
> While it’s nice that the "Beispiel" paragraphs stays the same width
> as the main text, even with "offset", I’d like to limit the whole box to
> the textwidth (or any other measure).

Hi Hraban,

I’m not sure wheter it might be a bug in width and maxwith not working,
but the following seems to work:

\definefloat[Beispiel][Beispiele]
\setupfloat[Beispiel][
width=36mm,
%~ maxwidth=.6\textwidth,
offset=1em,
background=color,backgroundcolor=yellow,
inner=\hsize.95\textwidth %not very orthodox, anyway
]
\setupcaption[Beispiel][
location=none,number=no
]

\starttext

\input knuth

\startplaceBeispiel
\input tufte
\stopplaceBeispiel

\input knuth

\stoptext

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
___

Re: [NTG-context] Problems with heads using margintext alternative

2017-07-30 Thread Pablo Rodriguez
On 07/29/2017 11:44 PM, Hans Hagen wrote:
> On 7/29/2017 7:34 PM, Rik wrote:
>> Indeed, the extra line before the text occurs only when inter-paragraph 
>> whitespace is set and start/stop is used. This does indeed appear to be 
>> something that can be repaired.
> to some extend ... i added some hack in the upcoming beta btu keep in 
> mind that a section head carries some information so there's always 
> something (invisible) there that can generate whitespace

Many thanks for this fix and the one with itlc and ligatures, Hans.

I’m afraid I’m not able to align text in margin data:

\setuphead
[chapter]
[style=\tfxx,
 number=no,
 alternative=margintext,
 align=middle]
\setupmargindata
[inmargin]
[style=\tfxx,
 align=middle]
\starttext
\chapter{Chapter}
\input jojomayer
\blank
\inmargin{marginal\\data\blank}\input jojomayer
\stoptext

Is this a bug or am I missing something?

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
___