]> git.lyx.org Git - features.git/commitdiff
textsubscript and textsuperscript for tex2lyx
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 12 Dec 2010 12:16:18 +0000 (12:16 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 12 Dec 2010 12:16:18 +0000 (12:16 +0000)
(deactivated until format is recent enough)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36839 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/preamble.cpp
src/tex2lyx/test/test-insets.tex
src/tex2lyx/text.cpp

index fc76051a75f087f3daeb75a2edfbe7746d0a5e5e..9b6b9d25f68c99194d209c6f1c94c197030c9cc6 100644 (file)
@@ -377,6 +377,9 @@ void handle_package(Parser &p, string const & name, string const & opts,
        else if (name == "url")
                ; // ignore this
 
+       else if (LYX_FORMAT >= 408 && name == "subscript")
+               ; // ignore this
+
        else if (name == "color") {
                // with the following command this package is only loaded when needed for
                // undefined colors, since we only support the predefined colors
index 13e4026648ee4a656b95258bf3be1c77c37df319..f7d16d2b29b20fedf6603143095b170f16b98617 100644 (file)
@@ -16,6 +16,7 @@
 \providecommand{\makenomenclature}{\makeglossary}
 \usepackage{varioref}
 \usepackage{prettyref}
+\usepackage{subscript}
 
 \usepackage{graphicx}
 
@@ -153,6 +154,9 @@ And what about special characters like hyphe\-nation mark,
 ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu
 separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break.
 
+A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
+with $a^2+b^2=c^2$ math}.
+
 \printindex{}
 
 \printnomenclature{}
index 632be575d13b14cf4bb6c767a398dbd6aef1156c..72426f550f166822fee8045af69ec4bdfda4eb0c 100644 (file)
@@ -2162,6 +2162,15 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        end_inset(os);
                }
 
+               else if (LYX_FORMAT >= 408 &&
+                        (t.cs() == "textsuperscript" || t.cs() == "textsubscript")) {
+                       context.check_layout(os);
+                       begin_inset(os, "script ");
+                       os << t.cs().substr(4) << '\n';
+                       parse_text_in_inset(p, os, FLAG_ITEM, false, context);
+                       end_inset(os);
+               }
+
                else if (is_known(t.cs(), known_quotes)) {
                        char const * const * where = is_known(t.cs(), known_quotes);
                        context.check_layout(os);