Background
I'm preparing a series of simple document templates on my personal site. To allow readers who have never used
pandoc to see the visual output, I added some
<object class="responsive-embed"> to allow visual output display of the
PDF,
DOCX and
HTML from
Visual Studio Code plugin vscode-pandoc.
Problem
Thanks to pandoc does not recognize Chinese characters, I know that setting CJKmainfont allows
pandoc to render CJK characters. However, it breaks the existing greek alphabets in the
output PDF.

Click the above screenshot to view
my page.
Method
The above sample documents are produced on another device. To let you see the undesirable visual output, I've prepared two MWEs.
| group | target | control |
|---|---|---|
| Markdown source file name | cjk_article.md |
article.md |
| Greek alphabets in file content | ✓ | ✓ |
| CJK characters in file content | ✓ | ✗ |
mainfont |
Times New Roman |
Times New Roman |
CJKmainfont |
Noto Sans CJK SC |
absent |
| CJK characters rendered | ✓ | ✗ |
| Greek alphabet spacing | ✗ | ✓ |
I've chosen standalone instead of article for documentclass in order to produce PDF files that will be converted to PNG with pdftoppm, so that the steps and output are reproducible.
$ diff -u {,cjk_}article.md
--- article.md 2023-04-08 12:59:46.415084100 +0200
+++ cjk_article.md 2023-04-08 13:02:34.029625600 +0200
@@ -1,6 +1,7 @@
---
documentclass: standalone
mainfont: Times New Roman
+CJKmainfont: Noto Sans CJK SC
---
-Section Ωαβ. Lôrém ipsùm dolor sit amet.
+Section Ωαβ. Lôrém 繁體 ipsùm 简体 dolor こんにちは sit 조선글 amet.
During the compilation, I hadn't installed the dependencies, so MikTeX's on-the-fly installation was invoked for the following pakcages:
- xeCJK

- luatexja-fontspec.sty

- everyhook.sty

- svn-prov.sty

- UniJIS2004-UTF32-H

- HaranoAjiMincho-Regular.otf

I clicked "Install" so as to install the missing packages. The system complained about the missing font "NotoSansCJKSC", which I immediately installed.
$ find -path './*article.md' -print0 | \
> while IFS= read -r -d '' file; do
> pandoc --pdf-engine=lualatex $file -o ${file%md}pdf
> done
Error producing PDF.
! Package fontspec Error: The font "NotoSansCJKSC" cannot be found.
For immediate help type H <return>.
...
l.27 \fi


In my MWE, I'm using Noto Sans CJK SC instead of Noto Sans CJK TC in an answer for the linked TeX.SE question due to the name of the highlighted LaTeX package in the above screenshot.
After that, I repeated the above command, and the error message was gone. To produce observable results (to be included in the next section), I used pdftoppm (shipped with my MikTeX's installation).
$ !find
find -path './*article.md' -print0 | while IFS= read -r -d '' file; do pandoc --
pdf-engine=lualatex $file -o ${file%md}pdf; done
$ find -name '*article.pdf' -exec sh -c \
> 'f="{}"; pdftoppm -png -r 450 "$f" "${f%.*}" 2>/dev/null' \;
$ which pdftoppm
/c/Users/sere/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdftoppm
Remarks: thanks to this helpful one-liner for {} placeholder manipulation on Unix.SE. I suppressed the following warning message with 2>/dev/null.
MiKTeX requires Windows 10 (or greater): https://miktex.org/announcement/legacy-windows-deprecation
Results
Here're the output PNG for
To view pdftoppm -png's output in their original dimensions, I suggest clicking on these images to view their in a separate tab.
Question
How can I get the correct spacing between the greek alphabets (illustrated in the screenshot for the control group's output) with CJK characters (shown in the screenshot for the target group's output)?




