当我在 macOS 13.2 中呈现此文档时:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage{CJKutf8}
\usepackage[scale=0.75]{geometry}
\setlength{\footskip}{149.60005pt}
\name{蒋}{小强}
\phone[mobile]{15682721628}
\email{[email protected]}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
\makecvtitle
\section{Education}
\cventry{2023.05--2023.05}{本科}{中国药科大学}{}{}{}
\end{CJK}
\end{document}
输出的日志信息显示:
11628 bytes written
Latexmk: Summary of warnings from last run of *latex:
=====Latex reported missing or unavailable character(s).
=====See log file for details.
Latexmk: ====List of undefined refs and citations:
Missing character: There is no 蒋 (U+848B) in font [lmsans17-regular]:mapping=tex-text;!
Missing character: There is no 小 (U+5C0F) in font [lmsans17-regular]:mapping=tex-text;!
Missing character: There is no 强 (U+5F3A) in font [lmsans17-regular]:mapping=tex-text;!
Missing character: There is no 本 (U+672C) in font [lmsans10-bold]:mapping=tex-text;!
Missing character: There is no 科 (U+79D1) in font [lmsans10-bold]:mapping=tex-text;!
Missing character: There is no 中 (U+4E2D) in font [lmsans10-oblique]:mapping=tex-text;!
Missing character: There is no 国 (U+56FD) in font [lmsans10-oblique]:mapping=tex-text;!
And 4 more --- see log file.
Latexmk: All targets (modern.pdf) are up-to-date
Latexmk: I have not found a previewer that is already running.
So I will start it for 'modern.pdf'
并且 pdf 没有输出中文。我是不是漏掉了什么?我应该怎么做才能解决这个问题?
答案1
您可以使用ctex
或者xeCJK
打包。
\documentclass[11pt,a4paper,sans]{moderncv}
\usepackage[scheme=plain]{ctex}
% or
% \usepackage{xeCJK}
\moderncvstyle{classic}
\moderncvcolor{blue}
% \usepackage[utf8]{inputenc}
% \usepackage{CJKutf8}
\usepackage[scale=0.75]{geometry}
\setlength{\footskip}{149.60005pt}
\name{蒋}{小强}
\phone[mobile]{15682721628}
\email{[email protected]}
\begin{document}
% \begin{CJK}{UTF8}{gbsn}
\makecvtitle
\section{Education}
\cventry{2023.05--2023.05}{本科}{中国药科大学}{}{}{}
% \end{CJK}
\end{document}