]> git.lyx.org Git - features.git/commitdiff
tex2lyx: more support for TIPA
authorUwe Stöhr <uwestoehr@lyx.org>
Mon, 18 Feb 2013 02:23:34 +0000 (03:23 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Mon, 18 Feb 2013 02:23:34 +0000 (03:23 +0100)
- support for the combining diacritical marks
- support for \texttoptiebar and \textbottomtiebar
- test-insets.lyx: add complete testcase
- TODO.txt: update what still needs to be done

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

index e2235014924b93f259bdf25eb5851c2bcaeee5c0..42a37085c16d4da6a4b823dda30ea089b9ddc367 100644 (file)
@@ -51,9 +51,11 @@ 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    \tone{51}, \tone{15}, \tone{45},     InsetTIPA
-       \tone{12}, \tone{454}, \toptiebar,
-       \bottomtiebar
+438    \tone{51} etc.,                      InsetTIPA
+       \=*{a}, \*r and \*w, \!o
+       and \!b and \!d and \!g and \!G,
+       \textvertline, \t*{ },
+       \textdoublevertline, \textglobfall
 439    MinionPro.sty                        \font_roman, \font_osf
 440    MinionPro.sty,                       \font_math
 443    unicode-math.sty                     InsetMath*
index af9c2de849d44aa1a987fcdb4ca7b2ae19afe552..1013460bd70ba3bff2b5b2dbdd59afcb787c16f0 100644 (file)
@@ -5699,7 +5699,382 @@ TIPA
 \begin_inset IPA
 
 \begin_layout Standard
-[@n Iɡ"zA:mpl]
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+r{e}
+\end_layout
+
+\end_inset
+
+ e̬ e̤ e˷ e̼ e̪ e̺ e̻ e
+\begin_inset script superscript
+
+\begin_layout Standard
+h
+\end_layout
+
+\end_inset
+
+ e̹ e̜ e̟ 
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+={*}
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{
+\end_layout
+
+\end_inset
+
+e
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+}
+\end_layout
+
+\end_inset
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+b{e}
+\end_layout
+
+\end_inset
+
+ ë e̽ 
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+s
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{
+\end_layout
+
+\end_inset
+
+e
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+}
+\end_layout
+
+\end_inset
+
+ e̩ e̯ e˞e
+\begin_inset script superscript
+
+\begin_layout Standard
+w
+\end_layout
+
+\end_inset
+
+ e
+\begin_inset script superscript
+
+\begin_layout Standard
+j
+\end_layout
+
+\end_inset
+
+ e
+\begin_inset script superscript
+
+\begin_layout Standard
+\end_layout
+
+\end_inset
+
+ e
+\begin_inset script superscript
+
+\begin_layout Standard
+\end_layout
+
+\end_inset
+
+ e̴ e̝ e̞ e̘ e̙ ẽ e
+\begin_inset script superscript
+
+\begin_layout Standard
+n
+\end_layout
+
+\end_inset
+
+ e
+\begin_inset script superscript
+
+\begin_layout Standard
+l
+\end_layout
+
+\end_inset
+
+ e˺ 
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+H{e}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+è ē é eȅ ě ê e᷄ e᷅ e᷈ ĕ 
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\begin_inset IPA
+
+\begin_layout Standard
+pbtd t dcɟkɡq G
+\end_layout
+
+\end_inset
+
+\begin_inset IPA
+
+\begin_layout Standard
+PmMn nɲN N Br RR
+\end_layout
+
+\end_inset
+
+\begin_inset IPA
+
+\begin_layout Standard
+ rFBfvTDszSZ s
+\end_layout
+
+\end_inset
+
+\begin_inset IPA
+
+\begin_layout Standard
+ zçJxGXKħQhHɬ
+\end_layout
+
+\end_inset
+
+\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
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\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'
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\begin_inset IPA
+
+\begin_layout Standard
+iy1ʉW
+\color red
+uIY
+\color inherit
+Ueø987o@E\9c3ɞ2Oæ5aɶA6
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\begin_inset IPA
+
+\begin_layout Standard
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+*
+\end_layout
+
+\end_inset
+
+ww4 HʢʡCʑɺɧ
+\begin_inset IPADeco toptiebar
+status open
+
+\begin_layout Standard
+ar
+\end_layout
+
+\end_inset
+
+
+\begin_inset IPADeco bottomtiebar
+status open
+
+\begin_layout Standard
+tz
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -5712,11 +6087,83 @@ TIPA
 \begin_inset IPA
 
 \begin_layout Standard
-[@n Ig"zA
-\color red
-:m
-\color inherit
-pl]
+:;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
+
+.
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+t{*}
+\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
+}
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -5729,14 +6176,14 @@ pl]
 \begin_inset IPA
 
 \begin_layout Standard
-ls B!Y
+
 \begin_inset ERT
 status collapsed
 
 \begin_layout Plain Layout
 
 \backslash
