Add \makeat switches to babel settings if necessary.

Babel settings might contain @ characters. Check for this and wrap the settings into \makeatletter ... \makeatother switches if necessary (see discussion at #8265).
This commit is contained in:
Juergen Spitzmueller 2012-07-18 12:41:53 +02:00
parent 467422f9df
commit 4d5bef1bdc

View File

@ -1026,7 +1026,10 @@ string const LaTeXFeatures::getBabelPresettings() const
if (!params_.language->babel_presettings().empty())
tmp << params_.language->babel_presettings() << '\n';
return tmp.str();
if (!contains(tmp.str(), '@'))
return tmp.str();
return "\\makeatletter\n" + tmp.str() + "\\makeatother\n";
}
@ -1042,7 +1045,10 @@ string const LaTeXFeatures::getBabelPostsettings() const
if (!params_.language->babel_postsettings().empty())
tmp << params_.language->babel_postsettings() << '\n';
return tmp.str();
if (!contains(tmp.str(), '@'))
return tmp.str();
return "\\makeatletter\n" + tmp.str() + "\\makeatother\n";
}