On Wed, 2014-07-23 at 13:17 -0400, PhilipPirrip wrote:
> Tell us how to reproduce the problem. Start with the document class 
> you're using. Show us the preamble of the document with and without the 
> pdf figure (Export->podflatex could help). Try to make a minimal 
> (non)working example.
> 
That was great advice; I think I figured out the problem while I was
experimenting.  I am still left wondering:
Is \usepackage{graphicx} without a driver option OK?
Where is that directive coming from (I think LyX)?
Is there a way to modify that directive?

Background:

The original problem was that there were 2 conflicting
\usepackage{graphicx}; the first, near the top of the generated .tex
file, had no options.  But the preamble available through document
settings included
\usepackage[dvips]{graphicx}.
Changing that to
\usepackage[]{graphicx}
and removing dvips from the document options produced a a clean build of
the  pdf file.

Is using graphicx without options OK?  The LaTeX Companion 2nd edition
p. 614 seems to imply a driver must be specified.

I tried (still in the preamble)
\usepackage[pdftex]{graphicx}
but this produced
 \usepackage
                 {color}
The package graphicx has already been loaded with options:
  []
There has now been an attempt to load it with options
  [pdftex]
Adding the global options:
  ,pdftex
to your \documentclass declaration may fix this.

Adding pdftex as a custom class option in the LyX document settings
doesn't help.

The tex that is output has  \usepackge{graphicx} about 5 lines below the
top.  This seems to be created before the document preamble from the
settings dialogue.  So attempting to use graphicx with any options in
the preamble gives an error.

I'm not sure where the first \usepackage{graphicx} is coming from; I
have a feeling LyX is adding it when the document has an included
graphic (since it does not appear before I insert the graphic and I
don't see a reference to it in nih.cls or article.cls).  Is there any
way to modify its options? 

Here's the output .tex file for pdflatex when I got the error with the
pdftex option:

%% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,english]{nih}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{color}
\usepackage{babel}
\usepackage{graphicx}
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=true]
 {hyperref}
\hypersetup{
 pdfauthor={Rob Oakes},
 linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%% [Ross] Below here is from the LaTeX preamble available through Lyx Document 
| Settings
\usepackage{natbib}

% Hyperlink Options
\usepackage{ifpdf} % part of the hyperref bundle
\ifpdf % if pdflatex is used

 % Use True Type Fonts Instead of Older LaTeX Fonts
 \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}

\fi % end if pdflatex is used

% for correct jump positions whe clicking on a link to a float
\usepackage[figure]{hypcap}

%%% [Ross] lots of stuff deleted.  Here's the second reference to graphicx.

\usepackage[pdftex]{graphicx}

Thanks.
Ross Boylan


Reply via email to