Hi list,

How would you set the width of the columns in the code below?

Currently, I have:

https://i.sstatic.net/O8YyiT18.png

I'm trying to shrink the left-hand column to achieve something closer to
the following:

https://i.sstatic.net/0kAa9MgC.png

Max produced an answer that almost worked; the issue is that it uses
"grabbufferdata" and depends on the literal phrase "startheader" and
"stopheader". The problem with that approach is the document start/stop
environments are created dynamically based on DIV class names, as per the
following code:

% Map arbitrary div classes, defined by fenced divs.
\startxmlsetups xml:div
  % Capture attributes as variables.
  \setvariable{div}{\xmlatt{#1}{class}}{#1}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop{}
\stopxmlsetups

Without modifying anything between \starttext and \stoptext, is there
another way to use column (sets) that allows setting the width of the
columns? See below.

context lmtx 2025.09.25 18:46

Thank you!

% --- SOF ---
\definestartstop[header]
\definestartstop[letter]
\definestartstop[opening]
\definestartstop[closing]
\definestartstop[signature]
\definestartstop[contact]
\definestartstop[address]
\definestartstop[applicant]
\definestartstop[role]
\definestartstop[logo]

\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[mill]
\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[cow]
\stopsignature

Sherlock Holmes
\stopclosing

\stoptext
% --- EOF ---
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to