Talk:LaTeX/Colors
From Wikibooks, the open-content textbooks collection
Can somebody elaborate on this ? "The difference between \textcolor and \color is the same difference between \texttt and \ttfamily, you can use the one you prefer."
I couldn't find the difference between \texttt and \ttfamily on the Formatting page either.
[edit] Background (bg) color of text; headings
A nice article! Just a few requests:
- Could somebody elaborate more on bg color for the text?
- How to change the bg color of headings (\section, \subsection)?
- is it possible to color only one line in LaTeX? E.g. the very first line on each page is colored in some color and not the successive lines?
Thank you, Kazkaskazkasako (talk) 11:10, 25 April 2009 (UTC)
Found a partial answer which involves \newenvironment:
\definecolor{MyGray}{rgb}{0.96,0.97,0.98}
\makeatletter\newenvironment{graybox}{%
\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth}}{\end{minipage}\end{lrbox}%
\colorbox{MyGray}{\usebox{\@tempboxa}}
}\makeatother
from [1]