Background
Creating a configurable cover letter, which has a two-column layout. The first column is for address information, the second column is for the content.
Problem
I'd like to control the width of the first column to differ from the width of the second column. Currently, the widths are the same, as this screen capture shows:
The desired output resembles (well, with "elit" word wrapping properly, but the idea is close enough):
Various attempts to make this layout work have failed:
- Extreme tables -- resulted in overflow error
- Natural tables -- overflow error
\startcolumns
\defineparagraphs
-- weird behaviour\startboxedcolumns
-- affects entire document\startpagecolumns
-- inapplicable because the columns start after the header\startmixedcolumns
-- cannot set width\startcolumnsets
-- rearranges content, puts in a new page regardless of\pagebreak
setting\usemodule[newcolumnsets]
-- the "Sincerely," line jumps to the bottom of column- Custom
\hbox
and\vtop
-- couldn't reinstate paragraph breaks - Hanging
\framed
s -- couldn't reinstate paragraph breaks
Code
In a nutshell, the closest code that almost works, as shown in the screen capture, is:
\definestartstop[letter]
\setupstartstop[contact][
before={%
\startmixedcolumns[
n=2
]\bgroup%
},
after={\column},
]
\setupstartstop[letter][
after={\egroup\stopmixedcolumns},
]
However, there's no width
key to tweak the first column's width.
Markdown
The cover letter stems from a Markdown document:
::: header
::: logo

:::
[{{employee.name}}]{.applicant}
[{{employee.role}}]{.role}
:::
::: contact
::: address
{{employee.address.line.1}}
{{employee.address.line.2}}
{{employee.address.line.3}}
:::
[{{employee.contact.phone}}]{.phone}
[{{employee.contact.email}}]{.email}
[{{employee.portfolio.url}}]{.portfolio}
:::
::: letter
::: opening
To whom it may concern,
:::
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
::: closing
Sincerely,
::: signature

:::
{{employee.name}}
:::
XHTML
The Markdown is converted to XHTML:
<body>
<div class="header"><div class="logo">
<p><img alt="Henry Baskerville" src="logo.svg"/></p>
</div>
<p><span class="applicant">Sherlock Holmes</span></p>
<p><span class="role">Private Investigator</span></p>
</div><div class="contact"><div class="address">
<p>221B Baker Street</p>
<p>Marlyebone, London</p>
<p>NW1 6XE</p>
</div>
<p><span class="phone">020 7224 3688</span></p>
<p><span class="email">[email protected]</span></p>
<p><span class="portfolio">https://www.sherlock-holmes.co.uk</span></p>
</div><div class="letter"><div class="opening">
<p>To whom it may concern,</p>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<div class="closing">
<p>Sincerely,</p>
<div class="signature">
<p><img alt="Sherlock Holmes" src="signature.png"/></p>
</div>
<p>Sherlock Holmes</p>
</div></div>
</body>
There's a fair amount of infrastructure that converts the XML to ConTeXt macros.
Minimal example
A fairly trimmed down example of the code:
\definestartstop[header]
\definestartstop[letter]
\definestartstop[opening]
\definestartstop[closing]
\definestartstop[signature]
\definestartstop[contact]
\definestartstop[address]
\definestartstop[applicant]
\definestartstop[role]
\setupstartstop[contact][
before={%
\startmixedcolumns[
n=2,
separator=rule,
]\bgroup%
},
after={\column},
]
\setupstartstop[letter][
after={\egroup\stopmixedcolumns},
]
%%% The content between \starttext and \stoptext is immutable,
%%% because it is sourced from an XML document.
\starttext
\startheader
\startlogo
\externalfigure[logo.svg]
\stoplogo
\startapplicant Sherlock Holmes \stopapplicant
\startrole Private Investigator \stoprole
\stopheader
\blackrule[width=\textwidth]
\startcontact
\startaddress
221B Baker Street \par
Marlyebone, London \par
NW1 6XE \par
\stopaddress
020 7224 3688 \par
[email protected] \par
https://www.sherlock-holmes.co.uk \par
\stopcontact
\startletter
\startopening
To whom it may concern,
\stopopening
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\startclosing
Sincerely,
\startsignature
\externalfigure[signature.png]
\stopsignature
Sherlock Holmes
\stopclosing
\stoptext
Question
What approach would you take to set up unequal columns widths that start below existing content?
For example, should I just move the logo and the name + role into the actual header? Or is there another approach that'll work?