From ba2c7c67391df148e1ee0cc8f894f61a0e5af87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Matox?= Date: Mon, 6 Mar 2006 18:48:59 +0000 Subject: [PATCH] Only reset the papersize for a4* paperpackages git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@13305 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/ChangeLog | 5 +++++ lib/lyx2lyx/lyx_1_4.py | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index 8c2169187f..77bb7ee3e4 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,8 @@ +2006-03-06 José Matos + + * lyx_1_4.py (remove_paperpackage): Only reset the papersize for + a4* paperpackages. + 2006-02-22 Georg Baum * lyx_1_4.py (convert_amsmath, revert_amsmath): new, convert ams math diff --git a/lib/lyx2lyx/lyx_1_4.py b/lib/lyx2lyx/lyx_1_4.py index 1cfd585a58..ea6dddee26 100644 --- a/lib/lyx2lyx/lyx_1_4.py +++ b/lib/lyx2lyx/lyx_1_4.py @@ -2342,14 +2342,16 @@ def remove_paperpackage(file): paperpackage = split(file.header[i])[1] - if paperpackage in ("a4", "a4wide", "widemarginsa4"): - conv = {"a4":"\\usepackage{a4}","a4wide": "\\usepackage{a4wide}", - "widemarginsa4": "\\usepackage[widemargins]{a4}"} - # for compatibility we ensure it is the first entry in preamble - file.preamble[0:0] = [conv[paperpackage]] - del file.header[i] + if paperpackage not in ("a4", "a4wide", "widemarginsa4"): + return + + conv = {"a4":"\\usepackage{a4}","a4wide": "\\usepackage{a4wide}", + "widemarginsa4": "\\usepackage[widemargins]{a4}"} + # for compatibility we ensure it is the first entry in preamble + file.preamble[0:0] = [conv[paperpackage]] + i = find_token(file.header, '\\papersize', 0) if i != -1: file.header[i] = "\\papersize default"