From c1a97abe374d2b5bf8df2d2844f75de39bee9069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Tue, 31 Aug 2010 23:31:32 +0000 Subject: [PATCH] lyx_2_0.py: - add missing conversion routine for latest fileformat change - fix reversion of latest fileformat change git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35249 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_2_0.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index e9a3b8ecbf..ff60e75bb4 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -2057,13 +2057,23 @@ def revert_mathrsfs(document): i += 1 +def convert_mathdots(document): + " Load mathdots if used in the document " + while True: + i = find_token(document.header, "\\use_esint" , 0) + if i != -1: + document.header.insert(i + 1, "\\use_mathdots 1") + break + + def revert_mathdots(document): " Load mathdots if used in the document " while True: i = find_token(document.header, "\\use_mathdots" , 0) if i != -1: + # use \@ifundefined to catch also the "auto" case add_to_preamble(document, ["% this command was inserted by lyx2lyx"]) - add_to_preamble(document, ["\\usepackage{mathdots}"]) + add_to_preamble(document, ["\\@ifundefined{iddots}{\\usepackage{mathdots}}"]) del document.header[i] break @@ -2126,7 +2136,7 @@ convert = [[346, []], [396, []], [397, [remove_Nameref]], [398, []], - [399, []] + [399, [convert_mathdots]] ] revert = [[398, [revert_mathdots]],