Text FormattingHow to return the color

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Miad
Posts: 1
Joined: Fri Sep 25, 2015 4:21 pm

How to return the color

Post by Miad »

Hi,
I think my question is easy, but I couldn't find the answer in previous talks.
I wrote an article and used "\textcolor{blue}" in many parts of it, to clarify the changes between this version of my article and its previous one. However, now I want to finalize it with just black color. I mean I need a totally clean version in black, while my text includes many "\textcolor{blue}" parts.
Please help me.
Last edited by cgnieder on Tue Sep 29, 2015 10:16 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to return the color

Post by Johannes_B »

Welcome to our little community.

Code: Select all

\documentclass{article}
\usepackage{tcolorbox}
\colorlet{blue}{black}% Just tell the package to map black to
%the blue name
%or renew the command
%\renewcommand{\textcolor}[2]{#2}
\begin{document}
I am black.\par
\textcolor{blue}{What color am I?}

\begin{tcolorbox}[coltext=red!75!black]
	Butterflies can fly high in the sky.
	\textcolor{blue}{This was a change}
\end{tcolorbox}
\end{document}
Pay attention, you may have bits of text that are not black and should not be black. Or parts where you have colors on purpose, and they should stay colored.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

How to return the color

Post by cgnieder »

Miad wrote:Hi,
I think my question is easy, but I couldn't find the answer in previous talks.
I wrote an article and used "\textcolor{blue}" in many parts of it, to clarify the changes between this version of my article and its previous one. However, now I want to finalize it with just black color. I mean I need a totally clean version in black, while my text includes many "\textcolor{blue}" parts.
Please help me.
Welcome to the LaTeX community.

A suggestion for future work: instead of using \textcolor{blue}{...} directly in your document defining a macro

Code: Select all

\usepackage{xcolor}
\newcommand\changes[1]{\textcolor{blue}{#1}}
and using that would allow you for the final version just to change the definition into

Code: Select all

\usepackage{xcolor}
\newcommand\changes[1]{\textcolor{.}{#1}}
Regards
site moderator & package author
Post Reply