The attached patch fixes http://bugzilla.lyx.org/show_bug.cgi?id=4867 also for 
branch.

Jürgen, OK?

regards Uwe
Index: preamble.cpp
===================================================================
--- preamble.cpp	(revision 24743)
+++ preamble.cpp	(working copy)
@@ -561,6 +561,7 @@
 		}
 
 		else if (t.cs() == "documentclass") {
+			vector<string>::iterator it;
 			vector<string> opts = split_options(p.getArg('[', ']'));
 			handle_opt(opts, known_fontsizes, h_paperfontsize);
 			delete_opt(opts, known_fontsizes);
@@ -583,6 +584,16 @@
 			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('{', '}');
 		}

Reply via email to