* Adjoining closing Single + double quote becomes double + single quote
(for English, Swedish and German, LaTeX export as ''').
* French double quotes are converted to << >> in the LaTeX file and to
double inverted question/interrogation marks in the output, if the font
encoding is set to [None] or OT1 but the global default is T1. (test
for lyxrc.fontenc instead of the document-specific fontenc setting in
InsetQuotes.cpp).
* Quote type ignored for LyXHTML: always "English" quotes used.
See #10451
{ "\\glqq ", "''", "``", "\\flqq{}", "\\frqq{}" }
};
{ "\\glqq ", "''", "``", "\\flqq{}", "\\frqq{}" }
};
+char const * const latex_quote_html[2][5] = {
+ { "‚", "’", "‘",
+ "‹", "›" },
+ { "„", "”", "“", "«", "»" }
+};
+
InsetQuotes::InsetQuotes(Buffer * buf, char_type c, QuoteTimes t)
: Inset(buf), times_(t)
{
InsetQuotes::InsetQuotes(Buffer * buf, char_type c, QuoteTimes t)
: Inset(buf), times_(t)
{
language_ = buf->params().quotes_language;
language_ = buf->params().quotes_language;
+ fontenc_ = (buf->params().fontenc == "global")
+ ? lyxrc.fontenc : buf->params().fontenc;
+ } else {
language_ = EnglishQuotes;
language_ = EnglishQuotes;
+ fontenc_ = lyxrc.fontenc;
+ }
qstr = "\\og "; //the spaces are important here
else
qstr = " \\fg{}"; //and here
qstr = "\\og "; //the spaces are important here
else
qstr = " \\fg{}"; //and here
- } else if (lyxrc.fontenc == "T1" && !runparams.use_polyglossia) {
+ } else if (fontenc_ == "T1" && !runparams.use_polyglossia) {
qstr = latex_quote_t1[times_][quoteind];
#ifdef DO_USE_DEFAULT_LANGUAGE
} else if (doclang == "default") {
qstr = latex_quote_t1[times_][quoteind];
#ifdef DO_USE_DEFAULT_LANGUAGE
} else if (doclang == "default") {
qstr = latex_quote_babel[times_][quoteind];
}
qstr = latex_quote_babel[times_][quoteind];
}
- // Always guard against unfortunate ligatures (!` ?`)
+ // Always guard against unfortunate ligatures (!` ?` `` '' ,, << >>)
+ char_type const lastchar = os.lastChar();
if (prefixIs(qstr, "`")) {
if (prefixIs(qstr, "`")) {
- char_type const lastchar = os.lastChar();
if (lastchar == '!' || lastchar == '?')
qstr.insert(0, "{}");
}
if (lastchar == '!' || lastchar == '?')
qstr.insert(0, "{}");
}
+ if (qstr[1] == lastchar)
+ qstr.insert(0, "{}");
os << from_ascii(qstr);
}
os << from_ascii(qstr);
}
docstring InsetQuotes::getQuoteEntity() const {
docstring InsetQuotes::getQuoteEntity() const {
- if (times_ == DoubleQuotes) {
- if (side_ == LeftQuote)
- return from_ascii("“");
- else
- return from_ascii("”");
- }
- if (side_ == LeftQuote)
- return from_ascii("‘");
- else
- return from_ascii("’");
+ const int quoteind = quote_index[side_][language_];
+ return from_ascii(latex_quote_html[times_][quoteind]);
#else
if (!features.useBabel()
#endif
#else
if (!features.useBabel()
#endif
- && lyxrc.fontenc != "T1") {
if (times_ == SingleQuotes)
switch (type) {
case ',': features.require("quotesinglbase"); break;
if (times_ == SingleQuotes)
switch (type) {
case ',': features.require("quotesinglbase"); break;
QuoteSide side_;
///
QuoteTimes times_;
QuoteSide side_;
///
QuoteTimes times_;
+ ///
+ std::string fontenc_;