2

Is there in plain TeX a macro similar to \leftarrowfill but vertically oriented, something like \uparrowfill? I know it exists in LaTeX, but I'm interested only in plain TeX.

  • Can you add some context where you would be using such a macro? – egreg Dec 18 '13 at 18:33
  • @egreg Something like \vbox to 5in{\hsize=.5in\vbox to2in{\uparrowfill}\vskip1in\vbox to2in{\downarrowfill}} – Jean Baldraque Dec 18 '13 at 18:43
2

I don't understand what this should be for, but this could work.

\def\downarrowfill{%
  \par
  \begingroup\offinterlineskip
  \setbox0=\hbox{$\downarrow$}%
  \setbox2=\hbox to\wd0{\hss$|$\hss}%
  \copy2
  \kern-3pt
  \leaders\vbox{\kern-2pt\copy2\kern-2pt}\vfill
  \kern-3pt
  \box0
  \endgroup
}
\def\uparrowfill{%
  \par
  \begingroup\offinterlineskip
  \setbox0=\hbox{$\uparrow$}%
  \setbox2=\hbox to\wd0{\hss$|$\hss}%
  \copy0
  \kern-3pt
  \cleaders\vbox{\kern-2pt\copy2\kern-2pt}\vfill
  \kern-3pt
  \box2
  \endgroup
}

\vbox to 3cm{\hsize=1cm\vbox to1cm{\uparrowfill}\vfill\vbox to1cm{\downarrowfill}}

\bye

enter image description here

An alternative way:

\def\arrowto#1#2{%
  \setbox0=\hbox{%
    $\left#1%
     \vcenter to #2{}
     \right.
     \kern-\nulldelimiterspace$%
  }%
  \leavevmode\raise\dp0\box0}
\def\uparrowto{\arrowto\uparrow}
\def\downarrowto{\arrowto\downarrow}

a\uparrowto{12pt}a\downarrowto{12pt}a

\bye

enter image description here

  • 1
    one use: for drawing rectangular commutative diagrams. – barbara beeton Dec 18 '13 at 20:06
  • @egreg you've given a spectacular answer, as usual. – Jean Baldraque Dec 19 '13 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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