1

I am trying to increase my access to a larger palette of predefined colors. One way to do that is outlined in the LaTeX Wikibook (Section 8, p. 87 ff. of the pdf version, corresponding online version), by calling the xcolor package with options, thus: ...

\usepackage{graphicx}

\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
...

This didn't work. Checking the Xcolor manual (section 2.1.2, p.7) says that "usenames" is an obsolete option.

So I tried these variations without "usenames", and none of them work: ...

\usepackage[dvipsnames,svgnames,table]{xcolor}
\usepackage[dvipsnames,table]{xcolor}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage[dvipsnames]{xcolor}
...

I am also getting an error message after compiling, "cannot find dvips.sty".....this despite the fact that I've used the the Texlive complete distribution just two weeks ago.

Any ideas about what is going amok here?

5
  • Please show a full minimal but failing example. That makes it easier for others to copy your code and test it.
    – daleif
    Jan 2, 2023 at 6:17
  • You might also want to list exactly which latex installation you are using as you example lines works just fine for me using both pdflatex and latex on texlive 2022.
    – daleif
    Jan 2, 2023 at 7:50
  • And say what you mean by "it didn't work" Jan 2, 2023 at 7:50
  • 1
    the error means you have \usepackage{dvips} which you should remove, but you have not shown any code that produces this Jan 2, 2023 at 9:02
  • I have 11 versions of TeX Live on the machine I'm working on, from 2012 to 2022 and in none of them I can find dvips.sty and I believe there has never been such a file in the TeX distributions.
    – egreg
    Jan 2, 2023 at 14:42

2 Answers 2

0

I can't reproduce your issue; by the way, no file dvips.sty has ever existed in the TeX universe, as far as I know.

The hyperref package should be loaded last, with a few exceptions that aren't among the packages you load.

I suggest to reorganize your preamble in order to have separate sections for packages and for setup.

I added setting headheight in geometry because so fancyhdr keeps asking otherwise.

Instead of \renewcommand{\rmdefault}{iwona} it's better to load the iwona package (that also offers support for math).

\documentclass[11pt,twoside]{article}
\usepackage[
  inner=4cm,
  bottom=2in,
  outer=3cm,
  left=2in,
  headheight=14.5pt, % <--- fancyhdr tells you this
]{geometry}

% general use
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{graphicx}

% text elements
\usepackage{multicol}
\usepackage{pdfpages}
\usepackage{awesomebox}
%\usepackage{fontawesome5} % loaded by awesomebox

% general setup
\usepackage{fancyhdr}
\usepackage{caption}
\usepackage{minitoc}

% fonts
\usepackage[
  math, % comment if you really want math in a different font
]{iwona}

% symbols
\usepackage{marvosym}
\usepackage{wasysym}

% temporary usage during document preparation
% don't forget to comment them out for the
% final version
\usepackage{todo}
%\usepackage{mwe}
%\usepackage{blindtext}
%\usepackage{lipsum}

% hyperref should come last
\usepackage{hyperref}

% setup
\pagestyle{fancy}
% don't forget to do something about the page style

\begin{document}

This is printed in Iwona, also for math
\[
\sum_{k=0}^n x^k=\frac{x^n-1}{x-1}
\]

\end{document}

enter image description here

Without the math option you get

enter image description here

However, see https://tex.stackexchange.com/a/114834/4427 and https://tex.stackexchange.com/a/117449/4427 for using IwonaMath.

1

To everyone--thanks for your patience as I learn how to ask better questions in this forum! I have since discovered the package {mwe}, which will make it much easier to post some illustrative code in future questions. Meanwhile, In the present situation:

I used {mwe} to test my color-problem code (i.e., wherein the "dvips.sty" error was generated).

I discovered that I could get access to the extra named colors {xcolor} using dvipsnames, if I employed the absolutely minimal preamble.

I then added the other packages that I had originally employed, in random order, one at a time, until I discovered that the call for a dvips color name caused an error.

Result: It seems that the {hyperref} package was causing failures of xcolor/dvipsnames. I shuffled the packages {hyperref}, {graphicx} and {xcolor}, and eventually found an ordering that worked; here it is:

\documentclass[11pt,twoside]{article}
\renewcommand*\rmdefault{iwona}
\usepackage{hyperref}
\usepackage{marvosym}
\usepackage{multicol}
\usepackage{wasysym}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{pdfpages}
\usepackage{mwe}
\usepackage{todo}
\usepackage{awesomebox}
\usepackage{fontawesome5}
\usepackage{fancyhdr}
\usepackage{graphicx}
\pagestyle{fancy}
\usepackage{blindtext}
\usepackage{lipsum}
\usepackage[inner=4cm, bottom=2in, outer=3cm,left=2in]{geometry}
\usepackage{caption}
\usepackage{minitoc}



1
  • 2
    Quite wrong, sorry: hyperref must be last in this case. Don't load mwe for real world documents.
    – egreg
    Jan 3, 2023 at 21:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .