]> git.lyx.org Git - features.git/commitdiff
tex2lyx: support for phantom insets
authorUwe Stöhr <uwestoehr@web.de>
Mon, 24 Oct 2011 22:39:54 +0000 (22:39 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Mon, 24 Oct 2011 22:39:54 +0000 (22:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39958 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/TODO.txt
src/tex2lyx/test/test-insets.tex
src/tex2lyx/text.cpp

index ee6172e891364e4649a9f0e210569de14719de39..cf6b09429c02eeaf0f7c448f108916aaf660fea8 100644 (file)
@@ -50,7 +50,6 @@ Format LaTeX feature                        LyX feature
 336    ?                                    \font_cjk
 343    ?                                    \use_default_options
 347    tabular valign                       InsetTabular
-348    \phantom, \hphantom, \vphantom       InsetPhantom
 350    ?                                    \default_output_format
 353    \printsubindex                       InsetIndex
 354    \printindex*, \printsubindex*        InsetIndex
index 82299ac717d78a5e738821984820c5d4919b9f9e..5ffbc6e88dc05c62640b09b7256b1785a9a1db74 100644 (file)
@@ -110,6 +110,7 @@ in their names. It's OK to use them in the man\"{u}script, though.
 \bibitem[{{G\"{u}rkan et~al.}(2004)}]{gur+04} Gürkan, M.~A., Freitag,
 M., \& Rasio, F.~A. 2004, ApJ, 604, 632\end{thebibliography}
 
+
 \section{Input files\index{Input files}}
 
 We can input files too, like this \input{DummyDocument}, or with the include
@@ -119,16 +120,37 @@ variant \include{DummyDocument} % unfortunately, including the doc twice
 If you prefer verbatim input, you can choose
 between~\verbatiminput{foo} or~\verbatiminput*{foo}.
 
+
 \section{URL\index{URL}\nomenclature[www]{URL}{uniform resource locator}}
 
 An URL: \url{http://www.lyx.org}
 \nomenclature{URL2}{uniform resource locator}
 
+
 \section{Lists\index{Lists}}
 
 \listoffigures
 \listoftables
 
+
+\section{Phantoms}
+
+test\hphantom{Wow}test
+
+test\phantom{\textcolor{green}{W}\textbf{ow}\textsuperscript{Wow}}test
+
+test\vphantom{Wow\textbackslash{}\&\%}test
+
+$test\hphantom{Wow}test$
+
+\[
+test\phantom{\textcolor{green}{W}\mathbf{ow}\textsuperscript{Wow}}test
+\]
+
+
+$test\vphantom{Wow\&\%}test$
+
+
 \section{Graphics\index{Graphics}}
 
 There is also some basic support for graphics, in the form
index 758ddc120b8c900c8a2a60d215e1e7a9853d2a17..ce588869816d139bea186dd1b2399b4c7a381043 100644 (file)
@@ -881,6 +881,8 @@ void parse_box(Parser & p, ostream & os, unsigned outer_flags,
                Context context(true, parent_context.textclass);
                context.font = parent_context.font;
 
+               // FIXME, the inset layout should be plain, not standard, see bug #7846
+
                // If we have no inner box the contens will be read with the outer box
                if (!inner_type.empty())
                        parse_text(p, os, inner_flags, outer, context);
@@ -2443,6 +2445,21 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        os << "\n\\" << t.cs() << " default\n";
                }
 
+               // FIXME, the inset layout should be plain, not standard, see bug #7846
+               else if (t.cs() == "phantom" || t.cs() == "hphantom" ||
+                            t.cs() == "vphantom") {
+                       context.check_layout(os);
+                       if (t.cs() == "phantom")
+                               begin_inset(os, "Phantom Phantom\n");
+                       if (t.cs() == "hphantom")
+                               begin_inset(os, "Phantom Hhantom\n");
+                       if (t.cs() == "vphantom")
+                               begin_inset(os, "Phantom Vhantom\n");
+                       os << "status open\n";
+                       parse_text_in_inset(p, os, FLAG_ITEM, outer, context);
+                       end_inset(os);
+               }
+               
                else if (t.cs() == "lyxline") {
                        // swallow size argument (it is not used anyway)
                        p.getArg('{', '}');