From 9c59de3c6795e124e26e9603bddd355f172eec51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sat, 22 Sep 2007 12:53:22 +0000 Subject: [PATCH] PDFOptions.cpp: clean up the appearance of the parameters in the LaTeX-output BufferParams.cpp: move the hyperref call to the right position git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20431 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferParams.cpp | 20 ++++++++++---------- src/PDFOptions.cpp | 25 ++++++++++++------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 50828faad7..b2c4d5daa7 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1115,11 +1115,20 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, texrow.newline(); } - // Now insert the LyX specific LaTeX commands... + // Now insert the LyX specific LaTeX commands... // The optional packages; docstring lyxpreamble(from_ascii(features.getPackages())); + // PDF support. Hyperref manual: "Make sure it comes last of your loaded + // packages, to give it a fighting chance of not being over-written, + // since its job is to redefine many LATEX commands." + // Has to be put into lyxpreamble (preserving line-counting for error + // parsing). + odocstringstream oss; + pdfoptions().writeLaTeX(oss); + lyxpreamble += oss.str(); + // this might be useful... lyxpreamble += "\n\\makeatletter\n"; @@ -1183,15 +1192,6 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, if (!bullets_def.empty()) lyxpreamble += bullets_def + "}\n\n"; - // PDF support. Hypreref manual: "Make sure it comes last of your loaded - // packages, to give it a fighting chance of not being over-written, - // since its job is to redefine many LATEX commands." - // Has to be put into lyxpreamble (preserving line-counting for error - // parsing). - odocstringstream oss; - pdfoptions().writeLaTeX(oss); - lyxpreamble += oss.str(); - // We try to load babel late, in case it interferes // with other packages. // Jurabib has to be called after babel, though. diff --git a/src/PDFOptions.cpp b/src/PDFOptions.cpp index 69be850248..1fdaab61f0 100644 --- a/src/PDFOptions.cpp +++ b/src/PDFOptions.cpp @@ -85,14 +85,13 @@ void PDFOptions::writeLaTeX(odocstringstream &os) const opt = "\\usepackage["; if (!title.empty()) - opt += "pdftitle={" + title + "},\n"; + opt += "pdftitle={" + title + "},\n "; if (!author.empty()) - opt += "pdfauthor={" + author + "},\n"; + opt += "pdfauthor={" + author + "},\n "; if (!subject.empty()) - opt += "pdfsubject={" + subject + "},\n"; + opt += "pdfsubject={" + subject + "},\n "; if (!keywords.empty()) - opt += "pdfkeywords={" + keywords + "},\n"; - + opt += "pdfkeywords={" + keywords + "},\n "; opt += "bookmarks=" + convert(bookmarks) + ','; if (bookmarks) { opt += "bookmarksnumbered=" + convert(bookmarksnumbered) + ','; @@ -101,23 +100,23 @@ void PDFOptions::writeLaTeX(odocstringstream &os) const if (bookmarksopen && !bookmarksopenlevel.empty()) opt += "bookmarksopenlevel=" + bookmarksopenlevel + ','; } - + opt += "\n "; opt += "breaklinks=" + convert(breaklinks) + ','; - + opt += "pdfborder={0 0 " ; opt += (pdfborder ?'0':'1'); - opt += "},\n"; - - opt += "colorlinks=" + convert(colorlinks) + ','; + opt += "},"; + opt += "backref=" + convert(backref) + ','; opt += "pagebackref=" + convert(pagebackref) + ','; - + opt += "\n "; + opt += "colorlinks=" + convert(colorlinks) + ','; if (!pagemode.empty()) opt += "pdfpagemode=" + pagemode + ','; + opt += "\n "; opt += quoted_options_get(); - opt = support::rtrim(opt,","); - opt += "]{hyperref}\n"; + opt += "]\n {hyperref}\n"; // FIXME UNICODE os << from_utf8(opt); -- 2.39.5