1

I have some IPA symbols in my table. Now without any IPA package, rectangle box appears instead of IPA symbols. However, after google search, I found a package named tipa. So I added the package and called it like

\textipa{paɦaɖ}

However, the result is after using tipa, the IPA symbols just vanished. How to solve this issue. Thank you.

\documentclass[12pt]{article}

\usepackage{xcolor}
\usepackage{listings}
\usepackage{booktabs}
\usepackage{array}
\usepackage{float}
\usepackage{graphicx}  
\usepackage[utf8]{inputenc}
\usepackage{polyglossia}
\usepackage{fontspec}
\setmainlanguage{english}
\setotherlanguage{bengali}
\newfontfamily\bengalifont[Script=Bengali]{Vrinda}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{makecell, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{amssymb}
\usepackage{tipa}
\usepackage{newfloat}
\DeclareFloatingEnvironment[
    fileext=los,
    listname={List of Diagrams},
    name=Diagram,
    placement=tbhp,
    within=none,
]{diagram}



\begin{document}

\begin{table}[htb] % <--- "here", "top", "bottom"
    \setcellgapes{2pt}
    \makegapedcells
\caption{Text Text Text Text}
    \begin{tabular}{lcr}
    \toprule
    \toprule
\makecell[lb]{Misspelled Word}
            & \makecell[b]{Correct Word}
                                & \makecell[b]{Translation in English}\\
    \midrule
\textbengali{পাহাড (IPA: \textipa{paɦaɖ})} & \textbengali{পাহাড়(IPA: paɦaɽ)} & Mountain \\
\textbengali{বিশেয(IPA: biʃedʒ)} & \textbengali{বিশেষ(IPA: biʃeʃ)} & Special \\
\textbengali{ফুটরল(IPA: pʰuʈrɔl)} & \textbengali{ফুটবল(IPA: pʰuʈbɔl)} & Football \\

    \bottomrule
    \bottomrule
    \end{tabular}
  \label{table9}
\end{table}

\end{document}

Here is the current output: enter image description here

  • tipa is designed for pdftex not xetex and isn't expecting unicode input but tex commands using the commands defined by that package with xetex it should be easier to use an OTF font that covers that range – David Carlisle Apr 11 '19 at 18:06

1 Answers1

3

I would recommend against using tipa because you are already using fontspec to switch fonts for your Bangla text (so you must be using XeLaTeX or LuaLaTeX) and you already have your IPA text in Unicode (see https://tex.stackexchange.com/a/240621/42880 for more reasons). (The \textipa command from tipa requires you to recode all your IPA into special tipa-specific symbols/commands that are then converted into IPA.)

You just need to set your main font to be one that includes IPA characters, like Linux Libertine O, Brill, Charis SIL, etc. The default Latin Modern does not have these symbols. Make sure you keep the IPA text out of the \textbengali{} so that it will use the main font.

\documentclass[12pt]{article}

\usepackage{xcolor}
\usepackage{listings}
\usepackage{booktabs}
\usepackage{array}
\usepackage{float}
\usepackage{graphicx}  
% \usepackage[utf8]{inputenc} - no need to use this with XeLaTeX
\usepackage{polyglossia}
\usepackage{fontspec}
\setmainlanguage{english}
\setmainfont{Linux Libertine O} % use any font on your system that has the IPA symbols you need
\setotherlanguage{bengali}
\newfontfamily\bengalifont[Script=Bengali]{Vrinda}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{makecell, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{amssymb}
\usepackage{tipa}
\usepackage{newfloat}
\DeclareFloatingEnvironment[
    fileext=los,
    listname={List of Diagrams},
    name=Diagram,
    placement=tbhp,
    within=none,
]{diagram}



\begin{document}

\begin{table}[htb] % <--- "here", "top", "bottom"
    \setcellgapes{2pt}
    \makegapedcells
\caption{Text Text Text Text}
    \begin{tabular}{lcr}
    \toprule
    \toprule
\makecell[lb]{Misspelled Word}
            & \makecell[b]{Correct Word}
                                & \makecell[b]{Translation in English}\\
    \midrule
\textbengali{পাহাড } (IPA: paɦaɖ) & \textbengali{পাহাড়}(IPA: paɦaɽ) & Mountain \\ % make sure you keep only the Bangla text (and not the IPA) within \textbengali{}
\textbengali{বিশেয}(IPA: biʃedʒ) & \textbengali{বিশেষ}(IPA: biʃeʃ) & Special \\
\textbengali{ফুটরল}(IPA: pʰuʈrɔl) & \textbengali{ফুটবল}(IPA: pʰuʈbɔl) & Football \\

    \bottomrule
    \bottomrule
    \end{tabular}
  \label{table9}
\end{table}

\end{document}

enter image description here

Jason Zentz
  • 4,158
  • ! Package fontspec Error: The font "Linux Libertine O" cannot be found. - The error occured. – Nahid Hossain Shihab Apr 12 '19 at 04:01
  • You will have to use a font that you have on your computer (just as I had to download Vrinda to mine for your code). Linux Libertine is available for free download, as are the others I mentioned. If you have Microsoft products on your computer, you may have some fonts that have a few IPA symbols (Calibri, Cambria, Times New Roman, etc.), but they might not work well with diacritic stacking or overbars. See https://tex.stackexchange.com/a/304297/42880 and https://tex.stackexchange.com/a/249260/42880. You can also use \usepackage{libertine} but that doesn't generalize to other IPA fonts. – Jason Zentz Apr 12 '19 at 15:02