How to use Pandoc with double-byte characters?
I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf
:
# Test
Testing
But this
# Test
日本語
gives me an error:
! Package inputenc Error: Unicode char 日 (U+65E5)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.62 日
Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF
Using --latex-engine=xelatex
doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.
Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.
pdf fonts markdown pandoc
add a comment |
I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf
:
# Test
Testing
But this
# Test
日本語
gives me an error:
! Package inputenc Error: Unicode char 日 (U+65E5)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.62 日
Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF
Using --latex-engine=xelatex
doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.
Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.
pdf fonts markdown pandoc
add a comment |
I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf
:
# Test
Testing
But this
# Test
日本語
gives me an error:
! Package inputenc Error: Unicode char 日 (U+65E5)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.62 日
Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF
Using --latex-engine=xelatex
doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.
Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.
pdf fonts markdown pandoc
I am trying to convert a Markdown document to PDF. The following works using pandoc test.md -o test.pdf
:
# Test
Testing
But this
# Test
日本語
gives me an error:
! Package inputenc Error: Unicode char 日 (U+65E5)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.62 日
Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF
Using --latex-engine=xelatex
doesn't seem to help. I am using pandoc 1.19.2.1 on Mac OS X.
Using the package markdown-pdf (https://atom.io/packages/markdown-pdf) in Atom also works, but I need to use Pandoc for other reasons.
pdf fonts markdown pandoc
pdf fonts markdown pandoc
edited Dec 15 at 1:20
Kurt Pfeifle
9,18713555
9,18713555
asked Oct 17 '17 at 22:19
ceiling cat
1,61231926
1,61231926
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.
For me, the current Pandoc version 2.5 on macOS works:
- You need to use
--pdf-engine=lualatex
orxelatex
now (no more--latex-engine
). - You need to have installed the
'xecjk'
package in your LaTeX installation. - You need to add
-V CJKmainfont=...
to your command line. - You need to have an appropriate font installed on your system, f.e. "STSong".
So here goes:
pandoc
--pdf-engine=lualatex
-V CJKmainfont="STSong"
-o out.pdf
test.md
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1260036%2fhow-to-use-pandoc-with-double-byte-characters%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.
For me, the current Pandoc version 2.5 on macOS works:
- You need to use
--pdf-engine=lualatex
orxelatex
now (no more--latex-engine
). - You need to have installed the
'xecjk'
package in your LaTeX installation. - You need to add
-V CJKmainfont=...
to your command line. - You need to have an appropriate font installed on your system, f.e. "STSong".
So here goes:
pandoc
--pdf-engine=lualatex
-V CJKmainfont="STSong"
-o out.pdf
test.md
add a comment |
The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.
For me, the current Pandoc version 2.5 on macOS works:
- You need to use
--pdf-engine=lualatex
orxelatex
now (no more--latex-engine
). - You need to have installed the
'xecjk'
package in your LaTeX installation. - You need to add
-V CJKmainfont=...
to your command line. - You need to have an appropriate font installed on your system, f.e. "STSong".
So here goes:
pandoc
--pdf-engine=lualatex
-V CJKmainfont="STSong"
-o out.pdf
test.md
add a comment |
The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.
For me, the current Pandoc version 2.5 on macOS works:
- You need to use
--pdf-engine=lualatex
orxelatex
now (no more--latex-engine
). - You need to have installed the
'xecjk'
package in your LaTeX installation. - You need to add
-V CJKmainfont=...
to your command line. - You need to have an appropriate font installed on your system, f.e. "STSong".
So here goes:
pandoc
--pdf-engine=lualatex
-V CJKmainfont="STSong"
-o out.pdf
test.md
The problem are not so much the double-byte characters, it's more that you need to tell Pandoc it should tell LaTeX to use a CJK font.
For me, the current Pandoc version 2.5 on macOS works:
- You need to use
--pdf-engine=lualatex
orxelatex
now (no more--latex-engine
). - You need to have installed the
'xecjk'
package in your LaTeX installation. - You need to add
-V CJKmainfont=...
to your command line. - You need to have an appropriate font installed on your system, f.e. "STSong".
So here goes:
pandoc
--pdf-engine=lualatex
-V CJKmainfont="STSong"
-o out.pdf
test.md
answered Dec 15 at 1:17
Kurt Pfeifle
9,18713555
9,18713555
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1260036%2fhow-to-use-pandoc-with-double-byte-characters%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown