read so few answers here but none is working. Actually, I cant use xelatex or LuaLaTex here, devnagri package is also not working. I want something as given in my pdf.
Regards
-
you could generate the hindi parts of each of those lines as two separate pdf with xelatex (or anything) and include them into pdftex with \includegraphics. If you use pdf they will be in the final pdf as text with fonts not an image.– David CarlisleSep 17, 2021 at 11:13
-
@DavidCarlisle Thanks for the reply, could you please explain it with code, really appreciate it. I mean how to use this xelatex???– KRISHNA CHAUHANSep 18, 2021 at 13:35
-
but what do you mean in the question where you say "I can't use xelatex or lualatex" do you mean you don't have them or you have them but don't want to use them for some reason?– David CarlisleSep 18, 2021 at 13:51
-
Sir, I just saw this in tools, I don't know know how to use it here. Like you said use them to generate each line separately and then use the generated pdf as pictures here in my article??? Am I right sir? How to build the pdf for each line in Hindi font ?? Actually in each line there is also English text. If it is possible please give one example code.– KRISHNA CHAUHANSep 19, 2021 at 14:05
1 Answer
If you use xelatex or lualatex you can specify any system font that covers English and Hindi and then simply:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Nirmala UI}
\begin{document}
\begin{enumerate}
\item नमस्ते दुनिया (Hello world)
\end{enumerate}
\end{document}
If for some reason your main document has to be typeset with pdflatex (eg a requirement of a journal submission) you can make a PDF of the Hindi phrase eg
could be made using
\documentclass{standalone}
\usepackage{fontspec}
\setmainfont{Nirmala UI}
\begin{document}
नमस्ते दुनिया
\end{document}
You can then include this into a PDF document
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{enumerate}
\item \raisebox{-3pt}{\includegraphics{hindi-hello}} (Hello world)
\end{enumerate}
\end{document}
-
Thank you so much David sir, for your kind reply! I got you completely now,I am using it for my article only. But sir there are some errors in hindi fonts can I resolve them some how. Like in your case too the second hindi word is not correct despite you type it correct in standalone class. pLease help. Regards Sep 19, 2021 at 17:51
-
@KRISHNACHAUHAN post a new question with an example and explain what is wrong with the rendering (remember many of us here can not read the script or tell if it is right or wrong so you need to say very clearly what is wrong and provide a complete small document as text as in this answer) the handling of characters depends almost completely on the font I picked Nirmala UI as it appeared to work to me but it may not be the best font for Hindi. If you have a font that works well in your browser it in Word it should work in xelatex Sep 19, 2021 at 18:50