ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: r.ermers@hccnet.nl
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: letters in context mkiv
Date: Tue, 1 Aug 2017 09:55:30 +0200	[thread overview]
Message-ID: <E72683CE-C8E0-46C5-836C-0367E516CE58@hccnet.nl> (raw)
In-Reply-To: <66997B76-4539-4407-8A81-63D3C91F9CDA@uni-bonn.de>

[-- Attachment #1: Type: text/plain, Size: 794 bytes --]

Hi Thomas,

Thanks for your new suggestions.

As a matter of fact, I yesterday found the following suggestion (http://wiki.contextgarden.net/Layers):

\definelayer[AddressBg] [location={right,top},   y=6cm,  x=12cm,  color=red,   style=\ss\tfa].

I used this in the sample suggested by you yesterday. The address actually moves to the desired place!

However, the color and style instructions (\ss\tfa) have no effect. I tried to solve that, as a first step, by putting \ss before the \xmlall instruction:

\startxmlsetups xlm:contact
\setlayer[AddressBg]  {\framed[width=55mm,height=30mm,  align=right,background=color,
  backgroundcolor=lightgray]{\ss\xmlall{#1}{/address}}}
\strut
...
\stopxmlsetups

This works (see pdf), but there are probably other and better ways.


[-- Attachment #2: brieven2mkiv.pdf --]
[-- Type: application/pdf, Size: 17561 bytes --]

[-- Attachment #3: Type: text/plain, Size: 413 bytes --]



Another persisting problem is that the commands are still not ‘expanded’ (see Pablo’s remarks). According to Pablo for some reason there is only one expansion level.

This means that after an \input command, all other commands are not expanded (see pdf).

This also applies to your suggestions (see pdf brieven2mkiv5.pdf): in the Knuth sample text the only command \TeX\, is not expanded either.


[-- Attachment #4: brieven2mkiv5.pdf --]
[-- Type: application/pdf, Size: 13108 bytes --]

[-- Attachment #5: Type: text/plain, Size: 1144 bytes --]



Regards,

Robert


\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

  This is a {\bf bold} test. \TeX\
  \startitemize
  \item item
  \item item
  \stopitemize

\input brieftekst-test.tex \relax
\par
%this \par is needed, for the last word of the file merges with Kind regards.

  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



[-- Attachment #6: brieftekst-test.tex --]
[-- Type: application/octet-stream, Size: 467 bytes --]

This is a test with an input file.

{\bf test testtest testtest test}

test testtest testtest testtest testtest testtest test test test:

\startitemize[n,packed,joinedup]
\item test test test test.
\item test test test test test test.
%\item Het voeren van gesprekken met cliënten.
\stopitemize

test testtest testtest testtest testtest testtest testtest testtest testtest testtest test

{\bf test test}

test testtest testtest testtest testtest test

[-- Attachment #7: Type: text/plain, Size: 2797 bytes --]






> Op 31 jul. 2017, om 23:57 heeft Schmitz Thomas A. <thomas.schmitz@uni-bonn.de> het volgende geschreven:
> 
> 
>> On 31. Jul 2017, at 18:58, r.ermers@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]
> <contacts>
>  <contact class='participant' label='Hendriks'>
>    <formalname>Hendriks</formalname>
>    <informalname>Karel</informalname>
>    <prefix>mr.</prefix>
>    <initials>K.</initials>
>    <city>Arnhem</city>
>    <address>
>      <p>Mr. K. Hendriks</p>
>      <p>Grotestraat 5</p>
>      <p>1234 BB Arnhem</p>
>    </address>
>    <kix>1234bb5</kix>
>  </contact>
>  <contact class='participant' label='Janssen'>
>    <formalname>Janssen</formalname>
>    <informalname>Piet</informalname>
>    <initials>P.</initials>
>    <prefix>mr.</prefix>
>    <city>Nijmegen</city>
>    <address>
>     <p>Mr. P. Janssen</p>
>     <p>Kortestraat 8</p>
>     <p>1234 AA Nijmegen</p>
>    </address>
>    <kix>1234aa8</kix>
>  </contact>
> </contacts>
> \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
> ___________________________________________________________________________________


[-- Attachment #8: Type: text/plain, Size: 492 bytes --]

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

  reply	other threads:[~2017-08-01  7:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-30 12:15 r.ermers
2017-07-30 15:38 ` Schmitz Thomas A.
2017-07-31  8:09   ` r.ermers
     [not found] ` <597DFB2C.60001@gmail.com>
2017-07-31 10:48   ` r.ermers
2017-07-31 15:23     ` Pablo Rodriguez
2017-07-31 16:58       ` r.ermers
2017-07-31 17:23         ` Pablo Rodriguez
2017-07-31 21:57         ` Schmitz Thomas A.
2017-08-01  7:55           ` r.ermers [this message]
2017-08-01  8:46             ` Schmitz Thomas A.
2017-08-01 10:15               ` r.ermers
2017-08-01 11:17                 ` Schmitz Thomas A.
2017-08-01 12:04                   ` r.ermers
  -- strict thread matches above, loose matches on Subject: below --
2017-07-28  6:18 r.ermers
2017-07-28  6:18 r.ermers
2017-07-25 11:14 r.ermers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E72683CE-C8E0-46C5-836C-0367E516CE58@hccnet.nl \
    --to=r.ermers@hccnet.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).