Re: [NTG-context] m-letter.tex -- backslash interpretation error
Rob Ermers wrote: Thanks for your quick reply. I adapted the file, according to your suggestion. The letter now comes out right! Thank you for that. I immediately tried an items list, which also works! Still, if there is any \ code in the xml file, it does not seem to work. Changing \e to in Drie\eenheid makes the disappear. contact ... ... pLaan der Drie\eenheid/p ... /contact comes out as: ... Laan der Drieeenheid ... I also found out that \usemodule[m-letter] works much better than \usemodule[letter], which is not evident from the way is Context set up. maybe your local m-letter-re gets loaded otherwise Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[Fwd: Re: [NTG-context] m-letter.tex -- backslash interpretation error]
-- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ---BeginMessage--- [EMAIL PROTECTED] wrote: Rob Ermers wrote: I also found out that \usemodule[m-letter] works much better than \usemodule[letter], which is not evident from the way is Context set up. Hans Hagen comments: maybe your local m-letter-re gets loaded otherwise No, I have renamed the file m-letter-re back to m-letter.tex. The only adaptations in that file are the Dutch salutations and greetings which I want to have automatized rather than redefine them in a local file. So now, with \usemodule[m-letter], everything works fine. (Apart from the diacritics in the xml address file, that is.) If I write \usemodule[letter] a general tex file /letter.tex is loaded. Someone else already pointed that out. I'm not at home now, so I cannot check it, but it seems to me that it is this file: \texmf\tex\plain\base\Letter.tex. Context gets stuck at this and generates an error. this is weird, since the order of loading is: m- p- s- x- t- and only when that fails, the raw name btw, you can say \usemodule[m][letter] to force m over something else (handy for local modules); so, it looks like tex cannot find your m-letter module; does kpsewhich --progname=context m-letter.tex report something? did you do a mktexlsr ? Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ---End Message--- ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] m-letter.tex -- backslash interpretation error
Rob Ermers wrote: Dear Friends, It seems I am really having a problem. The backslash in my import document yields . \startsetups[letter:content] \input brieftekst \stopsetups My document (brieftext.tex) among other things contains the following string: ge\interesseerde, which yields -- geinteresseerde I am unable to use any normal code in my text, which is very problematic! ... a minimal example ... looks like an encoding mismatch or so Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] m-letter.tex -- backslash interpretation error
Hans, thanks for your reaction! Here is the minimal example: 1. brief-test.tex is the letter. 2. brief-inhoud-test is the letter content. 3. test-data.xml contains some addresses The problem is that any backslash in the letter content is changed into `` in the pdf file. In the reference I also put a backslash (after the item concerns), but this one survives. To get that result I use: \startsetups[letter:content] \input brief-inhoud-test.tex \stopsetups If I use \startbuffer[texletter] \input brief-inhoud-test.tex \stopbuffer the content is not loaded into the letter at all; the result is then ``input brief-inhoud-test.tex instead of the content of the file. The encoding problem with \ is described in one of your manuals, but I really don't know where to repair it. A second problem is that the first address slides down to the content much more than it should. I tried to circumvent that by inserting a dummy address. Thanks in advance, Robert Ermers h h extern wrote: Rob Ermers wrote: Dear Friends, It seems I am really having a problem. The backslash in my import document yields . \startsetups[letter:content] \input brieftekst \stopsetups My document (brieftext.tex) among other things contains the following string: ge\interesseerde, which yields -- geinteresseerde I am unable to use any normal code in my text, which is very problematic! ... a minimal example ... looks like an encoding mismatch or so Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ?xml version=1.0 encoding=ISO-8859-1 standalone=yes? start ref name=contacts /start define name=contacts element name=contacts zeroOrMore choice ref name=contacts.contact/ ref name=contacts.contactgroup/ ref name=contacts.contactfile/ /choice /zeroOrMore /element /define define name=contacts.contactgroup element name=contactgroup zeroOrMore ref name=contactgroup.member /zeroOrMore attribute name=label/ /element /define define name=contactgroup.member element name=member text/ /element /define define name=contacts.contact element name=contact interleave optionalref name=contact.address//optional optionalref name=contact.opm//optional /interleave attribute name=label name=regio name=num/ /element /define !-- contact label=`marle.k.van' initialsK. van/initials formalnameMarle/formalname informalnameKees/informalname titleIr./title prefixHeer van/prefix address pK. van Marle/p pPRAGMA POD/p pRidderstraat 27/p p8061GH Hasselt NL/p /address /contact -- contacts contact num=297 regio=n3 label=`num297' address pDummy/p pDummy/p ptest/p ptest/p /address /contact contact num=1 regio=z3 label=`num1' address pJ. Jansen/p pLangeweg 66/p pAalsterweg 29/p p1234 AB Eindhoven/p /address /contact contact num=2 regio=z3 label=`num2' address pJ. Pietersen/p pKorteweg 66/p pAalsterweg 29/p pB-1234 Zonhoven/p /address /contact contact num=3 regio=z3 label=`num3' address pJ. van den Berg/p pLaan der Drie\eenheid/p p1234 AB Beginhoven/p /address /contact !-- 334 records written -- contactgroup label=`n' membernum297/member membernum1/member membernum3/member membernum3/member /contactgroup /contacts Hierbij deel ik u mede dat we hier erg effici\ent werken en niet ge\interesseerd zijn in ge\evolueerde dieselmotoren. %starttext \setups [letter:place] \stoptext \endinput \setupoutput[pdftex] %\tracelayerstrue %\usemodule[xtag-ini] \usemodule[corres] \usemodule[letter-re] \mainlanguage[nl] \setupbodyfont[ss] %\setvariables[letter:head][graphic=briefpapier-mo-p.010.pdf] \definelayer [letternext] [state=next, % graphic=briefpapier-mo-p.011.pdf, width=\paperwidth, height=\paperheight] \setvariables [letter:reference] [line=2, noflines-min=2, noflines-max=5, noflines=\getvariable{letter:reference}{noflines-max} ] \setvariables [letter:style] [opening=formal, closing=formal] %\setvariables % [letter:data] % [opening=, % initials=, % prefix=, % suffix=, % informalname=, % formalname=] % noflines=10] \setvariables[letter:address][line=6, hoffset=100mm,width=70mm] %\startsetups[contact:handle] %\XMLflush{address} \endgraf %\stopsetups %\startbuffer[texletter] %\input brieftekst-pol-jan2005 %\stopbuffer \startsetups[letter:content] \input brief-inhoud-test.tex \stopsetups
Re: [NTG-context] m-letter.tex -- backslash interpretation error
The problem is that the letter content is processed in xml mode, so you need: \startsetups[letter:place:content] \bgroup \disableXML \endgraf \setups[letter:content] \endgraf \egroup \stopsetups (beware, don't redefine a module m-letter-re since only the first 8 chars count; better put your local variant in an environment % re-letter.tex \startenvironment re-letter \usemodule[letter] \stopenvironment and then \environment re-letter Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] m-letter.tex -- backslash interpretation error
Hans, Thanks for your quick reply. I adapted the file, according to your suggestion. The letter now comes out right! Thank you for that. I immediately tried an items list, which also works! Still, if there is any \ code in the xml file, it does not seem to work. Changing \e to in Drie\eenheid makes the disappear. contact ... ... pLaan der Drie\eenheid/p ... /contact comes out as: ... Laan der Drieeenheid ... I also found out that \usemodule[m-letter] works much better than \usemodule[letter], which is not evident from the way is Context set up. Thanks again, Robert %starttext \setups [letter:place] \stoptext \endinput \setupoutput[pdftex] %\tracelayerstrue %\usemodule[xtag-ini] \usemodule[corres] \usemodule[m-letter] \mainlanguage[nl] \setupbodyfont[ss] %\setvariables[letter:head][graphic=briefpapier-mo-p.010.pdf] \definelayer [letternext] [state=next, % graphic=briefpapier-mo-p.011.pdf, width=\paperwidth, height=\paperheight] \setvariables [letter:reference] [line=2, noflines-min=2, noflines-max=5, noflines=\getvariable{letter:reference}{noflines-max} ] \setvariables [letter:style] [opening=formal, closing=formal] %\setvariables % [letter:data] % [opening=, % initials=, % prefix=, % suffix=, % informalname=, % formalname=] % noflines=10] \setvariables[letter:address][line=6, hoffset=100mm,width=70mm] %\startsetups[contact:handle] %\XMLflush{address} \endgraf %\stopsetups %\startbuffer[texletter] %\input brieftekst-pol-jan2005 %\stopbuffer \setvariables [letter:data] [address=\XMLflush{address}, %prefix=\XMLflush{prefix}, %initials=\XMLflush{initials}, %formalname=\XMLflush{formalname}, %informalname=\XMLflush{informalname} %content={\getbuffer[texletter]}, %,content=\getbuffer concerns=Ge\interesseerd?, date=10 januari 2005, author=Dr. R.J.H.M. Ermers ] \setvariables[contacts][selection=n, file=test-data.xml] \startsetups[contact:handle] \setups[letter:place] \stopsetups \startsetups[letter:content] \input brief-inhoud-test.tex \stopsetups \startsetups[letter:place:content] \bgroup \disableXML \endgraf \setups[letter:content] \endgraf \egroup \stopsetups \XMLprocesscontacts[test-data.xml] \starttext %\setups[letter:place] \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context