# Roman numerals with over- and underline

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

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

-
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. – Martin Scharrer Jul 25 '11 at 17:01
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 Jul 26 '11 at 17:21

\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}


-
Thanks, great! Thus, there is no such command, but you made one. That is a lot morr than I expected. – Stephen Jul 26 '11 at 17:27
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 Jul 26 '11 at 17:39
@egreg This command literally saved me working under the wire, thanks!!! – Bryson S. Feb 17 at 22:50