letter module: File ended while scanning use of \buff_gobble
Hi, How could I embed \startletter/\stopletter in a macro please? This does not work: --8<---------------cut here---------------start------------->8--- \usemodule[letter] \def\myStartLetter{\startletter} \def\myStopLetter{\stopletter} \myStartLetter \input tufte \myStopLetter --8<---------------cut here---------------end--------------->8--- TIA for any hints, -- Peter
Am 04.03.2013 um 14:57 schrieb Peter Münster
Hi,
How could I embed \startletter/\stopletter in a macro please?
This does not work:
--8<---------------cut here---------------start------------->8--- \usemodule[letter] \def\myStartLetter{\startletter} \def\myStopLetter{\stopletter} \myStartLetter \input tufte \myStopLetter --8<---------------cut here---------------end--------------->8---
The module uses a buffer to store the content of the letter environment. What you can do is to create a new buffer for your environment and feed the content of this buffer to the letter module. \usemodule[letter] \startsetups[letter:section:content] \getbuffer[MyLetter] \stopsetups \setuplettersection[content][alternative=setups] \def\StartLetter {\starttext \grabbufferdata[MyLetter][StartLetter][StopLetter]} \def\StopLetter {\placeletter \stoptext} \StartLetter \input tufte \StopLetter Wolfgang
On Mon, Mar 04 2013, Wolfgang Schuster wrote:
\usemodule[letter]
\startsetups[letter:section:content] \getbuffer[MyLetter] \stopsetups
\setuplettersection[content][alternative=setups]
\def\StartLetter {\starttext \grabbufferdata[MyLetter][StartLetter][StopLetter]}
\def\StopLetter {\placeletter \stoptext}
\StartLetter \input tufte \StopLetter
Thanks Wolfgang. How could I add something at the start and at the end of the letter? This does not work: --8<---------------cut here---------------start------------->8--- \def\StartLetter {\starttext \grabbufferdata[MyLetter][StartLetter][StopLetter] something at the start of the letter} \def\StopLetter {something at the end of the letter \placeletter \stoptext} --8<---------------cut here---------------end--------------->8--- TIA for any help, -- Peter
Am 01.09.2013 um 13:33 schrieb Peter Münster
On Mon, Mar 04 2013, Wolfgang Schuster wrote:
\usemodule[letter]
\startsetups[letter:section:content] \getbuffer[MyLetter] \stopsetups
\setuplettersection[content][alternative=setups]
\def\StartLetter {\starttext \grabbufferdata[MyLetter][StartLetter][StopLetter]}
\def\StopLetter {\placeletter \stoptext}
\StartLetter \input tufte \StopLetter
Thanks Wolfgang.
How could I add something at the start and at the end of the letter?
This does not work:
--8<---------------cut here---------------start------------->8--- \def\StartLetter {\starttext \grabbufferdata[MyLetter][StartLetter][StopLetter] something at the start of the letter}
\def\StopLetter {something at the end of the letter \placeletter \stoptext} --8<---------------cut here---------------end--------------->8---
\startrawsetups[letter:section:content] Text before the content of the letter. \getbuffer[MyLetter] Text after the content of the letter. \stoprawsetups Wolfgang
On Sun, Sep 01 2013, Wolfgang Schuster wrote:
\startrawsetups[letter:section:content]
Text before the content of the letter.
\getbuffer[MyLetter]
Text after the content of the letter.
\stoprawsetups
Yes, thanks! (I forgot about this part, because in my setup it was hidden in another file...) In the meantime I've played with the lua buffers functions: \def\StopLetter{% \ctxlua{buffers.prepend("MyLetter", "START")} \ctxlua{buffers.append("MyLetter", "\\relax STOP")} \placeletter \stoptext} This works also quite well. buffers.prepend() does not yet exist. Hans, could you please add it? It could be perhaps useful one day. -- Peter
On 9/1/2013 2:30 PM, Peter Münster wrote:
On Sun, Sep 01 2013, Wolfgang Schuster wrote:
\startrawsetups[letter:section:content]
Text before the content of the letter.
\getbuffer[MyLetter]
Text after the content of the letter.
\stoprawsetups
Yes, thanks! (I forgot about this part, because in my setup it was hidden in another file...)
In the meantime I've played with the lua buffers functions:
\def\StopLetter{% \ctxlua{buffers.prepend("MyLetter", "START")} \ctxlua{buffers.append("MyLetter", "\\relax STOP")} \placeletter \stoptext}
This works also quite well.
buffers.prepend() does not yet exist. Hans, could you please add it? It could be perhaps useful one day.
ok ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
Hans Hagen
-
Peter Münster
-
Wolfgang Schuster
-
Wolfgang Schuster