Text FormattingHow to change background color of text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bpetersen
Posts: 11
Joined: Mon Sep 13, 2010 9:55 pm

How to change background color of text

Post by bpetersen »

I am using MixTex 2.8, TeXnic Center and Windows XP.

I want to change the background color of like a paragraph worth of text.How do I do this.
I have already tried:

Code: Select all

\documentclass[12pt,a4paper]{article}

%----- Colors -----
\usepackage[dvips]{color}

\begin{document}

\fcolorbox{red}{yellow}{
A "hidden" language spoken by only about 1,000 people has \\
been discovered in the remote northeast corner of India by \\
researchers who at first thought they were documenting a dialect\\
 of the Aka culture, a tribal community in the foothills of the\\
 Himalayas.}
\fcolorbox{red}{yellow}{text}

\colorbox{yellow}{
A "hidden" language spoken by only about 1,000 people has \\
been discovered in the remote northeast corner of India by \\
researchers who at first thought they were documenting a dialect\\
 of the Aka culture, a tribal community in the foothills of the\\
 Himalayas.}

\end{document}


Both \fcolorbox{framecolor}{backgroundcolor}{text} and \colorbox{backgroundcolor}{text} do not work; The text continues off the screen.

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to change background color of text

Post by localghost »

Use the framed package.


Thorsten
Post Reply