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.

TeXstudio does not recognize the LaTeX command \rm (red highlighting in the document, with the message: unrecognized command), even after I activate all possible completion files (.cwl).

In such a case, what can I do so that TeXstudio recognizes a certain command for highlighting?

share|improve this question
    
Welcome to TeX.SE. I don't think \rm is a standard macro -- at least I never heard if it. –  Peter Grill Sep 29 '12 at 22:56
6  
\rm has been declared obsolete some years ago and it's best not to use it, just like the companion commands \it, \bf, \sf and \tt. –  egreg Sep 29 '12 at 22:57
3  
Please throw away your obsolete LaTeX documentation that suggested \rm (it has been deprecated since 1993) and get one more actually describing LaTeX2e. –  Martin Schröder Sep 29 '12 at 23:35
    
With the general wording of the question as it is now, I don't think there's any reason to close it as too localized. (Didn't really think there was one before that either.) –  doncherry Oct 15 '12 at 13:44
add comment

1 Answer 1

This is still a recognized command (for legacy purposes), but should be avoided. See Does it matter if I use \textit or \it, \bfseries or \bf, etc. and Will two-letter font style commands (\bf, \it, …) ever be resurrected in LaTeX?.

TeXstudio does allow you to add commands that are not recognized to its list of known control sequences. Under Options -> Configure TeXstudio... check Show Advanced Options and add \rm to the list of Additional Commands as part of your Custom Highlighting:

enter image description here

Your document syntax highlight should change from

enter image description here

to

enter image description here

Another approach (perhaps better for legacy documents) is to replace any two-letter font style commands with their updated counterparts:

\renewcommand{\rm}{\rmfamily}
\renewcommand{\it}{\itshape}
%...

This renewal will also be picked up by TeXstudio.

share|improve this answer
    
I wouldn't recommend to modify legacy documents in that way: \rm\it was different from \it\rm in LaTeX2.09 and still is with the two letter commands. The best is forgetting them altogether. –  egreg Oct 15 '12 at 13:56
    
In TeXstudio 2.6.6 (Windows) on my computer, this fix only works after restarting TeXstudio. –  Cerran Feb 19 at 15:44
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.