# Re: [NTG-context] letters in context mkiv

Your suggestion with foregroundstyle and foregroundcolor works. Thank you!

{\framed[width=55mm,height=30mm,
align=right,background=color,
backgroundcolor=lightgray,
foregroundcolor=red,foregroundstyle=\ss\tfa]{\xmlall{#1}{/address}}}


My question (my ’need’) was quite simple: how I can have a workflow in which I
can produce serial letters based upon contextmkiv (as I did in mkii).

I encountered a number of difficulties (in steps):

1. I first noticed that I could not add a letter text, either in the file
itself, or by means of \input.

At that point the sample knuth file was not processed, nor were my own external
letter files.

I did write that I use external letter files, but perhaps failed to mention
that my texts contain to my mind regular Context commands (like {\bf bold} and
\startitemize … \stopitemize). I use these commands to improve the look of my
letter.

2. The import problem itself was caused by a wrongful position of the
\starttext … \stoptext commands. This problem was solved with help of Thomas,
Wolfgang and Pablo.

3. A second problem I signalled was to have the addres moved to the desired
place. I could solve this problem by reference to the contextgarden website.
Thomas helped me finetune the style instruction.

4. Only when the input files were processed, it became obvious that these files
(including the knuth file) in a general sense are not rendered correctly.

The knuth sample document (\input knuth) contains only one single command
(\TeX\), which is not expanded. For this reason, my sample letters, which
contain regular codes, are not processed correctly either. Pablo Rodriguez
suggested that the problem was that for some reason there is only one
‘expansion’ level.

Thomas, in his last mail, now writes that according to him within the xml
setups the ‘catcodes' are changed, and, as a result, the backslash is
interpreted as a normal character rather than as introducing a command.

While understanding what it means, I guess this might imply that it is
difficult (?) or impossible (?) to correctly process files such as the knuth
text and for that matter any other letter text that contains regular Context
commands.

Nevertheless, for the moment this problem remains unsolved.

What would you advise as the next step?

Should the letter be somehow set-up outside xml setups rather than inside?
Should the letter texts (and a specific knuth sample text) be reformatted as
xml?

So in sum, I sincerely do not think I kept anyone guessing about my needs. The
technical problems presented themselves one by one, step by step. Yet if I did,
I apologize.

Kind regards,

Robert

> Op 1 aug. 2017, om 10:46 heeft Schmitz Thomas A. <thomas.schm...@uni-bonn.de>
> het volgende geschreven:
>
>> 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
>> align=right,background=color,
>> \strut
>> ...
>> \stopxmlsetups
>>
>> This works (see pdf), but there are probably other and better ways.
>>
> Have a look at the framed/setupframed command; they have foregroundstyle and
> foregroundcolor keys; that would be the most idiomatic way to set the style.
>
>
>
>> 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.
>
> You’re working within xml setups, which means that the catcodes are not the
> same as in TeX, which means that the backslash is just a normal character.
> The question is: why would you need TeX commands from an external file? Is
> this where your letter text comes from? You keep us guessing and are not
> describing what your needs are.
>
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
___________________________________________________________________________________