-textbottomtiebar
+tone
 \end_layout
 
 \end_inset
@@ -5751,7 +6198,7 @@ status collapsed
 
 \end_inset
 
-ae
+55
 \begin_inset ERT
 status collapsed
 
@@ -5768,7 +6215,7 @@ status collapsed
 \begin_layout Plain Layout
 
 \backslash
-texttoptiebar
+tone
 \end_layout
 
 \end_inset
@@ -5783,7 +6230,7 @@ status collapsed
 
 \end_inset
 
-ar
+44
 \begin_inset ERT
 status collapsed
 
@@ -5794,29 +6241,77 @@ status collapsed
 \end_inset
 
 
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+tone
+\end_layout
+
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{
 \end_layout
 
-\begin_layout Standard
-l
+\end_inset
+
+33
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+}
+\end_layout
+
+\end_inset
+
+
 \begin_inset ERT
 status collapsed
 
 \begin_layout Plain Layout
 
 \backslash
-u{ö}
+tone
 \end_layout
 
 \end_inset
 
-e
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{
+\end_layout
+
+\end_inset
+
+22
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+}
+\end_layout
+
+\end_inset
+
+
 \begin_inset ERT
 status collapsed
 
 \begin_layout Plain Layout
 
 \backslash
-t{*}
+tone
 \end_layout
 
 \end_inset
@@ -5831,7 +6326,7 @@ status collapsed
 
 \end_inset
 
+11
 \begin_inset ERT
 status collapsed
 
@@ -5841,7 +6336,19 @@ status collapsed
 
 \end_inset
 
+ꜜꜛ
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+tone
+\end_layout
+
+\end_inset
+
+
 \begin_inset ERT
 status collapsed
 
@@ -5851,7 +6358,7 @@ status collapsed
 
 \end_inset
 
-r
+15
 \begin_inset ERT
 status collapsed
 
@@ -5861,7 +6368,19 @@ status collapsed
 
 \end_inset
 
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+tone
+\end_layout
+
+\end_inset
+
+
 \begin_inset ERT
 status collapsed
 
@@ -5871,11 +6390,24 @@ status collapsed
 
 \end_inset
 
+51
+\begin_inset ERT
+status collapsed
 
-\begin_inset script superscript
+\begin_layout Plain Layout
+}
+\end_layout
 
-\begin_layout Standard
-j
+\end_inset
+
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+tone
 \end_layout
 
 \end_inset
 \begin_inset ERT
 status collapsed
 
+\begin_layout Plain Layout
+{
+\end_layout
+
+\end_inset
+
+45
+\begin_inset ERT
+status collapsed
+
 \begin_layout Plain Layout
 }
 \end_layout
 
 \end_inset
 
- d˺ 
+
 \begin_inset ERT
 status collapsed
 
 \begin_layout Plain Layout
 
 \backslash
-H{k}
+tone
 \end_layout
 
 \end_inset
 
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{
+\end_layout
+
+\end_inset
+
+12
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+}
+\end_layout
+
+\end_inset
+
+
 \begin_inset ERT
 status collapsed
 
@@ -5924,7 +6486,7 @@ status collapsed
 
 \end_inset
 
-55
+454
 \begin_inset ERT
 status collapsed
 
@@ -5934,7 +6496,7 @@ status collapsed
 
 \end_inset
 
-e
+↗
 \begin_inset ERT
 status collapsed
 
@@ -5956,7 +6518,7 @@ status collapsed
 
 \end_inset
 
+
 \end_layout
 
 \end_inset
index 187711c2bfa63f29b16b201a2fd46401de8ada16..d84657273ccb449e86d31521bfef2bda7cb85a06 100644 (file)
@@ -516,16 +516,69 @@ $test\vphantom{Wow\&\%}test$
 
 \subsection{TIPA}
 
