Since I have to export some CJK characters in LaTeX, I have the following two lines in an .org file :

#+LATEX_HEADER: \usepackage[BoldFont,SlantFont]{xeCJK}
#+LATEX_HEADER: \setCJKmainfont{HanaMinA}

However, this causes a weird display when I use org-toggle-latex-fragment.


You can see that the font name is displayed above each maths expression.


You must install HanaMinA fonts before testing. In Ubuntu:

sudo apt install fonts-hanazono

Here is the minimal not working example I gave above:

#+LATEX_HEADER: \usepackage[BoldFont,SlantFont]{xeCJK}
#+LATEX_HEADER: \setCJKmainfont{HanaMinA}

The Euclid–Euler theorem is a theorem in mathematics that relates perfect
numbers to Mersenne primes. It states that every even perfect number has the
form $2^{p - 1}(2^p - 1)$, where $2^p - 1$ is a prime number. The theorem is named after
Euclid and Leonhard Euler. 

How this problem can be solved?


I found a hint while I'm reading one answer about "How to make a new tex command in org-mode-latex?". In short, everything involved with #+LATEX_HEADER: is taken account by the preview. Therefore, the question turns out to be how can I use packages for export only and not for preview? I have tried to move the two lines to an export latex block, but it doesn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.