5

Previously I complied my file using Xelatex in window 7 using Miktex and it works fine. Now I install TexLive 2009 in Ubuntu 12.04 and compile the same file again, but the following error occurs after compilation (xelatex myfile.tex):

kpathsea: Running mktexmf SimSun
! I can't find file `SimSun'.
<*> ...:=ljfour; mag:=1; nonstopmode; input SimSun

Please type another input file name
! Emergency stop.
<*> ...:=ljfour; mag:=1; nonstopmode; input SimSun

Transcript written on mfput.log.
grep: SimSun.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input SimSun' failed to make SimSun.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font \zf@basefont=SimSun at 10.0pt not loadable: Metric (TFM) file or install
ed font not found.
<to be read again> 
               \let 
l.30 \setCJKmainfont{SimSun}
Set Chinese font, complusory
? 

Is there any way I can use the font available for MikTex in Window 7 from Ubuntu? or any other way to deal with it?

MWE:

\documentclass[a4paper]{article}

\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\xeCJKsetup{PunctStyle=kaiming,CJKspace=true,CheckSingle=true} 

\begin{document}
宋體中文字
\end{document}
14
  • You can copy any font file that you have access to to your $HOME/.fonts directory. XeLaTeX will find any fonts in there.
    – guillem
    Commented Mar 18, 2014 at 6:27
  • Sorry to ask, but where can I access my font file in Window and copy to the $HOME/.fonts directory? And which directory should I put in the Ubuntu? I am still new to Ubuntu.
    – bingung
    Commented Mar 18, 2014 at 7:09
  • If you want them system wide you can put them in /usr/share/fonts. I'm not sure what command you have to run afterwards. Perhaps fc-cache -fsv? Note that in the future if you want everything taken care of automatically and are installing from scratch, you can run sudo ./install-tl-ubuntu --usr-fonts-dir <DIR> where <DIR> contains the files simhei.ttf and simsun.ttc. For more information, see github.com/scottkosty/install-tl-ubuntu
    – scottkosty
    Commented Mar 18, 2014 at 7:46
  • I downloaded the font from fontpalace.com/font-download/SimSun, installed it in a usual way (alternatively, I could use a working directory with your MWE TeX file included without system font installation), swapped a pair of letters, docuemnt -> document, and your example has been typeset successfully with XeLaTeX (Windows XP, TeXLive 2013).
    – Malipivo
    Commented Mar 18, 2014 at 8:17
  • Windows: search for file SimSun.ttf with the windows explorer (is this how it is called?). Or, alternatively, download the file from the internet as Malipivo says. The $HOME/.fonts part refers to the Ubuntu installation. In Ubuntu, open the folder explorer, go to your home folder, and on the View menu check the Show hidden files option. Then you can acces the .fonts directory and copy SimSun.ttf here.
    – guillem
    Commented Mar 18, 2014 at 9:01

1 Answer 1

0

The problem was that filenames are case sensitive in (L)ubuntu, but they are not in Windows (XP). When moving from Windows to Ubuntu, this problem arised.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .