mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
Fix Hebrew quotation marks
All typographic quotation marks are supported, if the proper LaTeX macros (as opposed to ligatures) are used. So no need for forcing straight quotes. This is in line with what babel-hebrew suggests.
This commit is contained in:
parent
ec4adcc3a5
commit
89c4357bf1
@ -85,6 +85,13 @@ char const * const latex_quote_ot1[2][5] = {
|
||||
"\\guillemotleft", "\\guillemotright" }
|
||||
};
|
||||
|
||||
char const * const latex_quote_noligatures[2][5] = {
|
||||
{ "\\quotesinglbase", "\\textquoteleft", "\\textquoteright",
|
||||
"\\guilsinglleft", "\\guilsinglright" },
|
||||
{ "\\quotedblbase", "\\textquotedblleft", "\\textquotedblright",
|
||||
"\\guillemotleft", "\\guillemotright" }
|
||||
};
|
||||
|
||||
char const * const latex_quote_babel[2][5] = {
|
||||
{ "\\glq", "'", "`", "\\flq", "\\frq" },
|
||||
{ "\\glqq", "''", "``", "\\flqq", "\\frqq" }
|
||||
@ -192,8 +199,8 @@ void InsetQuotes::parseString(string const & s)
|
||||
|
||||
docstring InsetQuotes::displayString() const
|
||||
{
|
||||
// In PassThru and Hebrew, we use straight quotes
|
||||
if (pass_thru_ || context_lang_ == "he_IL")
|
||||
// In PassThru, we use straight quotes
|
||||
if (pass_thru_)
|
||||
return (times_ == DoubleQuotes) ? from_ascii("\"") : from_ascii("'");
|
||||
|
||||
int const index = quote_index[side_][language_];
|
||||
@ -257,11 +264,8 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
||||
const int quoteind = quote_index[side_][language_];
|
||||
string qstr;
|
||||
|
||||
// In some context, we output plain quotes
|
||||
bool const force_plain =
|
||||
runparams.pass_thru
|
||||
|| runparams.local_font->language()->lang() == "hebrew";
|
||||
if (force_plain)
|
||||
// In pass-thru context, we output plain quotes
|
||||
if (runparams.pass_thru)
|
||||
qstr = (times_ == DoubleQuotes) ? "\"" : "'";
|
||||
else if (language_ == FrenchQuotes && times_ == DoubleQuotes
|
||||
&& prefixIs(runparams.local_font->language()->code(), "fr")
|
||||
@ -275,10 +279,16 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
||||
// FIXME: really? (doesn't make a difference
|
||||
// with recent babel-french)
|
||||
qstr = " \\fg";
|
||||
} else if (fontenc_ == "T1" && !runparams.use_polyglossia) {
|
||||
} else if (fontenc_ == "T1"
|
||||
&& !runparams.local_font->language()->internalFontEncoding()
|
||||
&& !runparams.use_polyglossia) {
|
||||
// Quotation marks for T1 font encoding
|
||||
// (using ligatures)
|
||||
qstr = latex_quote_t1[times_][quoteind];
|
||||
} else if (runparams.local_font->language()->internalFontEncoding()) {
|
||||
// Quotation marks for internal font encodings
|
||||
// (ligatures not featured)
|
||||
qstr = latex_quote_noligatures[times_][quoteind];
|
||||
#ifdef DO_USE_DEFAULT_LANGUAGE
|
||||
} else if (doclang == "default") {
|
||||
#else
|
||||
@ -293,7 +303,7 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
||||
qstr = latex_quote_babel[times_][quoteind];
|
||||
}
|
||||
|
||||
if (!force_plain) {
|
||||
if (!runparams.pass_thru) {
|
||||
// Always guard against unfortunate ligatures (!` ?` `` '' ,, << >>)
|
||||
char_type const lastchar = os.lastChar();
|
||||
if (prefixIs(qstr, "`")) {
|
||||
|
Loading…
Reference in New Issue
Block a user