From b3e09e7bd39447cd178c93a63183ca713afe43ae Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Tue, 1 Jul 2008 12:50:54 +0000 Subject: [PATCH] Fix bug 2721 http://bugzilla.lyx.org/show_bug.cgi?id=2721 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@25410 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferParams.cpp | 2 ++ src/LaTeXFeatures.cpp | 13 +++++++++++++ status.15x | 3 +++ 3 files changed, 18 insertions(+) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 9432a81240..3cf24fce7b 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1026,6 +1026,8 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, os << ",footskip=" << from_ascii(Length(footskip).asLatexString()); os << "}\n"; texrow.newline(); + } else if (orientation == ORIENTATION_LANDSCAPE) { + features.require("papersize"); } if (tokenPos(tclass.opt_pagestyle(), diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 7fe85818b1..d407570402 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -197,6 +197,13 @@ static string const textcyr_def = "\\DeclareRobustCommand{\\textcyr}[1]{\\leavevmode{\\cyrtext #1}}\n" "\\AtBeginDocument{\\DeclareFontEncoding{T2A}{}{}}\n"; +static string const papersizedvi_def = + "\\special{papersize=\\the\\paperwidth,\\the\\paperheight}\n"; + +static string const papersizepdf_def = + "\\pdfpageheight\\paperheight\n" + "\\pdfpagewidth\\paperwidth\n"; + ///////////////////////////////////////////////////////////////////// // @@ -633,6 +640,12 @@ string const LaTeXFeatures::getMacros() const macros << *pit << '\n'; } + if (mustProvide("papersize")) + if (runparams_.flavor == OutputParams::LATEX) + macros << papersizedvi_def << '\n'; + else + macros << papersizepdf_def << '\n'; + if (mustProvide("LyX")) macros << lyx_def << '\n'; diff --git a/status.15x b/status.15x index 104a282098..ea3c3a57ad 100644 --- a/status.15x +++ b/status.15x @@ -79,6 +79,9 @@ What's new - Fix LaTeX export of combining characters in utf-8* encodings (bug 4946). +- Output paper size info to produced dvi or pdf documents when using landscape + orientation, such that viewers can properly display them (bug 2721). + * USER INTERFACE