0

log file I probably should spend more time getting to read the documentation but I must admit it is too advanced and I have a hard time comprehending what its tring to say.I am on a deadline and need some urgent help. What I want to achieve is to change the title style(font?) to \lishu as described in ctex package page 8

This is my code

\documentclass[fontset=none]{article}
\usepackage{ctex}
\ctexset{fontset=macnew}
\begin{document}
\lishu
\title{颠覆传统教学模式,打造中国双师品牌}
\date{}
\maketitle
\end{document}

But it results in an error saying "undefined control sequence." Please tell me what went wrong here.This is the cnosole feedback

Edit: new log file after updating it to texlive 2020enter link description here edit2:uploaded the result of xetex compile. the link is the same.

4
  • I'm very upset with CTeX that advertises “fontset=macnew”, which should work in macOS, if I interpret correctly the name. But it doesn't. If I use fontset=windows, then I get an error because simli.ttf is not found.
    – egreg
    Jun 1 '20 at 9:42
  • I don't have a mac but based on the code the command should be defined. Is your ctex/tex system up-to-date? Can you show the log-file? Jun 1 '20 at 9:44
  • The command \lishu is not defined with fontset=macnew until ctex v2.5. From the attached log file, you are using ctex v2.4.15. Prior to v2.5, \lishu is defined with fontset=windows|founder only. See related issues (in Chinese): github.com/CTeX-org/ctex-kit/issues/360 and github.com/CTeX-org/ctex-kit/issues/412 Jun 1 '20 at 12:22
  • Use xelatex, not pdflatex
    – egreg
    Jun 1 '20 at 14:01
1

I can ensure you I'm on a Mac, running the latest version of macOS.

If I try your code, I get

! Critical Package ctex Error: CTeX fontset `mac' is unavailable in current
(ctex)                         mode.

which is quite strange. If I change fontset=windows, that error disappears, but pdftex complains that simli.ttf is not found.

So I downloaded simli.ttf from https://github.com/dudongtai2002/Font/blob/master/Fonts/SIMLI.TTF and retried.

\documentclass[fontset=windows]{article}
\usepackage{ctex}
\begin{document}
\title{\lishu 这是一个标题}
\date{}
\maketitle

这是一个标题

\end{document}

I used \lishu only inside the title, which is probably what you really want.


Now that you added the information that you're running XeLaTeX, the code above runs also with fontset=macnew (no download necessary). Also your code runs with no issue on TeX Live 2020.

I get the error is with TeX Live 2019, for the simple reason that \lishu is only available in ctex-fontset-macnew.def version 2.5.1 or later. See

http://tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-macnew.def?r1=51262&r2=54976

6
  • Would you be kind enough to tell me how to check my texlive version. I clicked the texlive utility page and it says Version 1.35
    – jxhyc
    Jun 1 '20 at 12:18
  • @jxhyc Install the new MacTeX. You can see that the log file lists files as belonging to the tree /usr/local/texlive/2019
    – egreg
    Jun 1 '20 at 12:22
  • Thanks! I will choose the answer after I test your recommendation. It is a very large download:(
    – jxhyc
    Jun 1 '20 at 12:29
  • sorry doesn't work. :(
    – jxhyc
    Jun 1 '20 at 13:54
  • @jxhyc Which engine do you want to use? The first log shows xelatex, but the second log shows pdflatex. Jun 1 '20 at 14:00
0
  • With fontset=macnew, \lishu is not defined until ctex v2.5.
  • To install ctex v2.5, TeX Live 2020 is required, but from the attached log you are using TeX Live 2019.
  • Hence you can either install TeX Live 2020, or manually define \lishu as following:
\NewDocumentCommand \lishu {} {\CJKfamily{zhli}}
\setCJKfamilyfont {zhli} {Baoli SC}

On macOS, Baoli SC is one of "available for download" fonts. Hence to use it for the first time, a window will pop up to ask for downloading. Just click "Download", and recompile tex file when the downloading is finished.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.