emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] LaTeX export in non-English language [9.6-pre (release_9.5.5-1087-g620a96.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]
Date: Mon, 14 Nov 2022 22:25:29 +0000	[thread overview]
Message-ID: <87sfil897q.fsf@posteo.net> (raw)
In-Reply-To: <87y1sefefs.fsf@localhost> (Ihor Radchenko's message of "Mon, 14 Nov 2022 02:38:31 +0000")

Ihor Radchenko writes:

> However, the PDF (see the attached) is erroneous:
> 1. Title "Temp" is written RTL
> 2. Year and date (numbers!) are written RTL
> 3. The python code is written RTL!!
> Just the equation is rendered LTR as expected and the ordinary Hebrew
> text is rendered RTL.

I'd say that's expected behavior. Note that if you declare Hebrew as the
main language, the LaTeX classes (in this case article.cls) will put
whatever is necessary in Hebrew and use the Hebrew (and RTL) typographic
rules where necessary, and that includes the title, the date, and the
various literal strings as the table of contents, figure counters,
captions, etc.

To use Hebrew in another context, it would have to be declared as a
secondary language. The latest versions of Babel allow you to associate
languages to scripts when it comes to non-Latin alphabets (Cyrillic,
Greek, Arabic, etc.), and also to associate fonts. In this way it would
not be necessary to indicate the language explicitly by means of a
\selectlanguage{} or \foreignlanguage{}{}. For example, suppose that my
document has Spanish as its main language, but I also add parts in
Hebrew, which would be automatically recognized by Babel, by putting

#+LaTeX_Header: \usepackage{fontspec}
#+LaTeX_Header: \setmainfont{FreeSerif}
#+LaTeX_Header: \usepackage[AUTO,bidi=basic]{babel}
#+LaTeX_Header: \babelprovide[onchar=ids,import]{hebrew}
#+language: es

(...And curiously I just realized with this example that it is necessary
to fix `org-latex-guess-babel-language', because in the current state it
returns an error if a string other than AUTO is put as argument of
babelprovide. I'll open another thread to submit a patch to fix that).

>> The use of the fontspec package (https://www.ctan.org/pkg/fontspec) is
>> ubiquitous in LuaTeX or XeTeX as long as one wants to have control
>> over fonts and use extended languages and characters. LuaTeX and XeTeX
>> use by default (for debatable historical reasons[1]) a Unicode variant
>> of the Computern Modern font, which has limited language coverage. I
>> remember that it was commented in a previous thread the possibility of
>> offering (for example, through a series of variables), a minimum
>> coverage of fonts to ensure that the documents, at least, are compiled
>> well and are readable. The user could redefine those variables to use
>> their preferred fonts. Or have the option that this part of the
>> preamble is not created, to have full control. I remember that I
>> proposed this, but there were other interesting proposals. For
>> example, Timothy commented on the possibility of using fontsets.
> I hope that it can be implemented some day.
> For now, we should detail important things, like setting suitable font,
> in the manual.

Perhaps a FONTS item could be added in "LaTeX specific export settings"?

Best regards,

Juan Manuel 

  reply	other threads:[~2022-11-14 23:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10  6:11 [BUG] LaTeX export in non-English language [9.6-pre (release_9.5.5-1087-g620a96.dirty @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
2022-11-10 12:40 ` Juan Manuel Macías
2022-11-11  2:04   ` Ihor Radchenko
2022-11-11 15:08     ` Juan Manuel Macías
2022-11-13  4:09       ` Ihor Radchenko
2022-11-13 13:27         ` Juan Manuel Macías
2022-11-14  2:38           ` Ihor Radchenko
2022-11-14 22:25             ` Juan Manuel Macías [this message]
2022-11-15  2:46               ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfil897q.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).