emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Pedro A. Aranda" <paaguti@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: "Juan Manuel Macías" <maciaschain@posteo.net>,
	"Org Mode List" <emacs-orgmode@gnu.org>
Subject: Re: New try at multi-lingual export to latex/pdf using pdflatex and babel
Date: Thu, 25 Jan 2024 17:54:49 +0100	[thread overview]
Message-ID: <8126b66a-f598-4069-bc5f-f11dc3c2365f@gmail.com> (raw)
In-Reply-To: <87cytpledm.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Hi

I've been reading a bit. What I propose is an alternative way to handle 
all the tricky parts of font and character handling with fontspec in 
lualatex and xetex. This package restricts the use of the ams* packages 
to pdflatex, because fontenc handles that internally and produces 
package collisions.

Attached is the final version of the patch.

Best, /PA

On 25/1/24 14:41, Ihor Radchenko wrote:
> "Pedro A. Aranda" <paaguti@gmail.com> writes:
>
>> As stated, this was only a PoC. If you find it useful, I would give it a
>> go in the free window.
> I understand.
> My question is to clarify how useful it is.
> Because I am not deeply familiar with how fontenc works for non-English
> languages, it is hard to judge how useful it will be in practice.
>
>> ... I'm also playing with
>> org-latex-default-packages-alist, refining it to use fontspec in
>> lualatex and xetex and restricting inputenc and fontenc to pdflatex only.
> Aren't inputenc and fontenc already restricted to pdflatex only?
>

[-- Attachment #2: 0001-Refine-font-management-for-lualatex-and-xetex.patch --]
[-- Type: text/x-patch, Size: 1673 bytes --]

From 481a35750fcb4098fe469efc80623c5c289b6f9f Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" <paaguti@gmail.com>
Date: Thu, 25 Jan 2024 17:47:15 +0100
Subject: [PATCH] Refine font management for lualatex and xetex

---
 lisp/org.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

 lisp/org.el: switch to fontspec for character and font management
   in lualatex and xetex. This implies explicitly importing the
   ams* packages is only needed with pdflatex.

diff --git a/lisp/org.el b/lisp/org.el
index cf9abafac..f50531e7e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3402,15 +3402,16 @@ header, or they will be appended."
 	  (default-value var)))

 (defcustom org-latex-default-packages-alist
-  '(("AUTO" "inputenc"  t ("pdflatex"))
+  '((""     "fontspec"  t ("lualatex" "xetex"))
+    ("AUTO" "inputenc"  t ("pdflatex"))
     ("T1"   "fontenc"   t ("pdflatex"))
     (""     "graphicx"  t)
     (""     "longtable" nil)
     (""     "wrapfig"   nil)
     (""     "rotating"  nil)
     ("normalem" "ulem"  t)
-    (""     "amsmath"   t)
-    (""     "amssymb"   t)
+    (""     "amsmath"   t ("pdflatex"))
+    (""     "amssymb"   t ("pdflatex"))
     (""     "capt-of"   nil)
     (""     "hyperref"  nil))
   "Alist of default packages to be inserted in the header.
@@ -3421,6 +3422,7 @@ incompatibility with another package you are using.
 The packages in this list are needed by one part or another of
 Org mode to function properly:

+- fontspec: for font ans character selection in lualatex and xetex
 - inputenc, fontenc:  for basic font and character selection
 - graphicx: for including images
 - longtable: For multipage tables
--
2.34.1

  reply	other threads:[~2024-01-25 16:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21  8:44 New try at multi-lingual export to latex/pdf using pdflatex and babel Pedro Andres Aranda Gutierrez
2024-01-21 13:02 ` Ihor Radchenko
2024-01-21 17:11   ` Pedro Andres Aranda Gutierrez
2024-01-21 17:47     ` Juan Manuel Macías
2024-01-22  6:30       ` Pedro Andres Aranda Gutierrez
2024-01-22  6:47         ` Pedro Andres Aranda Gutierrez
2024-01-22 13:11           ` Juan Manuel Macías
2024-01-22 12:10       ` Ihor Radchenko
2024-01-22 13:40         ` Juan Manuel Macías
2024-01-23  7:41           ` Pedro Andres Aranda Gutierrez
2024-01-24 16:25             ` Ihor Radchenko
2024-01-25  7:25               ` Pedro A. Aranda
2024-01-25 13:41                 ` Ihor Radchenko
2024-01-25 16:54                   ` Pedro A. Aranda [this message]
2024-01-26 13:28                     ` Ihor Radchenko
2024-01-26 17:49                       ` Pedro Andres Aranda Gutierrez
2024-01-28 13:47                         ` Ihor Radchenko
2024-01-28 17:02                           ` Pedro Andres Aranda Gutierrez
2024-01-29 13:28                             ` Ihor Radchenko
2024-01-29 14:34                               ` Pedro Andres Aranda Gutierrez
2024-01-29 14:51                                 ` Ihor Radchenko
2024-01-29 14:51                                   ` Pedro Andres Aranda Gutierrez
2024-02-09 23:10     ` Ihor Radchenko
2024-02-10  6:13       ` Pedro Andres Aranda Gutierrez
2024-02-10 14:39         ` Ihor Radchenko
2024-02-11  6:22           ` Pedro Andres Aranda Gutierrez
2024-02-11 11:04             ` Juan Manuel Macías
2024-04-15 12:21               ` Ihor Radchenko
2024-04-22 20:06                 ` 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=8126b66a-f598-4069-bc5f-f11dc3c2365f@gmail.com \
    --to=paaguti@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=maciaschain@posteo.net \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).