-\textipa{[@n I\textscriptg "zA:mpl]}
+\begin{IPA}
+\r{e}
+\textsubwedge{e}
+\textsubumlaut{e}
+\textsubtilde{e}
+\textseagull{e}
+\textsubbridge{e}
+\textinvsubbridge{e}
+\textsubsquare{e}
+e\textsuperscript{h}
+\textsubrhalfring{e}
+\textsublhalfring{e}
+\textsubplus{e}
+\=*{e}
+\b{e}
+\"{e}
+\textovercross{e}
+\s{e}
+\textsyllabic{e}
+\textsubarch{e}
+e\textrhoticity
+e\textsuperscript{w}
+e\textsuperscript{j}
+e\textsuperscript{\textgamma}
+e\textsuperscript{\textrevglotstop}
+\textsuperimposetilde{e}
+\textraising{e}
+\textlowering{e}
+\textadvancing{e}
+\textretracting{e}
+\~{e}
+e\textsuperscript{n}
+e\textsuperscript{l}
+e\textcorner{}
+\H{e}
+
+\`{e}
+\={e}
+\'{e}
+\textdoublegrave{e}
+\v{e}
+\^{e}
+\texthighrise{e}
+\textlowrise{e}
+\textrisefall{e}
+\u{e}
+\end{IPA}
 
-\textipa{[@n Ig"zA\textcolor{red}{:m}pl]}
+\textipa{pbtd\:t\:dc\textbardotlessj k\textscriptg q\;G}
+\textipa{PmMn\:n\textltailn N\;N\;Br\;RR}
+\textipa{\:rFBfvTDszSZ\:s}
+\textipa{\:zçJxGXK\textcrh QhH\textbeltl{}}
+\textipa{\textlyoghlig V\*r\:Rh\textturnmrleg l\:lL\;L}
 
-\begin{IPA}
-ls\;B!Y\textbottomtiebar{ae}\texttoptiebar{ar}
+\textipa{\!o|!\textdoublebarpipe ||\!b\!d\!j\!g\!Ge'}
 
-l\u{ö}e\t*{ }\textsubring{r}\textovercross{\textsuperscript{j}} d\textcorner{}
-\H{k} \tone{55}e\textglobfall{}
-\end{IPA}
+\textipa{iy1\textbaru W\textcolor{red}{uIY}Ueø987o@E\9c3\textcloserevepsilon 2Oæ5a\textscoelig A6}
+
+\textipa{\*ww4\;H\textbarrevglotstop\textbarglotstop C\textctz\textturnlonglegr\texththeng \texttoptiebar{ar}\textbottomtiebar{tz}}
+
+\textipa{:;e\textprimstress\textsecstress \textvertline{}\textdoublevertline{}.\t*{ }}
+
+\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{}}
 
 
 \subsection{Line breaks\sindex[breaks]{Line breaks}}
index 7bf2daed64a5657dd5b73ac6b58c5c0b738a27b3..474fcb18e6b8a3cd4462db86467dc7718bda0d42 100644 (file)
@@ -1417,7 +1417,6 @@ void parse_environment(Parser & p, ostream & os, bool outer,
                eat_whitespace(p, os, parent_context, false);
                parent_context.check_layout(os);
                begin_inset(os, "IPA\n");
-               //os << "status open\n";
                parse_text_in_inset(p, os, FLAG_END, outer, parent_context);
                end_inset(os);
                p.skip_spaces();
@@ -3229,6 +3228,52 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        preamble.registerAutomaticallyLoadedPackage("tipx");
                }
 
+               else if (t.cs() == "texttoptiebar" || t.cs() == "textbottomtiebar") {
+                       context.check_layout(os);
+                       begin_inset(os, "IPADeco " + t.cs().substr(4) + "\n");
+                       os << "status open\n";
+                       parse_text_in_inset(p, os, FLAG_ITEM, outer, context);
+                       end_inset(os);
+                       p.skip_spaces();
+               }
+
+               // the TIPA Combining diacritical marks
+               else if (t.cs() == "textsubwedge" || t.cs() == "textsubumlaut"
+                       || t.cs() == "textsubtilde" || t.cs() == "textseagull"
+                       || t.cs() == "textsubbridge" || t.cs() == "textinvsubbridge"
+                       || t.cs() == "textsubsquare" || t.cs() == "textsubrhalfring"
+                       || t.cs() == "textsublhalfring" || t.cs() == "textsubplus"
+                       || t.cs() == "textovercross" || t.cs() == "textsubarch"
+                       || t.cs() == "textsuperimposetilde" || t.cs() == "textraising"
+                       || t.cs() == "textlowering" || t.cs() == "textadvancing"
+                       || t.cs() == "textretracting" || t.cs() == "textdoublegrave"
+                       || t.cs() == "texthighrise" || t.cs() == "textlowrise"
+                       || t.cs() == "textrisefall" || t.cs() == "textsyllabic") {
+                       context.check_layout(os);
+                       // try to see whether the string is in unicodesymbols
+                       bool termination;
+                       docstring rem;
+                       string content = trimSpaceAndEol(p.verbatim_item());
+                       string command = t.asInput() + "{"
+                               + trimSpaceAndEol(content)
+                               + "}";
+                       set<string> req;
+                       docstring s = encodings.fromLaTeXCommand(from_utf8(command),
+                               Encodings::TEXT_CMD | Encodings::MATH_CMD,
+                               termination, rem, &req);
+                       if (!s.empty()) {
+                               if (!rem.empty())
+                                       cerr << "When parsing " << command
+                                            << ", result is " << to_utf8(s)
+                                            << "+" << to_utf8(rem) << endl;
+                               os << content << to_utf8(s);
+                               for (set<string>::const_iterator it = req.begin(); it != req.end(); ++it)
+                                       preamble.registerAutomaticallyLoadedPackage(*it);
+                       } else
+                               // we did not find a non-ert version
+                               output_ert_inset(os, command, context);
+               }
+
                else if (t.cs() == "phantom" || t.cs() == "hphantom" ||
                             t.cs() == "vphantom") {
                        context.check_layout(os);