2

Recipient address is shifted to the right in French letters. I'm adding an indication that it will be sent by email ((via ...@...fr)) just below the formal address, and centered. I have somewhat achieved the desired result using two calls to makebox. I'm looking to experiment with xcoffins. Could someone suggest a way to complete it to resemble the benchmark case?

\documentclass{article}   
\usepackage{xcoffins}
\usepackage{calc}

\usepackage{lipsum}% dummy tex

\NewCoffin\CoffTop \NewCoffin\CoffBot

%%%%%%%%% set figures width/height plus height of text area \newlength{\maxwidthT} \setlength{\maxwidthT}{\widthof{XXXXXXXX XXXXXXXXXX XX XXXXX}} \newlength{\maxwidthB} \setlength{\maxwidthB}{\widthof{(via \texttt{xxxxxxxxxxxxxxxxxx.xxxxxxxx@xxxxxxx.fr})}}

\NewDocumentCommand{\MyAddressTop}{} {\begin{tabular}{@{\extracolsep{0mm}}l@{\extracolsep{0mm}}} XXXXXXXX XXXXXXXXXX XX XXXXX\ XXXXXXX / XXXXXXXXXXX XXXXX\ XXXXXX XX XXXXXXXX XX XXXXX\ XXXXX XXXXX XXXXX XX \end{tabular}}

\NewDocumentCommand{\MyAddressBot}{} {\begin{tabular}{@{\extracolsep{0mm}}c@{\extracolsep{0mm}}} \multicolumn{1}{l}{(via \texttt{xxxxxxxxxxxxxxxxxx.xxxxxxxx@xxxxxxx.fr})} \end{tabular}}

\begin{document}

% Approach 1) \makebox[0.9\textwidth][r] { \frame{\MyAddressTop} }\par \makebox[0.96\textwidth][r] { \frame{\MyAddressBot} }

\vspace{2em}

% Approach 2) \SetVerticalCoffin\CoffTop{\maxwidthT}{\frame{\MyAddressTop}} \SetVerticalCoffin\CoffBot{\maxwidthT}{\frame{\MyAddressBot}} \JoinCoffins*\CoffTop[hc,b]\CoffBot[hc,t]

%\TypesetCoffin⟨coffin⟩⟨pole1⟩,⟨pole2⟩

\TypesetCoffin\CoffTop

\clearpage \end{document}

enter image description here

Erwann
  • 2,100

1 Answers1

1

If you are not tied to the use of coffins, stackengine offers a trivial solution in the form of \stackunder[\fboxrule]{\frame{\MyAddressTop}}{\frame{\MyAddressBot}}. Here is the MWE.

\documentclass{article}   
\usepackage{stackengine}

\NewDocumentCommand{\MyAddressTop}{} {\begin{tabular}{@{\extracolsep{0mm}}l@{\extracolsep{0mm}}} XXXXXXXX XXXXXXXXXX XX XXXXX\ XXXXXXX / XXXXXXXXXXX XXXXX\ XXXXXX XX XXXXXXXX XX XXXXX\ XXXXX XXXXX XXXXX XX \end{tabular}}

\NewDocumentCommand{\MyAddressBot}{} {\begin{tabular}{@{\extracolsep{0mm}}c@{\extracolsep{0mm}}} \multicolumn{1}{l}{(via \texttt{xxxxxxxxxxxxxxxxxx.xxxxxxxx@xxxxxxx.fr})} \end{tabular}}

\begin{document} \stackunder[\fboxrule]{\frame{\MyAddressTop}}{\frame{\MyAddressBot}} \end{document}

enter image description here

Were you to \renewcommand\stackalignment{l} in advance of the stack, the resulting stack would be left-aligned. Likewise r for right-alignment.

  • 1
    Thx, likely the way to go for such a narrow problem. Still, I'd like to see the solution with coffins. – Erwann Sep 22 '21 at 13:04