summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-16 23:13:38 +0000
committerKarl Berry <karl@freefriends.org>2012-05-16 23:13:38 +0000
commitb09cb5528cea00f54900773a274788b55f7170f9 (patch)
treed42130700382d61301e660abe3ef6739fa14631c
parentf030a7991748b043758202157b1d5fd953d0f922 (diff)
context-letter (16may12)
git-svn-id: svn://tug.org/texlive/trunk@26457 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/tex/context/third/letter/base/s-cor-00.lua8
-rw-r--r--Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkii2
-rw-r--r--Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkvi284
-rw-r--r--Master/texmf-dist/tex/context/third/letter/base/s-cor-01.mkii2
4 files changed, 254 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.lua b/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.lua
index daeac45195a..5b958f547b2 100644
--- a/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.lua
+++ b/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.lua
@@ -25,6 +25,7 @@ local v_correspondence = variables.correspondence
local v_letter = variables.letter
local v_memo = variables.memo
local v_resume = variables.resume
+local v_frames = variables.frames
local v_stop = variables.stop
local v_layer = variables.layer
local v_section = variables.section
@@ -67,6 +68,7 @@ local patterns = {
[v_letter] = { "letter-imp-%s.mkiv", "letter-imp-%s.tex", "letter-%s.mkiv", "letter-%s.tex" },
[v_memo] = { "memo-imp-%s.mkiv", "memo-imp-%s.tex", "memo-%s.mkiv", "memo-%s.tex" },
[v_resume] = { "resume-imp-%s.mkiv", "resume-imp-%s.tex", "resume-%s.mkiv", "resume-%s.tex" },
+ [v_frames] = { "frames-imp-%s.mkiv", "frames-imp-%s.tex", "frames-%s.mkiv", "frames-%s.tex" },
}
local function action(name,foundname)
@@ -94,6 +96,7 @@ end
function correspondence.place(environment,settings)
local bodyfont = settings.bodyfont
local whitespace = settings.whitespace
+ local interlinespace = settings.interlinespace
local language = settings.language
local backgroundcolor = settings.backgroundcolor
context.unprotect()
@@ -112,6 +115,10 @@ function correspondence.place(environment,settings)
if whitespace ~= "" then
context.setupwhitespace{whitespace}
end
+ -- feature
+ if interlinespace ~= "" then
+ context.setupinterlinespace{interlinespace}
+ end
-- I prefer to set this with \setup…options
if language ~= "" then
context.mainlanguage{language}
@@ -134,6 +141,7 @@ function correspondence.place(environment,settings)
-- letters are always singlesided because the layout controlled by the module
context.setuppagenumbering{ alternative = v_singlesided, location = "" }
context.setupsubpagenumber{ way = v_text, state = v_start }
+ context.resetsubpagenumber()
-- sections
for _, element in next, correspondence.data[concat({environment,v_section},":")] or { } do
context.correspondence_section_place({environment},{element})
diff --git a/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkii b/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkii
index 535d5a8600d..a30f8195ccc 100644
--- a/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkii
+++ b/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkii
@@ -1,6 +1,6 @@
%D \module
%D [ file=s-cor-00,
-%D version=2012.02.15,
+%D version=2012.02.19,
%D title=\CONTEXT\ User Module,
%D subtitle=Correspondence,
%D author=Wolfgang Schuster,
diff --git a/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkvi b/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkvi
index 70d64469da1..36b998ca921 100644
--- a/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkvi
+++ b/Master/texmf-dist/tex/context/third/letter/base/s-cor-00.mkvi
@@ -1,6 +1,6 @@
%D \module
%D [ file=s-cor-00,
-%D version=2012.02.16,
+%D version=2012.05.15,
%D title=\CONTEXT\ User Module,
%D subtitle=Correspondence,
%D author=Wolfgang Schuster,
@@ -54,13 +54,17 @@
\setinterfaceconstant {fromurl} {fromurl}
\setinterfaceconstant {salutation} {salutation}
\setinterfaceconstant {language} {language}
+ \setinterfaceconstant {leftalign} {leftalign}
+ \setinterfaceconstant {rightalign} {rightalign}
+ \setinterfaceconstant {datestyle} {datestyle}
+ \setinterfaceconstant {datecolor} {datecolor}
+ \setinterfaceconstant {subtitlestyle} {subtitlestyle}
+ \setinterfaceconstant {subtitlecolor} {subtitlecolor}
\stopinterface
\startinterface all
+ % all
\setinterfacevariable {correspondence} {correspondence}
- \setinterfacevariable {letter} {letter}
- \setinterfacevariable {memo} {memo}
- \setinterfacevariable {resume} {resume}
\setinterfacevariable {nexthead} {nexthead}
\setinterfacevariable {lefthead} {lefthead}
\setinterfacevariable {righthead} {righthead}
@@ -68,6 +72,10 @@
\setinterfacevariable {nextfoot} {nextfoot}
\setinterfacevariable {leftfoot} {leftfoot}
\setinterfacevariable {rightfoot} {rightfoot}
+ % letter
+ \setinterfacevariable {letter} {letter}
+ \setinterfacevariable {lettermain} {lettermain}
+ \setinterfacevariable {letternext} {letternext}
\setinterfacevariable {address} {address}
\setinterfacevariable {backaddress} {backaddress}
\setinterfacevariable {location} {location}
@@ -76,12 +84,6 @@
\setinterfacevariable {cutmark} {cutmark}
\setinterfacevariable {endmark} {endmark}
\setinterfacevariable {usermark} {usermark}
- \setinterfacevariable {lettermain} {lettermain}
- \setinterfacevariable {letternext} {letternext}
- \setinterfacevariable {memomain} {memomain}
- \setinterfacevariable {memonext} {memonext}
- \setinterfacevariable {resumemain} {resumemain}
- \setinterfacevariable {resumenext} {resumenext}
\setinterfacevariable {opening} {opening}
\setinterfacevariable {closing} {closing}
\setinterfacevariable {secondpage} {secondpage}
@@ -119,6 +121,20 @@
\setinterfacevariable {modified} {modified}
\setinterfacevariable {blockstyle} {blockstyle}
\setinterfacevariable {knuth} {knuth}
+ % memo
+ \setinterfacevariable {memo} {memo}
+ \setinterfacevariable {memomain} {memomain}
+ \setinterfacevariable {memonext} {memonext}
+ \setinterfacevariable {casual} {casual}
+ \setinterfacevariable {classic} {classic}
+ % resume
+ \setinterfacevariable {resume} {resume}
+ \setinterfacevariable {resumemain} {resumemain}
+ \setinterfacevariable {resumenext} {resumenext}
+ % frames
+ \setinterfacevariable {frames} {frames}
+ \setinterfacevariable {framesmain} {framesmain}
+ \setinterfacevariable {framesnext} {framesnext}
\stopinterface
% Messages
@@ -149,6 +165,14 @@
\installnamespace {correspondencelayout}
\installnamespace {correspondencehead}
\installnamespace {correspondenceheadalternative}
+\installnamespace {correspondenceparagraph}
+\installnamespace {correspondenceparagraphbuffer}
+\installnamespace {correspondenceparagraphalternative}
+\installnamespace {correspondenceparagraphsetups}
+
+% Itemgroup
+
+\defineitemgroup[\v!correspondence]
% Environment
@@ -190,12 +214,15 @@
\to \everydefinecorrespondence
\unexpanded\def\correspondence_parameters#environment#element#type%
- {\def\currentcorrespondenceelement {#environment:#element}%
- \def\currentcorrespondencecontent {#environment:#type:#element}%
- \let\currentcorrespondencelayer \currentcorrespondenceelement
- \let\currentcorrespondenceframe \currentcorrespondenceelement
- \let\currentcorrespondencesection \currentcorrespondenceelement
- \let\currentcorrespondencedescription\currentcorrespondenceelement}
+ {\edef\currentcorrespondenceenvironment{#environment}%
+ \edef\currentcorrespondenceelement {#element}%
+ \edef\currentcorrespondencecontent {#environment:#type:#element}%
+ \edef\currentcorrespondencelayer {#environment:#element}%
+ \edef\currentcorrespondenceframe {#environment:#element}%
+ \edef\currentcorrespondencesection {#environment:#element}%
+ \edef\currentcorrespondencedescription{#environment:#element}%
+ \edef\currentcorrespondencehead {#environment:#element}%
+ \edef\currentcorrespondenceparagraph {#environment:#element}}
% Setup
@@ -219,11 +246,35 @@
\ctxlua{thirddata.correspondence.place("\currentcorrespondence", {
bodyfont = "\correspondenceoptionparameter\c!bodyfont",
whitespace = "\correspondenceoptionparameter\c!whitespace",
+ interlinespace = "\correspondenceoptionparameter\c!interlinespace",
language = "\correspondenceoptionparameter\c!language",
backgroundcolor = "\correspondenceoptionparameter\c!backgroundcolor",
} )}%
\endgroup}
+% \unexpanded\def\correspondence_place[#environment]%
+% {\begingroup
+% \edef\currentcorrespondence{#environment}%
+% \let \currentcorrespondenceoption\currentcorrespondence
+% \the\t_correspondence_before
+% \page
+% \setuplayout[\c!method=\v!correspondence]%
+% \setupheader[\c!state=\v!stop]%
+% \setupfooter[\c!state=\v!stop]%
+% \doifsomething{\correspondenceoptionparameter\c!bodyfont }{\setupbodyfont [\correspondenceoptionparameter\c!bodyfont ]}%
+% \doifsomething{\correspondenceoptionparameter\c!whitespace}{\setupwhitespace[\correspondenceoptionparameter\c!whitespace]}%
+% \doifsomething{\correspondenceoptionparameter\c!language }{\mainlanguage [\correspondenceoptionparameter\c!language ]}%
+% \setupbackgrounds[\v!paper][\c!background=\v!color,\c!backgroundcolor=\correspondenceoptionparameter\c!backgroundcolor]%
+% \setupbackgrounds[\v!page ][\c!background={\????correspondenceoverlay\c!backgroundimage,\????correspondenceoverlay\c!background,\????correspondenceoverlay\v!layer}]%
+% \setuppagenumbering [\c!alternative=\v!singlesided,location=]%
+% \setupsubpagenumber [\c!way=\v!text,\c!state=\v!start]%
+% \processcommacommand[\correspondence_elements_access\currentcorrespondence\v!section]{\correspondence_section_place\currentcorrespondence}%
+% \page
+% \resetsubpagenumber
+% \setuplayout[\v!reset]%
+% \the\t_correspondence_after
+% \endgroup}
+
%D Besides the normal letter environment there are three different ways to flush
%D the content of a letter after the text was set with a buffer etc.
%D
@@ -235,7 +286,9 @@
\let\placecorrespondence\correspondence_place
-\t_correspondence_before\expandafter{\the\t_correspondence_before\global\c_correspondence_page\zerocount}
+\appendtoks
+ \global\c_correspondence_page\zerocount
+\to \t_correspondence_before
\appendtoks
\setuevalue{\e!place\currentcorrespondence}{\correspondence_place[\currentcorrespondence]}%
@@ -259,7 +312,7 @@
{\edef\currentcorrespondencelayer{#environment:#element}%
\setupcurrentcorrespondencelayer[#parameters]%
\the\everysetupcorrespondencelayer}%
- \processcommalist[#elements]\correspondence_layer_command}
+ \processcommacommand[#elements]\correspondence_layer_command}
\appendtoks
\setuplayer
@@ -273,7 +326,7 @@
{\def\correspondence_frame_command#element%
{\edef\currentcorrespondenceframe{#environment:#element}%
\setupcurrentcorrespondenceframe[#parameters]}%
- \processcommalist[#elements]\correspondence_frame_command}
+ \processcommacommand[#elements]\correspondence_frame_command}
\setvalue{\????correspondencelayerstate\v!start }{\!!doneatrue \!!donebfalse \!!donecfalse}
\setvalue{\????correspondencelayerstate\v!stop }{\!!doneafalse \!!donebfalse \!!donecfalse}
@@ -296,11 +349,32 @@
\fi\fi
\tightlayer[\currentcorrespondencelayer]}
+% Can be faster with a single layer for all elements.
+%
+% \definelayer [\????correspondenceoverlay\v!layer][\c!width=\overlaywidth,\c!height=\overlayheight ]
+% \defineoverlay[\????correspondenceoverlay\v!layer][\correspondence_layer_place\currentcorrespondence]
+%
+% \unexpanded\def\correspondence_layer_place#environment%
+% {\def\correspondence_layer_state#element%
+% {\correspondence_parameters{#environment}{#element}\v!layer
+% \expandcheckedcsname\????correspondencelayerstate{\correspondencelayerparameter\c!state}\v!stop
+% \ifnum\c_correspondence_page=\plusone
+% \if!!donea\correspondence_layer_direct{#environment}{#element}\fi
+% \else\ifodd\c_correspondence_page
+% \if!!doneb\correspondence_layer_direct{#environment}{#element}\fi
+% \else
+% \if!!donec\correspondence_layer_direct{#environment}{#element}\fi
+% \fi\fi}%
+% \processcommacommand[\correspondence_elements_access{#environment}\v!layer]\correspondence_layer_state
+% \tightlayer[\????correspondenceoverlay\v!layer]}
+
\unexpanded\def\correspondence_layer_direct#environment#element%
{\setlayer
[\currentcorrespondencelayer]
{\inheritedcorrespondenceframeframed
- {\usecorrespondencelayerstyleandcolor\c!style\c!color
+ {\doifsomething{\correspondencelayerparameter\c!bodyfont }{\switchtobodyfont [\correspondencelayerparameter\c!bodyfont ]}%
+ \doifsomething{\correspondencelayerparameter\c!interlinespace}{\setupinterlinespace[\correspondencelayerparameter\c!interlinespace]}%
+ \usecorrespondencelayerstyleandcolor\c!style\c!color
\doadaptleftskip {\correspondencelayerparameter\c!leftmargin }%
\doadaptrightskip{\correspondencelayerparameter\c!rightmargin}%
\doifsymboldefinedelse{\correspondencelayerparameter\c!symbol}%
@@ -324,7 +398,7 @@
\setupcorrespondenceframe
[ \c!frame=\v!off,
\c!offset=\zeropoint,
- \c!align=\v!right]
+ \c!align=\v!flushleft]
% Sections
@@ -338,13 +412,13 @@
{\def\correspondence_section_command#element%
{\edef\currentcorrespondencesection{#environment:#element}%
\setupcurrentcorrespondencesection[#parameters]}%
- \processcommalist[#elements]\correspondence_section_command}
+ \processcommacommand[#elements]\correspondence_section_command}
\unexpanded\def\correspondence_section_place[#environment][#element]%
{\begingroup
\correspondence_parameters{#environment}{#element}\v!section
\ifcsname\currentcorrespondencesectionhash\s!parent\endcsname
- \doifsomethingelse{\correspondencesectionparameter\c!spacebefore}{\blank[\correspondencesectionparameter\c!spacebefore]}{\endgraf}%
+ \doifsomethingelse{\correspondencesectionparameter\c!spacebefore}{\blank[\correspondencesectionparameter\c!spacebefore]}\endgraf
\correspondencesectionparameter\c!before
\doadaptleftskip {\correspondencesectionparameter\c!leftmargin }%
\doadaptrightskip{\correspondencesectionparameter\c!rightmargin}%
@@ -353,7 +427,7 @@
\usecorrespondencesectionstyleandcolor\c!style\c!color
\correspondence_element_place[#environment][\v!section][#element][\correspondencesectionparameter\c!alternative]%
\correspondencesectionparameter\c!after
- \doifsomethingelse{\correspondencesectionparameter\c!spaceafter }{\blank[\correspondencesectionparameter\c!spaceafter ]}{\endgraf}%
+ \doifsomethingelse{\correspondencesectionparameter\c!spaceafter }{\blank[\correspondencesectionparameter\c!spaceafter ]}\endgraf
\else
\showmessage\m!correspondence{2}{#element,#environment}%
\fi
@@ -398,7 +472,7 @@
{\def\correspondence_description_command#element%
{\edef\currentcorrespondencedescription{#environment:#element}
\setupcurrentcorrespondencedescription[#parameters]}%
- \processcommalist[#elements]\correspondence_description_command}
+ \processcommacommand[#elements]\correspondence_description_command}
\unexpanded\def\correspondence_description_place#environment#element%
{\begingroup
@@ -406,7 +480,7 @@
\ifcsname\currentcorrespondencedescriptionhash\s!parent\endcsname
\doifsomethingelse{\correspondencedescriptionparameter\c!textcommand}\donetrue\donefalse
\ifdone
- \doifsomethingelse{\correspondencedescriptionparameter\c!spacebefore}{\blank[\correspondencedescriptionparameter\c!spacebefore]}{\endgraf}%
+ \doifsomethingelse{\correspondencedescriptionparameter\c!spacebefore}{\blank[\correspondencedescriptionparameter\c!spacebefore]}\endgraf
\correspondencedescriptionparameter\c!before
\setbox\scratchbox\hbox
{\usecorrespondencedescriptionstyleandcolor\c!headstyle\c!headcolor
@@ -419,7 +493,7 @@
\ctxlua{thirddata.correspondence.description_split("\correspondencedescriptionparameter\c!textcommand")}%
\expandcheckedcsname\????correspondencedescriptionlocation{\correspondencedescriptionparameter\c!location}\v!left
\correspondencedescriptionparameter\c!after
- \doifsomethingelse{\correspondencedescriptionparameter\c!spaceafter}{\blank[\correspondencedescriptionparameter\c!spaceafter]}{\endgraf}%
+ \doifsomethingelse{\correspondencedescriptionparameter\c!spaceafter}{\blank[\correspondencedescriptionparameter\c!spaceafter]}\endgraf
\fi
\else
\showmessage\m!correspondence{3}{#element,#environment}%
@@ -450,7 +524,7 @@
{\def\correspondence_description_format_item#text{\startitem#text\stopitem}%
\dontleavehmode\vtop\bgroup
\leftskip\zeropoint % prevent additional offset when “location=left” is used
- \startitemgroup[\v!itemize][\v!packed,\correspondencedescriptionparameter\c!symbol]%
+ \startitemgroup[\v!correspondence][\v!packed,\correspondencedescriptionparameter\c!symbol]%
\processcommacommand[\m_correspondence_description_items]\correspondence_description_format_item
\stopitemgroup
\egroup}
@@ -463,23 +537,136 @@
\c!distance=1em,
\c!symbol=dash]
+% Paragraphs
+
+\installsimplecommandhandler \????correspondenceparagraph {correspondenceparagraph} \????correspondenceparagraph
+
+\newtoks\t_correspondence_paragraphs
+
+\appendtoks
+ \the\t_correspondence_paragraphs
+\to \t_correspondence_before
+
+\unexpanded\def\correspondence_paragraph_define[#environment][#element]%
+ {\def\currentcorrespondenceparagraph{#environment:#element}%
+ \checkcorrespondenceparagraphparent
+ \t_correspondence_paragraphs\expandafter{\the\t_correspondence_paragraphs\correspondence_paragraph_commands[#environment][#element]}}
+
+\unexpanded\def\correspondence_paragraph_setup[#environment][#elements][#parameters]%
+ {\def\correspondence_paragraph_command#element%
+ {\edef\currentcorrespondenceparagraph{#environment:#element}%
+ \setupcurrentcorrespondenceparagraph[#parameters]}%
+ \processcommacommand[#elements]\correspondence_paragraph_command}
+
+\unexpanded\def\correspondence_paragraph_commands[#environment][#element]%
+ {\setuevalue{\e!start#element}{\correspondence_paragraph_beg[#environment][#element]}%
+ \setuevalue{\e!stop #element}{\correspondence_paragraph_end[#environment][#element]}}
+
+\unexpanded\def\correspondence_paragraph_beg[#environment][#element]%
+ {\begingroup
+ \correspondence_parameters{#environment}{#element}\v!paragraph
+ \dosingleempty\correspondence_paragraph_beg_parameters}%
+
+\unexpanded\def\correspondence_paragraph_beg_parameters[#parameters]%
+ {\iffirstargument
+ \setupcurrentcorrespondenceparagraph[#parameters]%
+ \fi
+ \grabbufferdatadirect{\????correspondenceparagraphbuffer\currentcorrespondenceparagraph}{\e!start\currentcorrespondenceelement}{\e!stop\currentcorrespondenceelement}}
+
+\unexpanded\def\correspondence_paragraph_end[#environment][#element]%
+ {\edef\p_correspondence_paragraph_setups{\correspondenceparagraphparameter\c!setups}%
+ \ifx\p_correspondence_paragraph_setups\empty \else
+ \doifsetupselse{\????correspondenceparagraphsetups:#environment:\p_correspondence_paragraph_setups}
+ {\texsetup{\????correspondenceparagraphsetups:#environment:\p_correspondence_paragraph_setups}}
+ {\texsetup\p_correspondence_paragraph_setups}%
+ \fi
+ \doifsomethingelse{\correspondenceparagraphparameter\c!spacebefore}{\blank[\correspondenceparagraphparameter\c!spacebefore]}\endgraf
+ \expandcheckedcsname\????correspondenceparagraphalternative{\correspondenceparagraphparameter\c!alternative}\s!default
+ \doifsomethingelse{\correspondenceparagraphparameter\c!spaceafter }{\blank[\correspondenceparagraphparameter\c!spaceafter ]}\endgraf
+ \endgroup}
+
+\unexpanded\def\correspondence_paragraph_lefttext
+ {\edef\p_correspondence_paragraph_lefttext{\correspondenceparagraphparameter\c!lefttext}%
+ \ifx\p_correspondence_paragraph_lefttext\empty \else
+ \margindata
+ [\v!inleft]
+ [\c!style=\correspondenceparagraphparameter\c!leftstyle,
+ \c!color=\correspondenceparagraphparameter\c!leftcolor]
+ [\c!align=\correspondenceparagraphparameter\c!leftalign]
+ {\correspondenceparagraphparameter\c!lefttext}%
+ \fi}
+
+\unexpanded\def\correspondence_paragraph_righttext
+ {\edef\p_correspondence_paragraph_righttext{\correspondenceparagraphparameter\c!righttext}%
+ \ifx\p_correspondence_paragraph_righttext\empty \else
+ \margindata
+ [\v!inright]
+ [\c!style=\correspondenceparagraphparameter\c!rightstyle,
+ \c!color=\correspondenceparagraphparameter\c!rightcolor]
+ [\c!align=\correspondenceparagraphparameter\c!rightalign]
+ {\correspondenceparagraphparameter\c!righttext}%
+ \fi}
+
+\unexpanded\def\correspondence_paragraph_text
+ {\edef\p_correspondence_paragraph_text{\correspondenceparagraphparameter\c!text}%
+ \ifx\p_correspondence_paragraph_text\empty \else
+ \correspondence_paragraph_lefttext % margin texts are only placed when there is normal text,
+ \correspondence_paragraph_righttext % for margin only texts one can use “left”, “right” or “both”
+ \begingroup
+ \usecorrespondenceparagraphstyleandcolor\c!textstyle\c!textcolor
+ \correspondenceparagraphparameter\c!text
+ \endgraf
+ \endgroup
+ \fi}
+
+\setvalue{\????correspondenceparagraphalternative\s!default}%
+ {\getbufferdata[\????correspondenceparagraphbuffer\currentcorrespondenceparagraph]}
+
+\setvalue{\????correspondenceparagraphalternative\v!left}%
+ {\correspondence_paragraph_lefttext
+ \getbufferdata[\????correspondenceparagraphbuffer\currentcorrespondenceparagraph]}
+
+\setvalue{\????correspondenceparagraphalternative\v!right}%
+ {\correspondence_paragraph_righttext
+ \getbufferdata[\????correspondenceparagraphbuffer\currentcorrespondenceparagraph]}
+
+\setvalue{\????correspondenceparagraphalternative\v!both}%
+ {\correspondence_paragraph_lefttext
+ \correspondence_paragraph_righttext
+ \getbufferdata[\????correspondenceparagraphbuffer\currentcorrespondenceparagraph]}
+
+\setvalue{\????correspondenceparagraphalternative\v!top}%
+ {\correspondence_paragraph_text
+ \doifsomethingelse{\correspondenceparagraphparameter\c!spaceinbetween}{\blank[\correspondenceparagraphparameter\c!spaceinbetween]}{\dosomebreak\nobreak}%
+ \getbufferdata[\????correspondenceparagraphbuffer\currentcorrespondenceparagraph]}
+
+\setupcorrespondenceparagraph
+ [\c!spacebefore=\v!line,
+ \c!spaceafter=\v!line,
+ \c!alternative=\s!default,
+ \c!leftalign=\v!flushleft,
+ \c!rightalign=\v!flushleft]
+
% Heading
\installsimpleframedcommandhandler \????correspondencehead {correspondencehead} \????correspondencehead
+\newtoks\t_correspondence_headings
+
+\appendtoks
+ \the\t_correspondence_headings
+\to \t_correspondence_before
+
\unexpanded\def\correspondence_head_define[#environment][#element]%
- {\ifcsname#element\endcsname \else % test if there already exists a command with the same name
- \def\currentcorrespondencehead{#environment:#element}%
- \checkcorrespondenceheadparent
- % heading from the this module are local to the correspondence environment
- \t_correspondence_before\expandafter{\the\t_correspondence_before\correspondence_head_commands[#environment][#element]}%
- \fi}
+ {\def\currentcorrespondencehead{#environment:#element}%
+ \checkcorrespondenceheadparent
+ \t_correspondence_headings\expandafter{\the\t_correspondence_headings\correspondence_head_commands[#environment][#element]}}
\unexpanded\def\correspondence_head_setup[#environment][#elements][#parameters]%
{\def\correspondence_head_command#element%
{\edef\currentcorrespondencehead{#environment:#element}%
\setupcurrentcorrespondencehead[#parameters]}%
- \processcommalist[#elements]\correspondence_head_command}
+ \processcommacommand[#elements]\correspondence_head_command}
\unexpanded\def\correspondence_head_commands[#environment][#element]%
{\setuevalue {#element}{\correspondence_head_cmd[#environment][#element]}%
@@ -488,7 +675,7 @@
\unexpanded\def\correspondence_head_cmd[#environment][#element]%
{\begingroup
- \def\currentcorrespondencehead{#environment:#element}%
+ \correspondence_parameters{#environment}{#element}\v!head
\doifnextbgroupelse{\dosinglegroupempty\correspondence_head_cmd_argument}{\dosingleempty\correspondence_head_cmd_parameters}}
\unexpanded\def\correspondence_head_cmd_argument#title%
@@ -533,6 +720,23 @@
\egroup
\doifsomething{\correspondenceheadparameter\c!spaceafter }{\blank[\correspondenceheadparameter\c!spaceafter ]}}
+\setvalue{\????correspondenceheadalternative\v!margin}%
+ {\doifsomething{\correspondenceheadparameter\c!spacebefore}{\blank[\correspondenceheadparameter\c!spacebefore]}%
+ \noindent\hskip-\dimexpr\leftmarginwidth+\leftmargindistance\relax
+ \hbox\bgroup
+ \usecorrespondenceheadstyleandcolor\c!style\c!color
+ \correspondenceheadparameter\c!title
+ \egroup
+ \doifsomething{\correspondenceheadparameter\c!spaceafter }{\blank[\correspondenceheadparameter\c!spaceafter ]}}
+
+\setvalue{\????correspondenceheadalternative\v!inmargin}%
+ {\margindata
+ [\v!inleft]
+ [\c!style=\correspondenceheadparameter\c!style,
+ \c!color=\correspondenceheadparameter\c!color]
+ [\c!align=\correspondenceheadparameter\c!align]
+ {\correspondenceheadparameter\c!title}}
+
\setupcorrespondencehead
[ \c!spacebefore=\v!line,
\c!spaceafter={\v!samepage,\v!line},
@@ -546,7 +750,7 @@
{\setvalue{\????correspondenceelement:#environment:#type:#element:#name}{#content}}
\unexpanded\def\correspondence_element_place[#environment][#type][#element][#name]%
- {\correspondence_parameters{#environment}{#element}{#type}%
+ {%\correspondence_parameters{#environment}{#element}{#type}%
\expandcheckedcsname{\????correspondenceelement:#environment:#type:#element:}{#name}\s!default}
% Files
@@ -554,7 +758,7 @@
\unexpanded\def\correspondence_file_load[#environment][#names]%
{\def\correspondence_file_command#name%
{\ctxlua{thirddata.correspondence.file("#environment","#name")}}%
- \processcommalist[#names]\correspondence_file_command}
+ \processcommacommand[#names]\correspondence_file_command}
% Style
@@ -564,7 +768,7 @@
{\def\correspondence_style_command#element%
{\edef\currentcorrespondencestyle{#environment:#element}%
\setupcurrentcorrespondencestyle[#parameters]}%
- \processcommalist[#elements]\correspondence_style_command}
+ \processcommacommand[#elements]\correspondence_style_command}
\unexpanded\def\correspondence_style_width#environment#element#content%
{\edef\currentcorrespondencestyle {#environment:#element}%
@@ -608,7 +812,7 @@
{\def\correspondence_layout_command#element%
{\def\m_correspondence_layout_current{#environment#element}%
\setuplayout[\????correspondencelayout\m_correspondence_layout_current][#parameters]}%
- \processcommalist[#elements]\correspondence_layout_command}
+ \processcommacommand[#elements]\correspondence_layout_command}
\appendtoks
\correspondence_layout_define[\currentcorrespondence][\v!firstpage ]%
diff --git a/Master/texmf-dist/tex/context/third/letter/base/s-cor-01.mkii b/Master/texmf-dist/tex/context/third/letter/base/s-cor-01.mkii
index b2b6b5454eb..4831cfa278d 100644
--- a/Master/texmf-dist/tex/context/third/letter/base/s-cor-01.mkii
+++ b/Master/texmf-dist/tex/context/third/letter/base/s-cor-01.mkii
@@ -1,6 +1,6 @@
%D \module
%D [ file=s-cor-01,
-%D version=2012.02.04,
+%D version=2012.02.19,
%D title=\CONTEXT\ User Module,
%D subtitle=Letters,
%D author=Wolfgang Schuster,