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
This commit is contained in:
Angus Leeming 2002-08-09 11:16:54 +00:00
parent 01080c9eda
commit 8478e5dcfe
4 changed files with 13 additions and 17 deletions

View File

@ -1,3 +1,9 @@
2002-08-09 Angus Leeming <leeming@lyx.org>
* 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 <leeming@lyx.org> 2002-08-06 Angus Leeming <leeming@lyx.org>
* PreviewLoader.C: add support for preview.sty 0.73 (currently * PreviewLoader.C: add support for preview.sty 0.73 (currently

View File

@ -577,7 +577,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
// Why on earth is Buffer::makeLaTeXFile a non-const method? // Why on earth is Buffer::makeLaTeXFile a non-const method?
Buffer & tmp = const_cast<Buffer &>(buffer_); Buffer & tmp = const_cast<Buffer &>(buffer_);
// Dump the preamble only. // 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. // Loop over the insets in the buffer and dump all the math-macros.
Buffer::inset_iterator it = buffer_.inset_const_iterator_begin(); Buffer::inset_iterator it = buffer_.inset_const_iterator_begin();

View File

@ -1,3 +1,8 @@
2002-08-09 Angus Leeming <leeming@lyx.org>
* 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 <levon@movementarian.org> 2002-08-09 John Levon <levon@movementarian.org>
* insettext.h: * insettext.h:

View File

@ -565,22 +565,7 @@ string const InsetInclude::PreviewImpl::latexString() const
ostringstream os; ostringstream os;
parent().latex(view()->buffer(), os, false, false); parent().latex(view()->buffer(), os, false, false);
// This fails if the file has a relative path. return os.str().c_str();
// 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();
} }