"Missing number, treated as zero." in LaTex

25,092

Solution 1

I think you mean \Roman not \Rome. Anyway, \Roman prints the value of a counter as a roman numeral, so you can't use it with "2".

Short answer - use \romannumeral 2.

Long answer - define commands as described here.

Solution 2

I would suggest to use that snippet:

\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother

now you can call:

\Rmnum{2} % II
\rmnum{2} % ii
Share:
25,092
Tim
Author by

Tim

Elitists are oppressive, anti-intellectual, ultra-conservative, and cancerous to the society, environment, and humanity. Please help make Stack Exchange a better place. Expose elite supremacy, elitist brutality, and moderation injustice to https://stackoverflow.com/contact (complicit community managers), in comments, to meta, outside Stack Exchange, and by legal actions. Push back and don't let them normalize their behaviors. Changes always happen from the bottom up. Thank you very much! Just a curious self learner. Almost always upvote replies. Thanks for enlightenment! Meanwhile, Corruption and abuses have been rampantly coming from elitists. Supportive comments have been removed and attacks are kept to control the direction of discourse. Outright vicious comments have been removed only to conceal atrocities. Systematic discrimination has been made into policies. Countless users have been harassed, persecuted, and suffocated. Q&A sites are for everyone to learn and grow, not for elitists to indulge abusive oppression, and cover up for each other. https://softwareengineering.stackexchange.com/posts/419086/revisions https://math.meta.stackexchange.com/q/32539/ (https://i.stack.imgur.com/4knYh.png) and https://math.meta.stackexchange.com/q/32548/ (https://i.stack.imgur.com/9gaZ2.png) https://meta.stackexchange.com/posts/353417/timeline (The moderators defended continuous harassment comments showing no reading and understanding of my post) https://cs.stackexchange.com/posts/125651/timeline (a PLT academic had trouble with the books I am reading and disparaged my self learning posts, and a moderator with long abusive history added more insults.) https://stackoverflow.com/posts/61679659/revisions (homework libels) Much more that have happened.

Updated on June 10, 2020

Comments

  • Tim
    Tim almost 4 years

    I want to get the Roman number of 2. So I use $\Roman{2}$ inside text. But then I got an error

    Missing number, treated as zero.

    How can I fix it?

    Thanks and regards!

    • paxdiablo
      paxdiablo almost 11 years
      This would be better moved to tex.stackexchange.com - it is in no way a programming question.
  • Tim
    Tim almost 14 years
    Thanks! Why sometimes I saw some commands taking arg inside {}, sometimes not?
  • ptomato
    ptomato almost 14 years
    LaTeX commands always take arguments inside {} or []. The reason is because \romannumeral isn't really a LaTeX command, it's a TeX command. Usually you don't want to mess around with those.
  • hola
    hola almost 4 years
    Apparently it does not work with something like \cite[Section \Rmnum{1}]{mycitation}. Any suggestion on how to fix this?