From 04911c04621d8da6194fb79e61866777c681f0fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sun, 27 Apr 2008 10:54:06 +0000 Subject: [PATCH] tex2lyx/text.cpp: - fix an off by one error in the font size handling, fixes bug 4803 - support \lyxline, fixes bug 4795 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24518 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/text.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 3d7e126dc2..237019d492 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -135,7 +135,7 @@ char const * const known_sizes[] = { "tiny", "scriptsize", "footnotesize", /// the same as known_sizes with .lyx names char const * const known_coded_sizes[] = { "default", "tiny", "scriptsize", "footnotesize", -"small", "normal", "large", "larger", "largest", "huge", "giant", 0}; +"small", "normal", "large", "larger", "largest", "huge", "giant", 0}; /// LaTeX 2.09 names for font families char const * const known_old_font_families[] = { "rm", "sf", "tt", 0}; @@ -1884,6 +1884,11 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, os << "\n\\" << t.cs() << " default\n"; } + else if (t.cs() == "lyxline") { + context.check_layout(os); + os << "\\lyxline"; + } + else if (use_natbib && is_known(t.cs(), known_natbib_commands) && ((t.cs() != "citefullauthor" && @@ -2002,7 +2007,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, char const * const * where = is_known(t.cs(), known_sizes); context.check_layout(os); TeXFont const oldFont = context.font; - context.font.size = known_coded_sizes[where - known_sizes]; + // the font size index differs by 1, because the known_coded_sizes + // has additionally a "default" entry + context.font.size = known_coded_sizes[where - known_sizes + 1]; output_font_change(os, oldFont, context.font); eat_whitespace(p, os, context, false); } -- 2.39.2