TeXworksErrors with Fonts

Information and discussion about TeXworks, an integrated LaTeX environment for several platforms
Post Reply
Incantator
Posts: 12
Joined: Wed Feb 18, 2015 7:55 am

Errors with Fonts

Post by Incantator »

Hello. I have my TeXworks installed while installing LyX. The problem I'm having is when I'm using Korean letters. I get the error log even though I run it via XeTeX or LaXeTeX:
  • ! Fatal fontspec error: "cannot-use-pdftex"
    !
    ! The fontspec package requires either XeTeX or LuaTeX to function.
    !
    ! You must change your typesetting engine to, e.g., "xelatex" or "lualatex"
    ! instead of plain "latex" or "pdflatex".
    !
    ! See the fontspec documentation for further information.
    !
    ! For immediate help type H <return>.
which is quite confusing since I did run it via XeTeX or XeLaTeX. I also changed my fonts but to no avail. Lyx ran fine with the file so I think this has something to do with the settings in TeXworks but I couldn't find anything more I could do.

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Errors with Fonts

Post by Johannes_B »

There is a drop down menu next to the green compile button, choose xelatex there. This should run XeLaTeX by default, if not something or someone messes up some configuration. Can you check if xelatex is really checked?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Errors with Fonts

Post by Stefan Kottwitz »

Also I think XeLaTeX was possibly not chosen in the drop-down menu. If that's the case, you could check the preferences for typesetting, i.e. if the program for XeLaTeX is really xelatex.

Here's a screenshot of my settings. Note XeLaTeX in the top-left corner, and the settings in the dialog windows. Click on it to see it completely, the bottom part may not be visible in the forum preview.
preferences-xelatex.png
preferences-xelatex.png (87.97 KiB) Viewed 39042 times
Stefan
LaTeX.org admin
Incantator
Posts: 12
Joined: Wed Feb 18, 2015 7:55 am

Errors with Fonts

Post by Incantator »

I definitely chose XeLaTeX for sure. I've tried this and that, and the error log always happens when the saved file is named in Korean. So this time I changed the name into English, but the letters won't come up in the pdf this time.

Here's the simple file I'm dealing with.
Image

You can see that I've changed the font for Korean just to avoid possible additional crash. Same problem persists with other fonts anyway.

Here's my settings.
Image

Funny thing is that I think at first it was xetex not xelatex selected. I've tried plain 'xelatex' or removed the second-line argument but the result was the same.

There's no error log when I saved the file into English(here test.tex) but as I've said before, the letters won't pop up in the pdf. Only English letters are shown. Sorry if my setting has some problems, but I really didn't do anything with it(maybe that's the problem...). I'll learn as I go.

Thanks :D
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Errors with Fonts

Post by Johannes_B »

Korean is a member of the CJK family. Meaning a set of (for a western eye) quite similar alphabets.

LaTeX default font does not include CJK symbols, not even greek.

Please load package fontspec and use one of the fonts you usually use on your computer. It shoudl work. Please have a look at the package documentation on the parameters that you might need to call.


Are you aware of any OpenType font with support for CJK? Maybe also including Cyrillic, Greek, Hebrew ...?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: Errors with Fonts

Post by Stefan Kottwitz »

Also I think, just the font may be missing, as it compiles but doesn't show it up in the output.

Stefan
LaTeX.org admin
Incantator
Posts: 12
Joined: Wed Feb 18, 2015 7:55 am

Errors with Fonts

Post by Incantator »

Thanks! It works wonders! Google sometimes recommended me using kotex/CJK/xeCJK but this works the best.
Johannes_B wrote: Are you aware of any OpenType font with support for CJK? Maybe also including Cyrillic, Greek, Hebrew ...?
Sorry, I'm not really into fonts. But I've searched some information and found this.

http://sourceforge.net/adobe/source-han ... e%20Notes/

OpenType/CJK/Cyrillic/Greek but I think it doesn't support Hebrew, but again really not sure. Most Korean fonts seem to support Cyrillic but in many cases not Greek/Hebrew. Most Korean fonts are not that great though. (sigh)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Errors with Fonts

Post by Johannes_B »

Many many fonts aren't that great if you look closer ;-)
Thanks for the hint on Source Han Sans.

Though there are many people in the CJK segment, information for non CJK people is sparse. Documentation in chinese is legitimate, sure. But i cannot read it, making me unable to give chinese people hints or push them in the right direction. Same for arabic/persian as well. And russian. And greek. And Hebrew.
Knowing one or two symbols of an alphabet is clearly not enough. ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Errors with Fonts

Post by Johannes_B »

Looking at the package files, it seems that the kotex bundle defines some new commands for using different fontfamilies/alphabet/scripts. You can define a font for hanja, one for hangul and so on. Makes it easy to switch mid-document. It also provides xoblivion, which is (seems to be) a korean mod for the memoir class.


Korea, well the south, also has a local TeX User Group.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Incantator
Posts: 12
Joined: Wed Feb 18, 2015 7:55 am

Re: Errors with Fonts

Post by Incantator »

I tried kotex before but couldn't get it worked by reusing commands other people used on the net. I would definitely look into the documentation later.
Post Reply