43

This question led to a new package:
romanbar

(using a variation of egreg's code, and stating this in the manual; the package isn't really new now, sorry for the delayed announcement)

I have read about "How to get Roman numerals" but asked myself how to get Roman numerals formatted as in

Roman VI

i.e. with fitted over- and underline (without manually using boxes and such)? I'm curious for your answer(s)!

2
  • 1
    Please make sure that all images are uploaded using the official stackexchange interface, i.e. the image icon on top of the text field (shortcut: CTRL+G). This ensures that all images are always accessible and do not expire. As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. Commented Jul 25, 2011 at 17:01
  • 2
    Thanks! I tried to upload, was told that I'm not allowed (yet), and didn't know about removing "!". Would be good to include that information in the "You are not (yet) allowed..." message.
    – Stephen
    Commented Jul 26, 2011 at 17:21

1 Answer 1

37
\def\barroman#1{\sbox0{#1}\dimen0=\dimexpr\wd0+1pt\relax
  \makebox[\dimen0]{\rlap{\vrule width\dimen0 height 0.06ex depth 0.06ex}%
    \rlap{\vrule width\dimen0 height\dimexpr\ht0+0.03ex\relax 
            depth\dimexpr-\ht0+0.09ex\relax}%
    \kern.5pt#1\kern.5pt}}

\barroman{I} \barroman{XI}

3
  • 3
    Thanks, great! Thus, there is no such command, but you made one. That is a lot morr than I expected.
    – Stephen
    Commented Jul 26, 2011 at 17:27
  • 2
    Actually the result is not that nice. The bars need to change thickness in order to hide the serifs at all sizes and the "overshoot" of the "V" under the baseline. But such things won't be used that often.
    – egreg
    Commented Jul 26, 2011 at 17:39
  • @egreg This command literally saved me working under the wire, thanks!!!
    – Bryson S.
    Commented Feb 17, 2016 at 22:50

You must log in to answer this question.

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