emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sanskrit/Devanagari fonts not exported to org-pdf output


From: Zenny
Subject: Re: Sanskrit/Devanagari fonts not exported to org-pdf output
Date: Thu, 21 Sep 2023 19:53:02 +0200

Hi Juan,

On Thu, Sep 21, 2023 at 5:33 PM Juan Manuel Macías <maciaschain@posteo.net> wrote:
Hi, Zenny,

Zenny writes:

> Where does this preamble goes to? Any example?

As in your example, using latex_header keywords (replacing the
polyglossia code with the babel code):

#+LaTeX_Header: \usepackage[english]{babel}
#+LaTeX_Header: \usepackage{fontspec}
#+LaTeX_Header: \newfontscript{Devanagari}{deva}
#+LaTeX_Header: \babelprovide[_onchar_=ids fonts]{sanskrit-devanagari}
#+LaTeX_Header: \babelfont[sanskrit-devanagari]{rm}{Noto Sans Devanagari}

> Yet I am a bit confused because the Sanskrit/Devanagari words are used
> not in a whole block, but in between English sentences, eg.:

With Polyglossia and babel it is necessary to enter a command that
changes the language. In the case of polyglossia, if you don't
explicitly switch to Sanskrit the font you declared for Sanskrit is not
used, and LaTeX still thinks the text is English. Polyglossia uses some
commands similar to those of babel (\selectlanguage, for long texts) and
other native ones, such as \text<lang>{text}, where <lang> is the
secondary language. In babel you have the command
\foreignlanguage{<lang>}{text}. For example (using polyglossia):

Old _expression_ goes like \textsanskrit{स्वस्ति सत्यं वचति}

Of course, in org you would have to use some trick, like defining some
macro (since org does not have, at the moment[1], a native language
switching method):

#+macro: sanskrit @@latex:\textsanskrit{@@$1@@latex:}@@

Old _expression_ goes like {{{sanskrit(स्वस्ति सत्यं वचति)}}}

With LuaLaTeX, babel can associate a non latin language to a font
without requiring an explicit language switch:

#+LaTeX_Header: \usepackage[english]{babel}
#+LaTeX_Header: \usepackage{fontspec}
#+LaTeX_Header: \newfontscript{Devanagari}{deva}
#+LaTeX_Header: \babelprovide[_onchar_=ids fonts]{sanskrit-devanagari}
#+LaTeX_Header: \babelfont[sanskrit-devanagari]{rm}{Noto Sans Devanagari}

With above code for LuaLaTeX, I have also appended:

#+LATEX_COMPILER: lualatex

even after specifying the LaTeX compiler to lualatex a report that says, the compiler seems to use pdflatex:

! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec)                      LuaTeX.
(fontspec)                      
(fontspec)                      You must change your typesetting engine to,
(fontspec)                      e.g., "xelatex" or "lualatex" instead of
(fontspec)                      "latex" or "pdflatex".

Type <return> to continue.
 ...                                              
                                                 
l.45 \msg_fatal:nn {fontspec} {cannot-use-pdftex}
 
Entire texlive packages are installed and lualatex binary is at:

$ which lualatex
/opt/texlive/2023/bin/x86_64-linux/lualatex

Thanks for your attention!
/z


Old _expression_ goes like स्वस्ति सत्यं वचति

[1] You might be interested in this thread: https://list.orgmode.org/878r9t7x7y.fsf@posteo.net/


--
Cheers,
/z

-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.
CONFIDENTIALITY NOTICE AND DISCLAIMER: Access to this e-mail and its contents by anyone other than the intended recipient is unauthorized as it contains privileged and confidential information, and is subject to legal privilege. Please do not re/distribute it.  If you are not the intended recipient (or responsible for delivery of the message to such person), you may not use, copy, distribute or deliver the email and part of its contents to anyone this message (or any part of its contents or take any action in connection to it. In such case, you should destroy this message, and notify the sender immediately. If you have received this email in error, please notify the sender or your sysadmin immediately by e-mail or telephone, and delete the e-mail from any computer. If you or your employer does not consent to internet e-mail messages of this kind, please notify the sender immediately. All reasonable precautions have been taken to ensure no viruses are present in this e-mail and attachments included. As the sender  cannot accept responsibility for any loss or damage arising from the use of this e-mail or attachments it is recommended that you are responsible to follow your virus checking procedures prior to use. The views, opinions, conclusions and other informations expressed in this electronic mail are not given or endorsed by any company including the network providers unless otherwise indicated by an authorized representative independent of this message.
-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]