4

I'm playing with coffins for a title page and would like to have a square framed box that aligns with the topline and baseline of text within a rotated coffin. I have a couple of issues with this so far that I need some help with:

  1. There appears to be a margin to the left and right of the frame that produces space between the handles and the frame. Why is this here and how can I fix it?

  2. The framed box, in addition to not being square, is too large. How can I set the size of the framed box to match the height of the text?

enter image description here

From the image (edited a bit to show the problem) the handles on the text appear to be where I would expect as are the handles on the top and bottom of the framed box. MWE below.

\documentclass{article}
\usepackage{tgheros}
\usepackage[T1]{fontenc}
\usepackage{xcoffins}
\usepackage{xcolor}
\renewcommand*\familydefault{\sfdefault}

\begin{document}
    \NewCoffin \result
    \NewCoffin \TRBlock
    \NewCoffin \LeftMar

    \SetHorizontalCoffin \result {}


    \SetHorizontalCoffin \LeftMar {\fontsize{52}{50}\selectfont\color{gray}D}
    \SetHorizontalCoffin \TRBlock {
        \fbox{\begin{minipage}[c][\CoffinHeight\LeftMar]{\CoffinHeight\LeftMar}\centering A\end{minipage}}
    }

    \RotateCoffin \LeftMar {90}
    \JoinCoffins\result[vc,hc]\LeftMar[r,vc]
    \JoinCoffins\result[\LeftMar-B,\LeftMar-r] \TRBlock[r,b]
    \TypesetCoffin \result
\end{document}
3
  • 2
    As standard, \fbox adds a margin: try setting \fboxsep = 0 pt . Also, watch for additional spaces: you need a % after the { in the \SetHorizontalCoffin \TRBlock line, for example.
    – Joseph Wright
    Jun 9, 2012 at 7:37
  • 2
    If you're thinking of doing additional precision-fitting of ink into coffins, this question may also be helpful. Jun 9, 2012 at 10:07
  • @JosephWright Thanks Joseph, that did the trick. I should have thought of the space, but didn't know about the fboxsep. Would you mind posting that as an answer so that I can accept it?
    – Scott H.
    Jun 9, 2012 at 16:27

1 Answer 1

2

[Something of a comment made into an answer.]

As standard, \fbox adds a margin: try setting \fboxsep = 0 pt. Also, watch for additional spaces: you need a % after the { in the \SetHorizontalCoffin \TRBlock line, for example:

\SetHorizontalCoffin \TRBlock {%
    \fboxsep = 0 pt %
    \fbox{\begin{minipage}[c][\CoffinHeight\LeftMar]{\CoffinHeight\LeftMar}\centering A\end{minipage}}
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .