The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit df6589a97e1dd6647b98cecd8ee071031563fe85
Merge: 6deb2b7 9dd1b7c
Author: Uwe Stöhr <[email protected]>
Date:   Tue Feb 19 00:07:42 2013 +0100

    Merge branch 'master' of git.lyx.org:lyx


commit 6deb2b76804b1e8e7faf7d204e424aa203e7c76c
Author: Uwe Stöhr <[email protected]>
Date:   Tue Feb 19 00:07:24 2013 +0100

    tex2lyx: support further TIPA characters
    
    - support for \textdoublevertline, \textvertline, \textglobfall
    - support \!o and \!b and \!d and \!g and \!G and \!j
    - support  and \*k and \*r and \*t and \*w
    - register the package "tipa" if \textipa is detected in an equation
    - add a \textipa equation to the testfile
    
    (I failed to implement support for the TIPA character "\t*{ }" and the 
command "\=*".)

diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt
index 8754a29..60c48e1 100644
--- a/src/tex2lyx/TODO.txt
+++ b/src/tex2lyx/TODO.txt
@@ -51,10 +51,7 @@ Format LaTeX feature                        LyX feature
 407    vertical offset for multirows        InsetTabular
 411    support for polyglossia              \language_package  (the cases of 
no package, of babel and of custom package is supported)
 415    automatic undertilde loading         \use_package undertilde
-438    \=*{a}, \*r and \*w, \!o             InsetTIPA
-       and \!b and \!d and \!g and \!G,
-       \textvertline, \t*{ },
-       \textdoublevertline, \textglobfall
+438    \t*{ } and \=*{a}                    InsetTIPA
 439    MinionPro.sty                        \font_roman, \font_osf
 440    MinionPro.sty,                       \font_math
 443    unicode-math.sty                     InsetMath*
diff --git a/src/tex2lyx/math.cpp b/src/tex2lyx/math.cpp
index 83e2101..9fddeea 100644
--- a/src/tex2lyx/math.cpp
+++ b/src/tex2lyx/math.cpp
@@ -237,6 +237,11 @@ void parse_math(Parser & p, ostream & os, unsigned flags, 
const mode_type mode)
                        preamble.registerAutomaticallyLoadedPackage("varioref");
                }
 
+               else if (t.cs() == "textipa") {
+                       os << t.asInput();
+                       preamble.registerAutomaticallyLoadedPackage("tipa");
+               }
+
                else
                        os << t.asInput();
 
diff --git a/src/tex2lyx/test/test-insets.lyx.lyx 
b/src/tex2lyx/test/test-insets.lyx.lyx
index 59f7a1b..b9deacb 100644
--- a/src/tex2lyx/test/test-insets.lyx.lyx
+++ b/src/tex2lyx/test/test-insets.lyx.lyx
@@ -5915,19 +5915,7 @@ PmMn nɲN N Br RR
 \begin_inset IPA
 
 \begin_layout Standard
-ɮV
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-*
-\end_layout
-
-\end_inset
-
-r Rhɰl lL L
+ɮVɹ Rhɰl lL L
 \end_layout
 
 \end_inset
@@ -5940,79 +5928,7 @@ r Rhɰl lL L
 \begin_inset IPA
 
 \begin_layout Standard
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-!
-\end_layout
-
-\end_inset
-
-o|!ǂ||
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-!
-\end_layout
-
-\end_inset
-
-b
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-!
-\end_layout
-
-\end_inset
-
-d
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-!
-\end_layout
-
-\end_inset
-
-j
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-!
-\end_layout
-
-\end_inset
-
-g
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-!
-\end_layout
-
-\end_inset
-
-Ge'
+ʘ|!ǂ||ɓɗʄɠʛe'
 \end_layout
 
 \end_inset
@@ -6042,19 +5958,7 @@ Ueø987o@Eœ3ɞ2Oæ5aɶA6
 \begin_inset IPA
 
 \begin_layout Standard
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-*
-\end_layout
-
-\end_inset
-
-ww4 HʢʡCʑɺɧ
+ʍw4 HʢʡCʑɺɧ
 \begin_inset IPADeco toptiebar
 status open
 
@@ -6087,51 +5991,7 @@ tz
 \begin_inset IPA
 
 \begin_layout Standard
-:;eˈˌ
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-textvertline
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-{}
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-textdoublevertline
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-{}
-\end_layout
-
-\end_inset
-
-.
+:;eˈˌ|‖.
 \begin_inset ERT
 status collapsed
 
@@ -6181,24 +6041,7 @@ status collapsed
 \IPAChar \tone{45}
 \IPAChar \tone{12}
 \IPAChar \tone{454}
-↗
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-
-\backslash
-textglobfall
-\end_layout
-
-\end_inset
-
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Plain Layout
-{}
+↗↘
 \end_layout
 
 \end_inset
@@ -6206,6 +6049,9 @@ status collapsed
 
 \end_layout
 
