The attached patch adds support for the German babel hyphenation command:
"=

regards Uwe
Index: preamble.cpp
===================================================================
--- preamble.cpp	(revision 22027)
+++ preamble.cpp	(working copy)
@@ -48,6 +48,9 @@
 // special columntypes
 extern std::map<char, int> special_columns;
 
+// store the document language to be used in other tex2lyx files
+extern std::string document_language;
+
 std::map<string, vector<string> > used_packages;
 
 namespace {
@@ -367,6 +370,9 @@
 	   << "\\begin_body\n";
 	// clear preamble for subdocuments
 	h_preamble.str("");
+
+	// store the document language to be used in text.cpp
+	document_language = h_language;
 }
 
 } // anonymous namespace
Index: text.cpp
===================================================================
--- text.cpp	(revision 22021)
+++ text.cpp	(working copy)
@@ -52,7 +52,14 @@
 using support::contains;
 using support::subst;
 
+// filled in preamble.cpp
+std::string document_language;
+ 
+// to store the current selectlanguage to be used after \foreignlanguage
+// or \end{otherlanguage}
+string selectlang;
 
+
 void parse_text_in_inset(Parser & p, ostream & os, unsigned flags, bool outer,
 		Context const & context)
 {
@@ -1126,8 +1133,6 @@
 		Context & context)
 {
 	LayoutPtr newlayout;
-	// store the current selectlanguage to be used after \foreignlanguage
-	string selectlang;
 	// Store the latest bibliographystyle (needed for bibtex inset)
 	string bibliographystyle;
 	bool const use_natbib = used_packages.find("natbib") != used_packages.end();
@@ -1214,6 +1219,15 @@
 			parse_noweb(p, os, context);
 		}
 
+		else if (t.asInput() == "\"" && p.next_token().asInput() == "=") {
+			context.check_layout(os);
+			if (document_language == "german" || document_language == "ngerman")
+				os << "-";
+			else
+				os << "\"=";
+			p.get_token();
+		}
+
 		else if (t.cat() == catSpace || (t.cat() == catNewline && ! p.isParagraph()))
 			check_space(p, os, context);
 

Reply via email to