Hello there,

I have a problem with LyX 1.2.0 on Mac OSX 10.1.5 (installed through
fink).

I created a lyx document which I want to export as pdf (using pdflatex)
and as html (using latex2html). To be able to setup hyperlinks properly
and set pdf parameters only for the pdf export, I included an \ifpdf
statement in the preamble.

Unfortunately, this does not seem to work, because the \ifpdf branch is
also processed when I do a latex2html-export...

Do you have any idea what I am doing wrong? Here is the relevant part of
the latex preamble I use:

\newif\ifpdf
\ifx\pdfoutput\undefined
\else
  \ifx\pdfoutput\relax
  \else
    \ifcase\pdfoutput
    \else
      \pdftrue
    \fi
  \fi
\fi

\ifpdf
   
\usepackage[pdftex,linktocpage,colorlinks=true,linkcolor=red,urlcolor=blue]{hyperref}
   \hyperbaseurl{file:///H:/work/doc/ILAB/Scripting/}
   % make index appear in TOC
   \renewcommand*\idx@heading{%
     \chapter{\indexname}\@mkboth{\indexname}{\indexname}
     }
\else
   %%% for some reason, this does not seem to work...
   \usepackage{html}
   \usepackage{url}
   \latex{\renewcommand{\htmladdnormallink}[2]{#1 (\url{#2})}}
\fi

The \ifpdf definition I used here is taken from ifpdf.sty (which I haven't
installed). The \ifpdf definition which is mentioned on
http://www.lyx.org/help/pdf/pdf.php3 does not work either. I suspect that
this has to be connected with how latex is called when exporting, but I
don't really know anything about this.

Thanks for any help
        Bernd
-- 
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying to
produce bigger and better idiots. So far, the Universe is winning."
                                                      -- Rich Cook


Reply via email to