[Tex/LaTex] How to use LaTeX in Anki. I use Windows and Tex Live 2018

ankitexlivetexlive-2018

As I found on Apple.Stackexchange , I downloaded anki add-on. I am Windows user so couldn't do 'which latex' as the step of that page says.

Anki still didn't work and it says

latex 실행 중 오류 발생.

생성된 파일: C:\Users(myname)\AppData\Local\Temp\anki_temp\tmp.tex
latex와 dvipng/dvisvgm을 설치하셨습니까?

Translation

error occured while running latex.

produced file:
C:\Users(myname)\AppData\Local\Temp\anki_temp\tmp.tex
did you install latex and dvipng/dvisvgm?)

The solutions on web/stackexchange are all about MikTex, but I have installed Tex Live 2018. It has all the Packages, like dvipng or latex. It doesn't have same setting page like Miktex. How can this problem be solved?

Best Answer

I think the problem is that you must use XeLaTeX (or pTeX or something else) to output CJK (Chinese, Japanese & Korean) fonts (such as "中文", "실행").

The default setting of anki is LaTeX so you get the error.

You need the add-on "Edit LaTeX build process" to change the build process and its default setting is still LaTeX, so you still get the error.

(I also get this when setting the environment properly.)

(It seems that it only outputs this error when it meets trouble.)

If you must use XeLaTeX to output CJK (Chinese, Japanese & Korean) fonts (or something else needs XeLaTeX), have a look at my answer at How do you get Anki 2.1 to work with XeTeX (+ Edit latex build process)?. (Theoretically, it works for All the CJK. I don't know much about pTeX or something else. I use CTeX package.)

And the second thing is setting the environment properly.


And setting environment properly is quite complex if you are new to TeX, command line and so on.

So if you don't want to trouble yourself just use the default and not use LaTeX in Anki because Anki works well with CJK fonts using HTML.