0

I get the following error when exporting to pdf directly in org-mode (C-c C-e l o), but conversion using pandoc with the exported tex document (C-c C-e l l) works fine. What went wrong?

Latex Settings within Org document:

#+LATEX_compiler: xelatex
#+LATEX_HEADER: \input{/Users/satibodhi/Creation/notes/latex/header.tex}

header.tex:

%%% HEADER TEMPLATE %%%
% For Chinese academic paper typesetting. (General purposes.)
% Replacement of 'header-includes: ' yaml setting for Pandoc-markdown because forward slashes '\' get escaped when parsed to Tex.

\usepackage{xeCJK}
%\usepackage[heading]{CJK}
\usepackage{zhnumber} % package for Chinese formatting of date time (use /zhtoday)
%\usepackage[yyyymmdd]{datetime} % set date time to numeric

% Set default indentation

\setlength\parindent{12pt}

% Set Paper Size, Page Layout (another variable is 'bindingoffset')
\usepackage[margin = 1.5in, paper = a4paper, inner = 2.5cm,
outer = 2.5cm, top = 3cm, bottom = 2.5cm]{geometry}

% Keep paragraph indentation while having a line break in between paragraphs.
\edef\restoreparindent{\parindent=\the\parindent\relax}
\usepackage{parskip}
\restoreparindent

% Indent first paragraph.
\usepackage{indentfirst}

\usepackage{titlesec}
\usepackage{titling}
\usepackage{fontspec} % packages for title and section-heading font setting.

% Set Font.
\setsansfont{Arial}
\setmainfont{Calibri} % Set serifed font to Calibri. Originally set to 'Times New Roman', but it cannot display certain characters such as ①②③.
\setCJKmainfont{MingLiU}
\setCJKsansfont{Kaiti TC} % Set Chinese font. NOTE: Remember to append CJK before of the font class. CJK HAS to be there for the font to show.

\titleformat*{\section}{\fontsize{16}{18}\bfseries\sffamily}
\titleformat*{\subsection}{\fontsize{14}{16}\bfseries\sffamily}
\titleformat*{\subsubsection}{\fontsize{12}{14}\bfseries\sffamily} % Set formats for each heading level. 'sffamily' will point to the sans-serif font. In this case, 「楷體」.
\renewcommand{\maketitlehooka}{\sffamily} % Set title font.

% Set quotation font.
\usepackage{etoolbox}
\newCJKfontfamily\quotefont{Kaiti TC}
\AtBeginEnvironment{quote}{\quotefont\normalsize}

% Tweak default settings.
\renewcommand{\baselinestretch}{1.2} % Set line width.
\renewcommand{\contentsname}{目次} % Translate content page title to Chinese. (Could possibly be done automatically with '\usepackage[heading]{CJK}'. TODO experiment. )

Org PDF LaTex Output:

This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(.//Key_issues_Relations_management.tex
LaTeX2e <2018-12-01>
(/usr/local/texlive/2019basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
...

Package fontspec Warning: Font "MingLiU" does not contain requested Script
(fontspec)                "CJK".

...

(.//Key_issues_Relations_management.out)

Package hyperref Warning: Rerun to get /PageLabels entry.

*geometry* driver: auto-detecting
*geometry* detected driver: xetex

Package fontspec Warning: Font "Kaiti TC" does not contain requested Script
(fontspec)                "CJK".

(/usr/local/texlive/2019basic/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2019basic/texmf-dist/tex/latex/amsfonts/umsb.fd)

LaTeX Font Warning: Font shape `TU/KaitiTC(0)/bx/n' undefined
(Font)              using `TU/KaitiTC(0)/m/n' instead on input line 32.

(.//Key_issues_Relations_management.toc)

LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <16> not available
(Font)              size <17.28> substituted on input line 35.


LaTeX Font Warning: Font shape `OMS/cmsy/m/n' in size <16> not available
(Font)              size <17.28> substituted on input line 35.


LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <16> not available
(Font)              size <17.28> substituted on input line 35.


Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `\@ifnextchar' on input line 35.

! TeX capacity exceeded, sorry [input stack size=5000].
\reserved@a ->\def \reserved@a 
                               *{\ttl@assign@i {\@tempskipb }}\reserved@a 
l.35 ...first among equals,即同等地位中間的佼佼者。這裡採取意譯策略。}}

No pages of output.
Transcript written on .//Key_issues_Relations_management.log.

Pandoc:

This command generated the required pdf successfully.

pandoc -H ~/Creation/notes/latex/header.tex Key_issues_Relations_management.tex --pdf-engine=xelatex -o key_issues.pdf

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.