TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just wrote 6 paragraphs of a report without really looking at the screen, and when I did, all of my upper case letters were lower case, and vice-versa. I had left the caps lock on. Is there a one-button solution to changing that? Highlite the whole page and hit "Sitch upper/lower case? Or do you always just have to start over?

share|improve this question

closed as off-topic by Mico, David Carlisle, Thorsten, Claudio Fiandrino, Kurt Sep 13 '13 at 16:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – Mico, David Carlisle, Thorsten, Claudio Fiandrino, Kurt
If this question can be reworded to fit the rules in the help center, please edit the question.

I guess this is more a text editor related question than a TeX question, isn't it? – Ludovic C. Sep 13 '13 at 15:32
Not one but 4: V6j~ (vim). – morbusg Sep 13 '13 at 15:33
Almost every editor comes with this feature, emacs is my favorite to take care of such situations. If you are not familiar with emacs, and do not want to go through its steep learning curve, use either MS Word or Libre Office Writer (copy-paste, convert case, again copy-paste back) for the purpose. – Masroor Sep 13 '13 at 15:40

This is unrelated to TeX, if your (unspecified) editor can not do this, tools like tr can:

echo 'tHE WORDS ARE wrong!' | tr [:upper:][:lower:] [:lower:][:upper:]


The words are WRONG!
share|improve this answer

This it not really TeX related.

But I foudn this and this website I think both fit your purposes. Just googled text uppercase tool.

share|improve this answer

Edit - cracked it, should now ignore commands. **Edit 2 - now handles commands terminated by space, as well as those ending with }.

In notepad++ (which I heartily recommend for editing .tex) I think you can do it using regex find&replace. Just replace:

(\\[a-zA-Z0-9_,\{]*[\}\ ])|([a-z])|([A-Z])



ensuring that "match case" is selected (and probably "within selection").

This should ignore commands now. If it still switches some, you may need to add more characters to the first set of brackets [character class] in the find regex.

If you've typed loads of text in with caps on, including commands, the regex is simpler - replace:




Which will invert the case of all characters in the selection.

share|improve this answer

You can open your file with vim , select the text you want and press ~ on the keyboard while in normal mode. This will switch the case of all the letters.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.