-/* This file is part of
- * ======================================================
+/**
+ * \file insetquotes.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * LyX, The Document Processor
+ * \author Jean-Marc Lasgouttes
*
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
#include <config.h>
#include "lyxfont.h"
#include "lyxrc.h"
#include "paragraph.h"
+#include "lyxlex.h"
using std::ostream;
using std::endl;
// Corresponding LaTeX code, for double and single quotes.
char const * const latex_quote_t1[2][5] =
-{ { "\\quotesinglbase{}", "'", "`",
+{ { "\\quotesinglbase ", "'", "`",
"\\guilsinglleft{}", "\\guilsinglright{}" },
{ ",,", "''", "``", "<<", ">>" } };
char const * const latex_quote_ot1[2][5] =
-{ { "\\quotesinglbase{}", "'", "`",
+{ { "\\quotesinglbase ", "'", "`",
"\\guilsinglleft{}", "\\guilsinglright{}" },
- { "\\quotedblbase{}", "''", "``",
+ { "\\quotedblbase ", "''", "``",
"\\guillemotleft{}", "\\guillemotright{}" } };
char const * const latex_quote_babel[2][5] =
-{ { "\\glq{}", "'", "`", "\\flq{}", "\\frq{}" },
- { "\\glqq{}", "''", "``", "\\flqq{}", "\\frqq{}" } };
+{ { "\\glq ", "'", "`", "\\flq{}", "\\frq{}" },
+ { "\\glqq ", "''", "``", "\\flqq{}", "\\frqq{}" } };
} // namespace anon
for (string::size_type i = 0; i < text.length(); ++i) {
if (text[i] == ' ')
w += font_metrics::width('i', font);
- else if (i == 0 || text[i] != text[i-1])
+ else if (i == 0 || text[i] != text[i - 1])
w += font_metrics::width(text[i], font);
else
w += font_metrics::width(',', font);
{
string const text = dispString(font.language());
- bv->painter().text(int(x), baseline, text, font);
+ if (text.length() == 2 && text[0] == text[1]) {
+ bv->painter().text(int(x), baseline, text[0], font);
+ int x2 = int(x + font_metrics::width(',', font));
+ bv->painter().text(x2, baseline, text[0], font);
+ } else
+ bv->painter().text(int(x), baseline, text, font);
x += width(bv, font);
}
}
-int InsetQuotes::docbook(Buffer const *, ostream & os) const
+int InsetQuotes::docbook(Buffer const *, ostream & os, bool) const
{
if (times_ == DoubleQ) {
if (side_ == LeftQ)