How to use colors in TeXnic

  • Thread starter PhizKid
  • Start date
  • #1
475
1
I just got TeXnic yesterday and I'm trying to use colors, but usepackage{colors} doesn't work and I have xcolor or something installed from MiKTeX. I read that you put the usepackage in the "preamble" but I don't know where in the document that is.

So far I have:

Code:
 \documentclass[thmsa, a4paper,11pt, oneside]{book}
\usepackage{color}
\usepackage{amsmath, amsthm, amsfonts, amssymb}
\usepackage{array}
\usepackage[dutch]{babel}
%\usepackage{titlesec}  % to define "fancy" section head
%\usepackage{fancyhdr}  % to define page headings
%\usepackage{fancybox}  % to make title page
%\usepackage[dvipsnames]{color}  % colored title page
\usepackage{enumerate}

\setcounter{secnumdepth}{1}

%\renewcommand{\thesection}{\arabic{section}}


%\input{caligraphic}
%\input{greek}
%\input{fraktur}

\newcommand{\R}{\mathbb{R}} \newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\adjoint}[1]{{{}^\tau #1}}

\theoremstyle{plain}
\newtheorem{theorem}{Eigenschap}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Gevolg}

\theoremstyle{definition}
\newtheorem{exercise}{Oefening}[chapter]
\newtheorem{definition}[theorem]{Definitie}
\newtheorem{example}[theorem]{Voorbeeld}
\newtheorem{examples}[theorem]{Voorbeelden}
\newtheorem{remark}[theorem]{Opmerking}
\newtheorem{remarknohead}[theorem]{}


\renewcommand{\baselinestretch}{0.95}

\begin{document}

{\color{Red} test}

\end{document}

But no color showing yet.
 

Answers and Replies

  • #2
AlephZero
Science Advisor
Homework Helper
6,994
293
the predefined color names are in lower case, i.e. red not Red.
With the wrong version, I get the error message

LaTeX Error: Undefined color `Red'.

It would be worth trying to find out where TeXnic hid the error message, because other messages might disappear the same way. (I don't use TeXnic so I can't help you with that).

The "preamble" is everything between \documentclass{...} and \begin{document}.
 
  • #3
475
1
Still no go, but I think this is the error log:

Code:
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9) (preloaded format=pdflatex 2012.9.5)  6 SEP 2012 18:54
entering extended mode
**C:/Users/Fizz/Desktop/LaTeX3.tex
(C:/Users/Fizz/Desktop/LaTeX3.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, 
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
 lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\book.cls"
Document Class: book 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\bk11.clo"
File: bk11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\[email protected]=\count79
\[email protected]=\count80
\[email protected]=\count81
\[email protected]=\count82
\[email protected]=\count83
\[email protected]=\count84
\[email protected]=\count85
\[email protected]=\count86
\[email protected]=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\color.sty"
Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC)

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\color.cfg"
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package color Info: Driver file: pdftex.def on input line 130.

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\[email protected]=\count88
))
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsmath.sty"
Package: amsmath 2000/07/18 v2.13 AMS math features
\@mathmargin=\skip43

For additional information on amsmath, use the `?' option.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amstext.sty"
Package: amstext 2000/06/29 v2.01

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsgen.sty"
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks14
\[email protected]=\dimen103
))
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d
\[email protected]=\dimen104
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\math\amsopn.sty"
Package: amsopn 1999/12/14 v2.01 operator names
)
\[email protected]=\count89
LaTeX Info: Redefining \frac on input line 211.
\[email protected]=\count90
\[email protected]=\count91
LaTeX Info: Redefining \overline on input line 307.
\[email protected]=\count92
\[email protected]=\count93
LaTeX Info: Redefining \ldots on input line 379.
LaTeX Info: Redefining \dots on input line 382.
LaTeX Info: Redefining \cdots on input line 467.
\[email protected]=\box26
\[email protected]=\box27
\[email protected]=\dimen105
LaTeX Font Info:    Redeclaring font encoding OML on input line 567.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 568.
\[email protected]=\count94
\[email protected]=\count95
\[email protected]=\muskip10
\[email protected]=\count96
\[email protected]=\count97
\[email protected]=\toks15
\[email protected]=\count98
\[email protected]=\count99
\[email protected]=\count100
\[email protected]=\toks16
\[email protected]=\dimen106
\[email protected]=\dimen107
\[email protected]=\dimen108
\[email protected]=\dimen109
\[email protected]=\dimen110
\[email protected]=\dimen111
\@envbody=\toks17
\multlinegap=\skip44
\multlinetaggap=\skip45
\[email protected]=\toks18
LaTeX Info: Redefining \[ on input line 2666.
LaTeX Info: Redefining \] on input line 2667.
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ams\classes\amsthm.sty"
Package: amsthm 2004/08/06 v2.20
\[email protected]=\toks19
\[email protected]=\toks20
\[email protected]=\toks21
\[email protected]=\toks22
\[email protected]=\toks23
\[email protected]=\skip46
\[email protected]=\skip47
\[email protected]=\skip48
\[email protected]=\toks24
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty"
Package: amsfonts 2009/06/22 v3.00 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 96.
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty"
Package: amssymb 2009/06/22 v3.00
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\array.sty"
Package: array 2008/09/09 v2.4c Tabular extension package (FMi)
\[email protected]=\dimen112
\extrarowheight=\dimen113
\[email protected]=\toks25
\extratabsurround=\skip49
\[email protected]=\skip50
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\babel\babel.sty"
Package: babel 2008/07/08 v3.8m The Babel package

*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\bblopts.cfg"
File: bblopts.cfg 2006/07/31 v1.0 MiKTeX 'babel' configuration
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\babel\dutch.ldf"
Language: dutch 2005/03/30 v3.8i Dutch support from the babel system

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\babel\babel.def"
File: babel.def 2008/07/08 v3.8m Babel common definitions
\[email protected]=\count101
\[email protected]=\dimen114
)
Package babel Info: Making " an active character on input line 132.
))
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\enumerate.sty"
Package: enumerate 1999/03/05 v3.00 enumerate extensions (DPC)
\@enLab=\toks26
)
\[email protected]=\count102
\[email protected]=\count103


LaTeX Warning: Unused global option(s):
    [thmsa].

No file LaTeX3.aux.
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 42.
LaTeX Font Info:    ... okay on input line 42.
 
  • #4
AlephZero
Science Advisor
Homework Helper
6,994
293
Still no go, but I think this is the error log:

That's most of the log file, but you didn't post last few lines, which is where the error message might be! What you did post looks OK.

FWIW I just changed Red to red in the document you posted, created a PDF, and it worked fine.
 

Related Threads on How to use colors in TeXnic

Replies
4
Views
2K
  • Last Post
Replies
9
Views
2K
Replies
2
Views
688
Replies
4
Views
3K
Replies
1
Views
3K
Replies
2
Views
7K
Replies
2
Views
883
  • Last Post
Replies
10
Views
8K
Top