After a longer CJK immersion ... On Sat, 8 Nov 2025 at 21:37, Ihor Radchenko <[email protected]> wrote:
> Pedro Andres Aranda Gutierrez <[email protected]> writes: > > >> You also removed xeCJK. Why? > >> > > Woops, I went too far... > > + ;; If the CJK font families have been included > + ;; Check for polyglossia and/or babel and warn? > + ;; Or advise for these packages to be added to > `org-latex-package-alist' ?? > + (when (and cjk-packages (equal compiler "xelatex")) > + (message "Adding the CJK packages") > + (goto-char (point-min)) > + (forward-line 2) > + (insert "\\usepackage[CJKspace]{xeCJK}\n")) > > From the forum replies, it looks like > \usepackage{ctex} is strictly better - it loads xeCJK foe xelatex, and > also right packages for lualatex and even pdflatex. > OK further experiments I have done show that if there is a \setCJK...font{} declaration (for example from a .dir-locals.el), you need xeCJK. Therefore we will keep the code as is. If we do not add this package in the presence of explicit CJK fonts, we don't produce compilable documents. ctex is (IMHO) orthogonal to this. Also, maybe we should load these conditional of #+language? Say, by > adding to `org-latex-language-alist'. Then, we might be able to > generalize similar specialized packages to more languages. > Could we keep that as a FIXME for a refinement and discuss it further in the future? >> And I am getting > >> ⛔ Warning (ox-latex): PDF file produced with warnings: [Missing > >> character(s): please load an appropriate font with the fontspec package] > >> Despite everything being rendered just fine. > > ... > > The warning, however, is triggered by: > > > > = Missing character: There is no (U+200B) in font > > [lmroman10-regular]:mapping=t > > = ex-text;! > > = Missing character: There is no (U+200B) in font > > [lmroman10-regular]:mapping=t > > = ex-text;! > > > > The character it is complaining about is a zero width space > > <https://unicode-explorer.com/c/200B>. > > I would need to investigate where this character comes from. > > But it has nothing to do with adding or not xeCJK. > > It is right from > 包时,org当中的加粗转为中间文件*tex*时是 - 200B*tex*200B escaping > emphasis markup, as full with spaces are not used in Chinese writing. And it appears when the default font is lmroman. Setting the main font to 'Noto Serif' got rid of the message. The other option is the LATEX_HEADER in your proposal plus #+LATEX: \ctexset{space=auto} which I got from https://emacs-china.org/t/help-implementing-better-out-of-the-box-xelatex-export-in-org/30405/6 (thanks LuciusChen for this!) With that, using lmroman will not trigger the warning and it will not interfere with fonts that define the 200B character. Which begs the question whether a solution with an extra document class for this could not be the cleanest answer in the future. (But leave it as FFS, please) > -- > Ihor Radchenko // yantar92, > Org mode maintainer, > Learn more about Org mode at <https://orgmode.org/>. > Support Org development at <https://liberapay.com/org-mode>, > or support my work at <https://liberapay.com/yantar92> > PS, I'm attaching the test document to make it easier to add things w/o going through potential cut&paste quirks Best, /PA -- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler "Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE! Year 1 of the New Koprocracy
test-ctex.org
Description: Binary data