+\begin_layout Standard
+TIPA code in math: 
+\begin_inset Formula 
$\textipa{\tone{55}|\text{\!b{}\!d{}\!g{}\!G{}\textglobfall{}\textvertline{}\textdoublevertline{}}}$
 \end_inset
 
 
diff --git a/src/tex2lyx/test/test-insets.tex b/src/tex2lyx/test/test-insets.tex
index 591bd7b..11385dd 100644
--- a/src/tex2lyx/test/test-insets.tex
+++ b/src/tex2lyx/test/test-insets.tex
@@ -584,6 +584,8 @@ e\textcorner{}
 
 \textipa{\tone{55}\tone{44}\tone{33}\tone{22}\tone{11}\textdownstep\textupstep 
\tone{15}\tone{51}\tone{45}\tone{12}\tone{454}\textglobrise \textglobfall{}}
 
+TIPA code in math:
+$\textipa{\tone{55}|\text{\!b{}\!d{}\!g{}\!G{}\textglobfall{}\textvertline{}\textdoublevertline{}}}$
 
 \subsection{Line breaks\sindex[breaks]{Line breaks}}
 
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 4906925..f9888df 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -3305,6 +3305,14 @@ void parse_text(Parser & p, ostream & os, unsigned 
flags, bool outer,
                                output_ert_inset(os, command, context);
                }
 
+               else if (t.cs() == "textvertline" ) {
+                       // this TIPA character does not occur in
+                       // unicodesymbols because it is in the ASCII range
+                       context.check_layout(os);
+                       os << "|";
+                       skip_braces(p);
+               }
+
                else if (t.cs() == "phantom" || t.cs() == "hphantom" ||
                             t.cs() == "vphantom") {
                        context.check_layout(os);
@@ -4586,7 +4594,72 @@ void parse_text(Parser & p, ostream & os, unsigned 
flags, bool outer,
                        bool termination;
                        docstring rem;
                        set<string> req;
-                       docstring s = 
encodings.fromLaTeXCommand(from_utf8(t.asInput()),
+                       string name = t.asInput();
+                       // handle some TIPA special characters
+                       if (name == "\\textglobfall") {
+                               name = "End";
+                               skip_braces(p);
+                       }
+                       if (name == "\\textdoublevertline") {
+                               name = "\\textbardbl";
+                               skip_braces(p);
+                       }
+                       if (name == "\\!" ) {
+                               if (p.next_token().asInput() == "b") {
+                                       p.get_token();  // eat 'b'
+                                       name = "\\texthtb";
+                                       skip_braces(p);
+                               }
+                               if (p.next_token().asInput() == "d") {
+                                       p.get_token();
+                                       name = "\\texthtd";
+                                       skip_braces(p);
+                               }
+                               if (p.next_token().asInput() == "g") {
+                                       p.get_token();
+                                       name = "\\texthtg";
+                                       skip_braces(p);
+                               }
+                               if (p.next_token().asInput() == "G") {
+                                       p.get_token();
+                                       name = "\\texthtscg";
+                                       skip_braces(p);
+                               }
+                               if (p.next_token().asInput() == "j") {
+                                       p.get_token();
+                                       name = "\\texthtbardotlessj";
+                                       skip_braces(p);
+                               }
+                               if (p.next_token().asInput() == "o") {
+                                       p.get_token();
+                                       name = "\\textbullseye";
+                                       skip_braces(p);
+                               }
+                       }
+                       if (name == "\\*" ) {
+                               if (p.next_token().asInput() == "k") {
+                                       p.get_token();
+                                       name = "\\textturnk";
+                                       skip_braces(p);
+                               }
+                               if (p.next_token().asInput() == "r") {
+                                       p.get_token();  // eat 'b'
+                                       name = "\\textturnr";
+                                       skip_braces(p);
+                               }                               
+                               if (p.next_token().asInput() == "t") {
+                                       p.get_token();
+                                       name = "\\textturnt";
+                                       skip_braces(p);
+                               }
+                               if (p.next_token().asInput() == "w") {
+                                       p.get_token();
+                                       name = "\\textturnw";
+                                       skip_braces(p);
+                               }                               
+                       }
+                       // now get the character from unicodesymbols
+                       docstring s = 
encodings.fromLaTeXCommand(from_utf8(name),
                                        Encodings::TEXT_CMD, termination, rem, 
&req);
                        if (!s.empty()) {
                                if (!rem.empty())

-----------------------------------------------------------------------

Summary of changes:
 src/tex2lyx/TODO.txt                 |    5 +-
 src/tex2lyx/math.cpp                 |    5 +
 src/tex2lyx/test/test-insets.lyx.lyx |  170 ++--------------------------------
 src/tex2lyx/test/test-insets.tex     |    2 +
 src/tex2lyx/text.cpp                 |   75 +++++++++++++++-
 5 files changed, 90 insertions(+), 167 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to