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.

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)!

share|improve this question
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. –  Martin Scharrer Jul 25 '11 at 17:01
1  
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
add comment

1 Answer

up vote 17 down vote accepted
\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}

share|improve this answer
3  
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
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 Jul 26 '11 at 17:39
add comment

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.