我尝试在 Windows 7(MiKTex 2.9)上使用 pdfLaTeX 和 XeLaTeX 从以下文档生成 pdf 文件。pdfLaTeX 响应说我需要使用 XeLaTeX。当我使用 XeLaTeX 时,它说sanskrit
找不到字体。我尝试了字体集中的其他字体,例如、、samarkan
。有人能帮我解决这个Bengali
问题并找到在 pdfLaTeX 下运行它的方法吗?Gurmukhi
Gujarati
Devanagari
\documentclass[10pt]{report}
\usepackage[letterpaper,top=2.0cm,bottom=2.0cm,left=0.5cm,right=1cm]{geometry}
\usepackage{booktabs}
\usepackage{array}
\usepackage{fancyhdr}
\usepackage[iso]{datetime}
\usepackage{lastpage}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hindi}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\devanagarifont[Scale=MatchUppercase]{sanskrit}
\newfontfamily\devtransl[Mapping=DevRom]{Times New Roman}
\pagestyle{fancy}
\fancyhf{}
\setlength\headheight{0.5pt}
\chead{\textbf{\huge{Inform}}}
\lhead{\textbf{Test1}}
\rhead{\textbf{\normalsize{Sets}}}
\rfoot{\today \hspace{0.5pt} \currenttime}
\cfoot{Page \thepage\ of \pageref{LastPage}}\lfoot{Some}
\renewcommand{\headrulewidth}{1pt}
\usepackage{supertabular}
\begin{document}
\fontsize{8}{10}\selectfont
\tablehead
{
\toprule
& \multicolumn{1}{p{24.5mm}}{\textbf{\foreignlanguage{hindi}{ग्रोस वोलयूम}}}
& \multicolumn{1}{p{21mm}}{\textbf{नेट वाल्यूम}}
& \multicolumn{1}{p{16mm}}{\textbf{लेवल}}
& \multicolumn{1}{p{21mm}}{\textbf{तापमान}}
& \multicolumn{1}{p{16mm}}{\centering{\textbf{ऊलाज}}}
& \multicolumn{1}{p{42mm}}{\centering{\textbf{लास्ट अपडेटड}}}\\
& \multicolumn{1}{p{24.5mm}}{\centering{\textbf{गैलन}}}
& \multicolumn{1}{p{21mm}}{\centering{\textbf{गैलन}}}
& \multicolumn{1}{p{16mm}}{\textbf{सेन्टीमीटर}}
& \multicolumn{1}{p{21mm}}{\centering{\textbf{सेन्टीग्रेड}}}
& \multicolumn{1}{p{16mm}}{\centering{\textbf{गैलन}}} & \\
\toprule
}
\begin{supertabular}{p{35mm}*{6}{r}}
\\ \multicolumn{7}{l}{\textbf {3001}}\\\\
\textbf{टेंक 2} & \multicolumn{6}{l}{SET1}\\
PROD 2& \multicolumn{6}{l}{(4,011 अधिकतम)}\\
\multicolumn{1}{r}{\textbf{प्रोडक्ट}} & 2,495.40 & 2,479.66 & 145.55 & 20.53 & 1,313.07 & 19/04/2012 15:00:23 \\
\multicolumn{1}{r}{\textbf{Water}} & 1.79 & & 1.00 & & & \\\\
\textbf{टेंक 3} & \multicolumn{6}{l}{SET2}\\
PROD 3& \multicolumn{6}{l}{(4,011 अधिकतम)}\\
\multicolumn{1}{r}{\textbf{प्रोडक्ट}} & 2,593.08 & 2,578.51 & 150.40 & 20.01 & 1,213.86 & 19/04/2012 15:00:23 \\
\multicolumn{1}{r}{\textbf{SET3}} & 3.32 & & 1.51 & & & \\\\
\toprule[2pt]\\
\end{supertabular}
\end{document}
答案1
有很多 Times 字体和梵文。您必须查看系统以找到正确的名称,例如 Linux
fc-list | grep Sanskrit
但是,你必须切换到梵文字体
\documentclass[10pt]{report}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hindi}
\usepackage{fontspec}
\setmainfont{TimesNewRomanPSStd-Regular}
\newfontfamily\devanagarifont[Scale=MatchUppercase]{Sanskrit2003}
\newfontfamily\devtransl[Mapping=DevRom]{TimesNewRomanPSStd-Regular}
\usepackage{booktabs,supertabular}
\begin{document}
\tablehead
{
\toprule
& \multicolumn{1}{p{24.5mm}}{\devanagarifont\textbf{\foreignlanguage{hindi}{ग्रोस वोलयूम}}}
& \multicolumn{1}{p{21mm}}{\devanagarifont\textbf{नेट वाल्यूम}}
& \multicolumn{1}{p{16mm}}{\devanagarifont\textbf{लेवल}}
& \multicolumn{1}{p{21mm}}{\devanagarifont\textbf{तापमान}}
& \multicolumn{1}{p{16mm}}{\centering{\devanagarifont\textbf{ऊलाज}}}
& \multicolumn{1}{p{42mm}}{\centering{\devanagarifont\textbf{लास्ट अपडेटड}}}\\
& \multicolumn{1}{p{24.5mm}}{\centering{\devanagarifont\textbf{गैलन}}}
& \multicolumn{1}{p{21mm}}{\centering{\devanagarifont\textbf{गैलन}}}
& \multicolumn{1}{p{16mm}}{\devanagarifont\textbf{सेन्टीमीटर}}
& \multicolumn{1}{p{21mm}}{\devanagarifont\centering{\textbf{सेन्टीग्रेड}}}
& \multicolumn{1}{p{16mm}}{\devanagarifont\centering{\textbf{गैलन}}} & \\
\toprule
}
\begin{supertabular}{p{35mm}*{6}{r}}
\\ \multicolumn{7}{l}{\textbf {3001}}\\\\
\devanagarifont\textbf{टेंक 2} & \multicolumn{6}{l}{SET1}\\
PROD 2& \multicolumn{6}{l}{(4,011 \devanagarifont अधिकतम)}\\
\multicolumn{1}{r}{\devanagarifont\textbf{प्रोडक्ट}} & 2,495.40 & 2,479.66 & 145.55 & 20.53 & 1,313.07 & 19/04/2012 15:00:23 \\
\multicolumn{1}{r}{\textbf{Water}} & 1.79 & & 1.00 & & & \\\\
\devanagarifont\textbf{टेंक 3} & \multicolumn{6}{l}{SET2}\\
PROD 3& \multicolumn{6}{l}{(4,011\devanagarifont अधिकतम)}\\
\multicolumn{1}{r}{\devanagarifont\textbf{प्रोडक्ट}} & 2,593.08 & 2,578.51 & 150.40 & 20.01 & 1,213.86 & 19/04/2012 15:00:23 \\
\multicolumn{1}{r}{\textbf{SET3}} & 3.32 & & 1.51 & & & \\\\
\toprule[2pt]\\
\end{supertabular}
\end{document}
答案2
我以为 Latex 的字体与主机操作系统不同,至少对于 Windows 来说是这样。然而事实并非如此,它使用与操作系统相同的字体。在上述问题中,在 Herbert 的建议下,我在 Windows 中安装了 Sanskrit 2003 字体http://www.omkarananda-ashram.org/Sanskrit/itranslator2003.htm#dls并且有效:
\documentclass[10pt]{report}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hindi}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\newfontfamily\devanagarifont[Scale=MatchUppercase]{Sanskrit 2003}
\newfontfamily\devtransl[Mapping=DevRom]{Times New Roman}
\usepackage{booktabs,supertabular}
\begin{document}
\tablehead
{
\toprule
& \multicolumn{1}{p{24.5mm}}{\devanagarifont\textbf{\foreignlanguage{hindi}{ग्रोस वोलयूम}}}
& \multicolumn{1}{p{21mm}}{\devanagarifont\textbf{नेट वाल्यूम}}
& \multicolumn{1}{p{16mm}}{\devanagarifont\textbf{लेवल}}
& \multicolumn{1}{p{21mm}}{\devanagarifont\textbf{तापमान}}
& \multicolumn{1}{p{16mm}}{\centering{\devanagarifont\textbf{ऊलाज}}}
& \multicolumn{1}{p{42mm}}{\centering{\devanagarifont\textbf{लास्ट अपडेटड}}}\\
& \multicolumn{1}{p{24.5mm}}{\centering{\devanagarifont\textbf{गैलन}}}
& \multicolumn{1}{p{21mm}}{\centering{\devanagarifont\textbf{गैलन}}}
& \multicolumn{1}{p{16mm}}{\devanagarifont\textbf{सेन्टीमीटर}}
& \multicolumn{1}{p{21mm}}{\devanagarifont\centering{\textbf{सेन्टीग्रेड}}}
& \multicolumn{1}{p{16mm}}{\devanagarifont\centering{\textbf{गैलन}}} & \\
\toprule
}
\begin{supertabular}{p{35mm}*{6}{r}}
\\ \multicolumn{7}{l}{\textbf {3001}}\\\\
\devanagarifont\textbf{टेंक 2} & \multicolumn{6}{l}{SET1}\\
PROD 2& \multicolumn{6}{l}{(4,011 \devanagarifont अधिकतम)}\\
\multicolumn{1}{r}{\devanagarifont\textbf{प्रोडक्ट}} & 2,495.40 & 2,479.66 & 145.55 & 20.53 & 1,313.07 & 19/04/2012 15:00:23 \\
\multicolumn{1}{r}{\textbf{Water}} & 1.79 & & 1.00 & & & \\\\
\devanagarifont\textbf{टेंक 3} & \multicolumn{6}{l}{SET2}\\
PROD 3& \multicolumn{6}{l}{(4,011\devanagarifont अधिकतम)}\\
\multicolumn{1}{r}{\devanagarifont\textbf{प्रोडक्ट}} & 2,593.08 & 2,578.51 & 150.40 & 20.01 & 1,213.86 & 19/04/2012 15:00:23 \\
\multicolumn{1}{r}{\textbf{SET3}} & 3.32 & & 1.51 & & & \\\\
\toprule[2pt]\\
\end{supertabular}
\end{document}