1

I have to make an global change in many enumerate lists, so in need define a command that I can apply without braces in a such way that only applies until the end of the paragraph (or line), for example

\item \changecolor  text text text text text text text text text text 
                     text text text text text text text text text.
 %defautl color
 othertextothertextothertextothertextothertextothertextothertextot

Is it possible to do that?

  • What is the change that you need to make? Are you wanting to change enumerate, and then have it change back? Could you post a minimal example that gives us a before and after (using braces if necessary so that we can see what you want to happen)? – Teepeemm Nov 18 '16 at 14:59
  • Enumeration it's circumstantial. The command \changecolor applies to any paragraph in a such way that when it realize that the paragraph end up, then, it stop (similar to close the brace) – wmora2 Nov 18 '16 at 15:49
  • it's possible but fragile and can easily break other code in the document, is there any reason not to simply use \item \textcolor{red}{text ...text} ? – David Carlisle Nov 18 '16 at 16:20
  • I need to apply this procedure to the exercise lists of an extended book. The natural solution would be to put curly braces at the beginning and end on hundreds of paragraphs. But that's what I want to avoid – wmora2 Nov 18 '16 at 16:30
  • But the solution you're looking for will still need you to put hundreds of \changecolors at the beginning of paragraphs. Is there some command or environment that is already present that you can simply modify? The "right way to do it" would be to put some macro or environment around those exercises, even if it takes a few hours of work. That would save you hours of headaches later, when a fragile command starts breaking other stuff. – Teepeemm Nov 18 '16 at 16:48
1
\def\changecolor{\begingroup\def\par{\endgroup\par}\color{red}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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