This question already has an answer here:

What'd be the most efficient way of lowercasing everything from the point of the command invocation until the end of the group, that is, how should one define a command that acts like, for example, {\scshape ... }, just lowering the case of everything that follows. Let's for the beginning say that what follows is just plain text. (also wondering if LaTeX3 will make such text, or text+commands, manipulations any easier?)

marked as duplicate by David Carlisle, Steven B. Segletes, Paul Gaborit, barbara beeton, Svend Tveskæg Apr 7 '16 at 17:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Thanks David. It does seem like a duplicate. So you're saying there are no smart barely legal ways of accomplishing this? Some recursive command eating characters one by one? – PhilipPirrip Apr 7 '16 at 16:12
  • yes you can iterate over the characters 1 by 1 (although doing it for general tex markup is tricky) if you have enough control over the input that you can be sure it is just plain text then 9 times out of 10 you have enough control to make sure it is lowercase anyway. – David Carlisle Apr 7 '16 at 21:24