Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I finish reading the Appendix D: Dirty Tricks in the TeXbook, I rethink a question: is it possible to align some character boxes like this:

enter image description here

The input may be like this:

    \font\fortyeightrm=cmr10 at48pt
    \font\twentyfourrm=cmr10 at24pt

    \parindent=0pt
    {\fortyeightrm A}|\twentyfourrm a b c d e f g h i j k l m n o p q r|
    \bye

We assume that when TeX is scanning the big A, it will place that character box at the baseline of the first line. When scanning the |, it will enter a group, then TeX will place the character boxes a, b, c, ... , r above then below the axis of the character box A (at this time, TeX may be insert the line-break at the end of a line, for example, behind the character box i)

I haven't a good and simple method to solve this. Also another question: is it possible to rotate the character box (maybe we should put it into a \hbox) ?

share|improve this question
    
Using (x)dvipdfm(x) (i.e., XeTeX) driver, the rotation could be: before \special{pdf: begintransform rotate 35 } rotated \special{pdf: endtransform} after\bye. But you're right, the content shouldn't be broken across pages according to the dvipdfm manual. –  morbusg Mar 29 '13 at 9:05

2 Answers 2

up vote 2 down vote accepted

Using 48pt and 24pt fonts is not a good idea, because the relevant dimension is the height of capitals. So the big letter should be in a larger size, in my opinion.

\font\highcapital=cmr10 at60pt
\font\twentyfourrm=cmr10 at24pt

\def\timlititle#1#2{%
  \hbox{%
    \setbox0=\hbox{\highcapital #1}%
    \dimen0=\ht0
    \box0\vbox to\dimen0{
      \twentyfourrm
      \def\\{\egroup\nointerlineskip\vss\hbox\bgroup\ignorespaces}%
      \hbox\bgroup#2\egroup}%
  }%
}

\hrule
\timlititle{A}
  {a b c d e f g h i \\
   j k l m n o p q r}

\bigskip

\font\highcapital=cmr10 at54pt

\hrule
\timlititle{A}
  {a b c d e f g h i \\
   j k l m n o p q r}

\bigskip

\font\highcapital=cmr10 at48pt

\hrule
\timlititle{A}
  {a b c d e f g h i \\
   j k l m n o p q r}

\bye

The \hrule commands are just to show the vertical alignment of the boxes. In Computer Modern, the "A" has quite a big overshoot at the top, so you may want to add a small correction for the right box height.

enter image description here

For rotating boxes, you can use eplain's facilities to load the LaTeX graphicx package:

\input eplain
\beginpackages
\usepackage{graphicx}
\endpackages

\rotatebox{-45}{Abcdef}
share|improve this answer
    
yeah, the first of the three examples is more pleasing to the eyes. Thanks, egreg. –  Timothy Li Mar 29 '13 at 0:28

enter image description here

    \font\fortyeightrm=cmr10 at48pt
    \font\twentyfourrm=cmr10 at24pt


\hsize 3in

\def\foo#1|#2|{%
\setbox0\hbox{#1}%
\dimen0\ht0
\advance\dimen0\dp0
\divide\dimen0 2
\leavevmode\raise -\dimen0 \hbox{\smash{\copy0}}\vtop{\advance\hsize-\wd0 #2}}

    \parindent=0pt

X\dotfill X

\bigskip

    \foo
    {\fortyeightrm A}|\twentyfourrm a b c d e f g h i j k l m n o p q r|


\bigskip

X\dotfill X
    \bye
share|improve this answer
    
Wonderful! I think this method is simple and elegant to solve my question :-) –  Timothy Li Mar 28 '13 at 14:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.