From 8478e5dcfe080cc41c0e62beb06415ee77a2b26d Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 9 Aug 2002 11:16:54 +0000 Subject: [PATCH] LaTeX can now find \input insets where the file has a relative path. (Thanks to John for unwittingly informing me of the existance of input@path.) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4920 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 6 ++++++ src/graphics/PreviewLoader.C | 2 +- src/insets/ChangeLog | 5 +++++ src/insets/insetinclude.C | 17 +---------------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 58ee7bf158..e3b6918ab1 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,9 @@ +2002-08-09 Angus Leeming + + * PreviewLoader.C (dumpPreamble): pass Buffer::filePath() to + Buffer::makeLaTeXFile() so that LaTeX can find \input files because + input@path is now set correctly. + 2002-08-06 Angus Leeming * PreviewLoader.C: add support for preview.sty 0.73 (currently diff --git a/src/graphics/PreviewLoader.C b/src/graphics/PreviewLoader.C index f89fddd03c..091d9ac9b5 100644 --- a/src/graphics/PreviewLoader.C +++ b/src/graphics/PreviewLoader.C @@ -577,7 +577,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const // Why on earth is Buffer::makeLaTeXFile a non-const method? Buffer & tmp = const_cast(buffer_); // Dump the preamble only. - tmp.makeLaTeXFile(os, string(), true, false, true); + tmp.makeLaTeXFile(os, buffer_.filePath(), true, false, true); // Loop over the insets in the buffer and dump all the math-macros. Buffer::inset_iterator it = buffer_.inset_const_iterator_begin(); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 79db103398..f46e262ea5 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2002-08-09 Angus Leeming + + * insetinclude.C (latexString): remove fudge now that I've found out + how to enable LaTeX to find the file using input@path. + 2002-08-09 John Levon * insettext.h: diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 74dbb0f691..018da0fb38 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -565,22 +565,7 @@ string const InsetInclude::PreviewImpl::latexString() const ostringstream os; parent().latex(view()->buffer(), os, false, false); - // This fails if the file has a relative path. - // return os.str().c_str(); - - // I would /really/ like not to do this, but don't know how to tell - // LaTeX where to find a \input-ed file... - // HELP! - string command; - string file = rtrim(split(os.str().c_str(), command, '{'), "}"); - - if (!AbsolutePath(file)) - file = MakeAbsPath(file, view()->buffer()->filePath()); - - ostringstream out; - out << command << '{' << file << '}' << endl; - - return out.str().c_str(); + return os.str().c_str(); } -- 2.39.2