diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 30c696e53d..5b9d2a936b 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2005-07-04 Georg Baum + + * insetgraphics.C (latex): Put the extension outside the quotes + 2005-06-24 Georg Baum * insetgraphics.C (prepareFile): replace spaces in filenames with _ diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 6c15052336..44c72f082e 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -779,7 +779,7 @@ int InsetGraphics::latex(Buffer const *buf, ostream & os, buf->filePath()), m_buffer->filePath()); } - latex_str += latex_path(fname); + latex_str += latex_path(fname, true); } latex_str += '}' + after; diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 53a17f31be..e363f8c00b 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,7 @@ +2005-07-04 Georg Baum + + * filetools.[Ch] (latex_path): add exclude_extension argument + 2005-06-21 Georg Baum * filetools.C (latex_path): protect " with \string since it may be diff --git a/src/support/filetools.C b/src/support/filetools.C index 74e6af36f6..132a72eca7 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -91,13 +91,20 @@ bool IsSGMLFilename(string const & filename) } -string const latex_path(string const & original_path) +string const latex_path(string const & original_path, bool exclude_extension) { string path = subst(original_path, "~", "\\string~"); if (path.find(' ') != string::npos) // We can't use '"' because " is sometimes active (e.g. if // babel is loaded with the "german" option) - path = "\\string\"" + path + "\\string\""; + if (exclude_extension) { + string const base = ChangeExtension(path, string()); + string const ext = GetExtension(path); + path = ChangeExtension( + "\\string\"" + base + "\\string\"", ext); + } else + + path = "\\string\"" + path + "\\string\""; return path; } diff --git a/src/support/filetools.h b/src/support/filetools.h index 344199ee15..e62c460c47 100644 --- a/src/support/filetools.h +++ b/src/support/filetools.h @@ -146,8 +146,13 @@ bool PutEnvPath(string const & envstr); * If @c path contains spaces, then the returned path is enclosed in * "-quotes. This last fix will lead to successful compiliation of the * LaTeX file only if a sufficiently modern LaTeX compiler is used. + * If @c exclude_extension is true the extension is left outside the quotes. + * This is needed for pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) + * (format=pdflatex 2005.4.11) in combination with + * pdftex.def 2002/06/19 v0.03k graphics/color for pdftex: + * It does not recognize the file extension if it is inside the quotes. */ -string const latex_path(string const & path); +string const latex_path(string const & path, bool exclude_extension = false); /// Substitutes active latex characters with underscores in filename string const MakeLatexName(string const & file);