Comments (7)
我尝试用
\setCJKmainfont[AutoFakeBold,AutoFakeSlant]{SimSun}
来规避这个问题。但是仍然报错是SimHei not found
伪粗体、伪斜体依然需要加载原本的字体,所以这从来不是一个规避的办法。我不在 windows 下,留给用 windows 的用户提供帮助吧。
from forum.
问题在于,在 \setCJKmainfont
之前,ctex 宏集会预加载 windows 下的字体,而此时已经使用了 SimHei
。
所以,应该使用 \documentclass[fontset=none]{ctexart}
来避免字体的预加载。
from forum.
问题在于,在
\setCJKmainfont
之前,ctex 宏集会预加载 windows 下的字体,而此时已经使用了SimHei
。
@sikouhjw 这不冲突吧,在 preamble 里 \setCJKmainfont
可以重复使用。
例如,在 overleaf 的 linux 环境里,下面「把 FandolSong
两次设为 CJK main font」的例子,不报错。
\documentclass{ctexart}
\setCJKmainfont[AutoFakeBold,AutoFakeSlant]{FandolSong}
\begin{document}
\textbf{你好}
\end{document}
@gingerkitti 只加载 fontspec
,试试能使用 windows 系统自带的其他 otf 字体(不论中文西文)吗,MiKTeX 自带的 otf 字体(不论中文西文)呢?
from forum.
@sikouhjw 这不冲突吧,在 preamble 里
\setCJKmainfont
可以重复使用。例如,在 overleaf 的 linux 环境里,下面「把
FandolSong
两次设为 CJK main font」的例子,不报错。
我理解他的问题是「miktex 找不到 SimHei」,那问题就在于 ctex 的内部字体加载。
\setCJKmainfont
可以重复加载,但是后面的命令不会覆盖前面的命令,也就是说第一个 \setCJKmainfont
如果找不到字体,就会报错,而不会被第二个覆盖。
\documentclass{ctexart}
\setCJKmainfont{SimSun}[BoldFont=aaaa.otf]
\setCJKmainfont{SimSun}
\begin{document}
test
\end{document}
所以解决他的办法:fontset=fandol
或者 =none
再自己配字体。
from forum.
@sikouhjw 啊,是我把 SimHei
和 SimSun
看成一个字体名了。现在我明白「用伪粗规避」和你提的 fontset=none
建议的意思了。抱歉
更新:想起我自己之前在 GitHub Actions 的 windows hoster 上跑 ctex 也遇到过这个问题,
SimHei is part of the Chinese (Simplified) Supplemental Fonts in Win 10. Thus all we need here is to install those supplemental fonts.
Originally posted by @muzimuzhi in muzimuzhi/hello-github-actions#10 (comment)
这下我也理解
由于在公司电脑,权限很低,无法自行安装软件以及连接外网,因此也不能下载字体
的意思了。
from forum.
非常感谢各位的帮忙。我后来在StackExchange也提了个类似的问题,
SimHei is not SimSun, and updmap has nothing to do with using fonts with fontspec. Try \documentclass[fontset=fandol]{ctexart} – Ulrike Fischer 19 hours ago
我照着评论的代码试了一下,居然成功了。
我又查了一下《CTEX 宏集手册》(2022/07/14 v2.5.10),发现第8页(4.3节)有这样一句话
注意:如果希望使用 \ctexset 在导言区指定字库,则需要先在宏包/文档类选项中指定
fontset = none(这会禁用 CTEX 宏集的操作系统检测功能和自动设定字库功能)。
我猜测可能跟这个有关系。之前我看手册里fontset后面没有“五角星”也没有“*”,也就没有管太多了。
我试了一下,如果说先这样设置\documentclass[fontset=none]{ctexart}
,后面不使用fandol,直接用伪粗体、伪斜体也是可以的,最终也可以输出伪粗伪斜。
@muzimuzhi 我试了一下应该是可以的
只加载 fontspec,试试能使用 windows 系统自带的其他 otf 字体(不论中文西文)吗,MiKTeX 自带的 otf 字体(不论中文西文)呢?
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Microsoft YaHei}
\begin{document}
\textbf{你好}
\end{document}
一些可能的题外话
虽然编译过程中还是会有很多
Sorry, but miktex-makemf did not succeed.
,但是并不影响结果,我也就没有多管它了(主要是超出了自己的能力范围),如果各位对于这个内容有什么见解还请多多指教(我也不知道这需不需要开新issue)
本来想睡一觉再想想怎么关掉这个issue,但是没想到各位这么热心,一觉功夫就有这么多评论,非常感谢各位的帮忙。
from forum.
虽然编译过程中还是会有很多
Sorry, but miktex-makemf did not succeed.
,但是并不影响结果
可以发第一例出来看看。
from forum.
Related Issues (20)
- error
- 超页面问题 HOT 2
- 如何让“摘要”出现在目录中,但不要显示后面的“......页码” HOT 10
- 应用需求:识别传递的参数中 `{}` 的数量 HOT 6
- 空白页控制问题 HOT 10
- 命令可选参数键值的值为 LaTeX3 的 cs 的可行性 HOT 3
- 关于 `ntheorem` 和 `amsthm` 中的 `\qedhere` 优化问题 HOT 5
- 给特殊符号设置xeCJKsetcharclass,并打开CJKmath,特殊符号仍不能直接用于数学模式 HOT 9
- `\keys_define:nn` 中 `.initial:n` 失效的问题 HOT 15
- `xampl.bib` 无法用于 `gbt7714` 包和 `natbib` 的 `authoryear` 模式吗? HOT 8
- 安装ctex时报错 HOT 1
- 如何在每一章的指定位置插入边注 HOT 8
- \newtheorem和amsthm冲突问题 HOT 7
- 如何优雅的让行内公式换行? HOT 4
- datetime2宏包如何在使用xelatex编译时取当前详细时间(秒数+时区)并转换为东八区 HOT 13
- 采用 listings 宏包排代码,代码里的汉字之间有空格 HOT 2
- Ctex如何设置页边距,另外,类似论文中的项目资助的脚注 如何实现? HOT 5
- 我想把公式编号连带编号两边的括号 的字体 都设置为Times New Roman,但 左边那个括号的字体就是改不了 HOT 6
- 求救帖,被一个英文文章翻译任务逼疯了,求大佬协助完成一个模板,我完成了大概有6成,剩下的搞不定了 HOT 6
- 关于ulem包与xeCJKfntef包连用hyperref包进行超链接下划线的疑惑 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forum.