diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index 85ac9d2def..e223501492 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -51,7 +51,6 @@ 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 -427 tipa.sty \begin{IPA} InsetTIPA 438 \tone{51}, \tone{15}, \tone{45}, InsetTIPA \tone{12}, \tone{454}, \toptiebar, \bottomtiebar diff --git a/src/tex2lyx/test/test-insets.lyx.lyx b/src/tex2lyx/test/test-insets.lyx.lyx index b5dcfef22d..af9c2de849 100644 --- a/src/tex2lyx/test/test-insets.lyx.lyx +++ b/src/tex2lyx/test/test-insets.lyx.lyx @@ -5722,6 +5722,246 @@ pl] \end_inset +\end_layout + +\begin_layout Standard + +\begin_inset IPA + +\begin_layout Standard +ls B!Y +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + +\backslash +textbottomtiebar +\end_layout + +\end_inset + + +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +{ +\end_layout + +\end_inset + +ae +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +} +\end_layout + +\end_inset + + +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + +\backslash +texttoptiebar +\end_layout + +\end_inset + + +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +{ +\end_layout + +\end_inset + +ar +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +l +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + +\backslash +u{ö} +\end_layout + +\end_inset + +e +\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 + +Ì¥ +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +{ +\end_layout + +\end_inset + +r +\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 + + +\begin_inset script superscript + +\begin_layout Standard +j +\end_layout + +\end_inset + + +\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} +\end_layout + +\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 + +55 +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +} +\end_layout + +\end_inset + +e +\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 + + +\end_layout + +\end_inset + + \end_layout \begin_layout Subsection diff --git a/src/tex2lyx/test/test-insets.tex b/src/tex2lyx/test/test-insets.tex index cbbce838ae..187711c2bf 100644 --- a/src/tex2lyx/test/test-insets.tex +++ b/src/tex2lyx/test/test-insets.tex @@ -520,6 +520,13 @@ $test\vphantom{Wow\&\%}test$ \textipa{[@n Ig"zA\textcolor{red}{:m}pl]} +\begin{IPA} +ls\;B!Y\textbottomtiebar{ae}\texttoptiebar{ar} + +l\u{ö}e\t*{ }\textsubring{r}\textovercross{\textsuperscript{j}} d\textcorner{} +\H{k} \tone{55}e\textglobfall{} +\end{IPA} + \subsection{Line breaks\sindex[breaks]{Line breaks}} diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 6c84024bbc..7bf2daed64 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1413,6 +1413,18 @@ void parse_environment(Parser & p, ostream & os, bool outer, p.skip_spaces(); } + else if (name == "IPA") { + 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(); + preamble.registerAutomaticallyLoadedPackage("tipa"); + preamble.registerAutomaticallyLoadedPackage("tipx"); + } + else if (name == "CJK") { // the scheme is \begin{CJK}{encoding}{mapping}text\end{CJK} // It is impossible to decide if a CJK environment was in its own paragraph or within @@ -3211,8 +3223,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else if (t.cs() == "textipa") { context.check_layout(os); begin_inset(os, "IPA\n"); - parse_text_in_inset(p, os, FLAG_ITEM, outer, context, - "IPA"); + parse_text_in_inset(p, os, FLAG_ITEM, outer, context); end_inset(os); preamble.registerAutomaticallyLoadedPackage("tipa"); preamble.registerAutomaticallyLoadedPackage("tipx");