latex: printing a variable in roman numerals

最后都变了- 提交于 2019-12-05 23:35:41

问题


I'm typesetting in LaTeX, and I'd like to display a "variable" (in my case, a reference \ref{blah} to an item number in list) in roman rather than the default arabic. Is there an easy way to do this? Thanks for any pointers!


回答1:


You can try \def\theenumi{\roman{enumi}} inside an enumerate environment -- this changes both labels and refs, but you'll have to then explicitly undo it (if you want to).




回答2:


lowercase

\romannumeral 0\ref{blah}\relax

uppercase

\uppercase\expandafter{\romannumeral 0\ref{blah}}




回答3:


What are the references to? Usually, you would redefine how that particular counter is displayed.

For example, to change how a section number is displayed, you could use the following command:

\renewcommand\thesection{\Roman{section}}

Now, each command that internally uses \thesection will print the section number as a roman numeral.

Similar commands work for chapter, figure etc.

\roman (lowercase r) yield lowercase roman numerals.




回答4:


For lowercase: {\romannumeral \ref{blah}}

For uppercase: \uppercase\expandafter{\romannumeral \ref{blah}}



来源:https://stackoverflow.com/questions/2579082/latex-printing-a-variable-in-roman-numerals

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!