我的表中有一些 IPA 符号。现在没有任何 IPA 包,矩形框代替了 IPA 符号。然而,经过谷歌搜索,我找到了一个名为蒂帕所以我添加了包并这样调用它
\textipa{帕ɦaɖ}
但是使用 tipa 后,IPA 符号就消失了。如何解决这个问题?谢谢。
\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}
答案1
我不建议使用,tipa
因为你已经在使用fontspec
切换孟加拉语文本的字体(所以你必须使用 XeLaTeX 或 LuaLaTeX),而且你的 IPA 文本已经是 Unicode 格式(请参阅https://tex.stackexchange.com/a/240621/42880出于更多原因)。(\textipa
命令tipa
要求您将所有 IPA 重新编码为特殊tipa
符号/命令,然后将其转换为 IPA。)
您只需将主字体设置为包含 IPA 字符的字体,例如 Linux Libertine O、Brill、Charis SIL 等。默认的 Latin Modern 没有这些符号。请确保将 IPA 文本排除在外,\textbengali{}
以便它使用主字体。
\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}