From 2546bde017c32634b9b7ff906a631b49b2446ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Thu, 15 May 2008 21:05:25 +0000 Subject: [PATCH] tex2lyx/preamble.cpp: support for the document class options twocolumn and twoside, fixes bug 4867 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24789 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/preamble.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tex2lyx/preamble.cpp b/src/tex2lyx/preamble.cpp index 81c55e6e2d..7ba05f6180 100644 --- a/src/tex2lyx/preamble.cpp +++ b/src/tex2lyx/preamble.cpp @@ -548,6 +548,7 @@ void parse_preamble(Parser & p, ostream & os, } else if (t.cs() == "documentclass") { + vector::iterator it; vector opts = split_options(p.getArg('[', ']')); handle_opt(opts, known_fontsizes, h_paperfontsize); delete_opt(opts, known_fontsizes); @@ -570,6 +571,16 @@ void parse_preamble(Parser & p, ostream & os, else if (is_known(h_language, known_ukrainian_languages)) h_language = "ukrainian"; h_quotes_language = h_language; + // paper sides + if ((it = find(opts.begin(), opts.end(), "twoside")) != opts.end()) { + h_papersides = "2"; + opts.erase(it); + } + // paper columns + if ((it = find(opts.begin(), opts.end(), "twocolumn")) != opts.end()) { + h_papercolumns = "2"; + opts.erase(it); + } h_options = join(opts, ","); h_textclass = p.getArg('{', '}'); }