Uwe Stöhr <[EMAIL PROTECTED]> writes:

>> What about the attached (untested) patch instead to remove spaces at
>> the source?
>
> This doesn't work.

You are right. Try this one instead. I would really prefer this to
what you have now (I find it cleaner).

Note that language is not taken in account as a parameter to
\usepackage{babel}; we have actually to look in what order languages
are parsed by LaTeX before implementing that correctly.

JMarc

svndiff src/tex2lyx/preamble.cpp

Index: src/tex2lyx/preamble.cpp
===================================================================
--- src/tex2lyx/preamble.cpp	(revision 21949)
+++ src/tex2lyx/preamble.cpp	(working copy)
@@ -128,7 +128,7 @@ vector<string> split_options(string cons
 	while (p.good()) {
 		Token const & t = p.get_token();
 		if (t.asInput() == ",") {
-			options.push_back(option);
+			options.push_back(trim(option));
 			option.erase();
 		} else if (t.asInput() == "=") {
 			option += '=';
@@ -140,7 +140,7 @@ vector<string> split_options(string cons
 	}
 
 	if (!option.empty())
-		options.push_back(option);
+		options.push_back(trim(option));
 
 	return options;
 }
@@ -373,8 +373,7 @@ TextClass const parse_preamble(Parser & 
 		}
 
 		else if (t.cs() == "documentclass") {
-			vector<string> opts;
-			split(p.getArg('[', ']'), opts, ',');
+			vector<string> opts = split_options(p.getArg('[', ']'));
 			handle_opt(opts, known_languages, h_language);
 			if (is_known(h_language, known_french_languages))
 				h_language = "french";

Reply via email to