# FontEncoding <font encoding|font encoding|...>
# InternalEncoding <true|false>
# RTL <true|false>
-# AsBabelOptions <true|false>
# LangCode <language_code>
# LangVariety <language_variety>
# PreBabelPreamble
# If True, LyX takes care for characters/macros that do not exist in
# some font encodings ("<", ">", "|" and straight quote).
# It is not required for standard encodings like T2A. See bug #5091.
-# * AsBabelOptions advices LyX to pass the languages locally to babel, not
-# globally to the class. In the old days, some languages (basically those
-# not natively supported by babel) needed this.
-# FIXME: in this case, we might still need to pass the other languages
-# globally, for the use of other packages (such as varioref).
# * LangCode is also used for spellchecking and thesaurus, where the
# dictionaries are named accordingly. Thus, check this when introducing/
# changing language codes (especially aspell, thesaurus).
QuoteStyle english
InternalEncoding true
# babel-hebrew expects the encoding for *other* languages last:
- # FontEncoding HE8
- # Define the font encoding the babel-hebrew way and
+ # FontEncoding HE8|LHE
+ ## Use font encoding HE8 if the Culmus fonts are installed and
# work around too simple test for article-like classes in rlbabel.def.
PreBabelPreamble
+ %\IfFileExists{he8david.fd}{%
+ % \providecommand{\HeblatexEncoding}{HE8}
+ % \providecommand{\HeblatexEncodingFile}{he8enc}%
+ %}{}
\providecommand{\l@chapter}{\relax}
EndPreBabelPreamble
DateFormats "d MMMM yyyy|d MMM yyyy|dd/MM/yyyy"
language_options << ',';
language_options << language->babel();
}
- if (global && !features.needBabelLangOptions()
- && !language_options.str().empty())
+ if (global && !language_options.str().empty())
clsoptions << language_options.str() << ',';
}
if (features.mustProvide("pmboxdraw"))
os << "\\usepackage{pmboxdraw}\n";
- // FIXME: With Thai as document or secondary language, we must load babel
- // before inputenc (see lib/languages).
+ // FIXME: In any document containing text in Thai language,
+ // we must load babel before inputenc (see lib/languages).
// handle inputenc etc.
writeEncodingPreamble(os, features);
os << features.getBabelPresettings();
// FIXME UNICODE
os << from_utf8(babelCall(language_options.str(),
- features.needBabelLangOptions())) + '\n';
+ !lyxrc.language_global_options)) + '\n';
os << features.getBabelPostsettings();
}
os << features.getBabelPresettings();
// FIXME UNICODE
os << from_utf8(babelCall(language_options.str(),
- features.needBabelLangOptions())) + '\n';
+ !lyxrc.language_global_options)) + '\n';
os << features.getBabelPostsettings();
}
if (features.isRequired("bicaption"))
// other languages are used (lang_opts is then empty)
if (lang_opts.empty())
return string();
- // either a specific language (AsBabelOptions setting in
- // lib/languages) or the prefs require the languages to
+ // The prefs may require the languages to
// be submitted to babel itself (not the class).
if (langoptions)
return "\\usepackage[" + lang_opts + "]{babel}";
}
-bool LaTeXFeatures::needBabelLangOptions() const
-{
- if (!lyxrc.language_global_options || params_.language->asBabelOptions())
- return true;
-
- LanguageList::const_iterator it = UsedLanguages_.begin();
- LanguageList::const_iterator end = UsedLanguages_.end();
- for (; it != end; ++it)
- if ((*it)->asBabelOptions())
- return true;
-
- return false;
-}
-
-
string const LaTeXFeatures::loadAMSPackages() const
{
ostringstream tmp;
docstring const getBabelPresettings() const;
/// Extra preamble code after babel is called
docstring const getBabelPostsettings() const;
- /// Do we need to pass the languages to babel directly?
- bool needBabelLangOptions() const;
/// Load AMS packages when appropriate
std::string const loadAMSPackages() const;
/// The definitions needed by the document's textclass
bool Language::readLanguage(Lexer & lex)
{
enum LanguageTags {
- LA_AS_BABELOPTS = 1,
- LA_BABELNAME,
+ LA_BABELNAME = 1,
LA_DATEFORMATS,
LA_ENCODING,
LA_END,
// Keep these sorted alphabetically!
LexerKeyword languageTags[] = {
- { "asbabeloptions", LA_AS_BABELOPTS },
{ "babelname", LA_BABELNAME },
{ "dateformats", LA_DATEFORMATS },
{ "encoding", LA_ENCODING },
case LA_END: // end of structure
finished = true;
break;
- case LA_AS_BABELOPTS:
- lex >> as_babel_options_;
- break;
case LA_BABELNAME:
lex >> babel_;
break;
bool Language::read(Lexer & lex)
{
- as_babel_options_ = 0;
encoding_ = 0;
internal_enc_ = 0;
rightToLeft_ = 0;
public:
///
Language() : rightToLeft_(false), encoding_(0), internal_enc_(false),
- as_babel_options_(false), has_gui_support_(false) {}
+ has_gui_support_(false) {}
/// LyX language name
std::string const lang() const { return lang_; }
/// Babel language name
std::string fontenc(BufferParams const &) const;
/// Return the localized date formats (long, medium, short format)
std::string dateFormat(size_t i) const;
- /// This language needs to be passed to babel itself (not the class)
- bool asBabelOptions() const { return as_babel_options_; }
/// This language corresponds to a translation of the GUI
bool hasGuiSupport() const { return has_gui_support_; }
///