0

thank you for reading this question.

I installed miktex as user(not as admin) (since company has strict cyber security standards, I have no other choice like using texlive or install new fonts) and try to run this example

\documentclass{ctexart}

\setCJKmainfont[
AutoFakeBold,AutoFakeSlant
]{SimSun}

\begin{document}

hello world, \textbf{你好}

\end{document}

I ran it by TeXworks, then the console output complains

! Package fontspec Error: The font "SimHei" cannot be found.

It should be able to bypass the error by AutoFakeBold and AutoFakeSlant, since it works in my personal computer.

I look into the console output of TeXworks and the differences are there are lots of

Sorry, but miktex-makemf did not succeed.

and

Sorry, but miktex-maketfm did not succeed.

in the unsuccessful compilation, so I tried the solution of this question but they don't work. When I type updmap.exe alone, the problem remains , and when I use option force or admin the cmd returns

C:\Users\Test Virtual Machine>updmap.exe --force
Incorrect usage: --force: unknown option

C:\Users\Test Virtual Machine>updmap.exe --admin

Sorry, but: option --admin only makes sense for a shared MiKTeX setup
1
  • 2
    SimHei is not SimSun, and updmap has nothing to do with using fonts with fontspec. Try \documentclass[fontset=fandol]{ctexart} Commented Oct 14, 2023 at 13:08

1 Answer 1

1

The answer is originally from @Ulrike Fischer's comment. Thanks to you, Ulrike Fischer.

I tried it and it succeeded. The CTeX Package Documentation(2022/07/14 v2.5.10) wrote that(I translated it into English, and may not very accurate)

If you want to set font at preamble by \ctexset, it's required that set fontset = none when declaring document class

Maybe that's why Ulrike Fischer's way works. Besides, I tried to set fontset = none when declaring document class and simply use

\setCJKmainfont[
AutoFakeBold,AutoFakeSlant
]{SimSun}

Then the console output do not complain

! Package fontspec Error: The font "SimHei" cannot be found.

There are still lots of Sorry, but miktex-makemf did not succeed., I don't know why but these don't hinder the compilation, you can still get the desired output

You must log in to answer this question.

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