TransWikia.com

A problem with colors in WinEdt

TeX - LaTeX Asked on June 7, 2021

I have a problem with colors in WinEdt.
When I compile the MWE below in WinEdt, the text

this becomes a link

is correctly green.

But when I save it as a pdf file, then the color becomes incorrectly
black, though the clickability correctly persists.

%&latex
%documentclass[12pt,a4paper]{book}

documentclass[14pt]{book}
topmargin 2mm
oddsidemargin 10mm
evensidemargin 10mm
textwidth 150mm
textheight 220mm

usepackage[latin2]{inputenc}
usepackage[czech]{babel}
%usepackage{czech}
usepackage{latexsym}
usepackage{a4}
usepackage{makeidx}
usepackage{theorem}

usepackage[pdftex,breaklinks,colorlinks,citecolor=blue,urlcolor=blue,pdftitle={Lecture 9},pdfauthor={Ryan Higginbottom},linkcolor=green,pdfsubject={LaTeX}]{hyperref}

%makeindex


renewcommand{theenumi}{roman{enumi}}


begin{document}
Linkshyperlink{foo_1}{This becomes a link}.
hypertarget{foo_2}{This is the target}.
newpage



hypertarget{foo_1}{This is the target}.
Linkshyperlink{foo_2}{This becomes a link}.



end{document}

One Answer

the first line

 %&latex

forces the pdflatex to act like latex, in dvi mode, not like pdflatex, as such if you run pdflatex on the file then you get the error

! Package hyperref Error: Wrong driver option `pdftex',
(hyperref)                because pdfTeX in PDF mode is not detected.

and no usable output.

If you delete that line it runs without error and produces

enter image description here

As you see here it is best to avoid driver options like [pdftex as hyperref will choose a suitable driver if you do not force it to use the wrong one,

Answered by David Carlisle on June 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP