这是一份大模板中提取的MWE,使用xelatex编译。存在问题是英文段落无法两端对齐,tex的断词功能也失效了。 经试验,注释掉第3,4,5,8,9,12行中任意一行均可解决问题,第4,5行其中一个改为另一种字体也能解决问题。但是我想正文字体和代码字体同时使用罗马字体,那么该如何解决该冲突呢? 另外,这种情况的成因是什么? 附:大模板中的原始设置是`\setmonofont{Courier New}`,其他均相同。我仅仅是根据实际需要改为`\setmonofont{Times New Roman}`。 ```tex \documentclass{book} \usepackage{xeCJK} \defaultfontfeatures{Mapping=tex-text} \setmainfont{Times New Roman} \setmonofont{Times New Roman} \newcommand{\xiaosi}{ \fontsize{12bp}{\baselineskip} \selectfont } \begin{document} \xiaosi In the second and third chapters, this article studies six common management systems, summarizes their similarities and differences in functions, and extracts the two basic roles and three basic functions that a generic management system should have-tourists and customers. Roles, account management functions, data-driven functions, and instruction-driven functions. Among them, the account is the basic base point built into the system; data is the mainstay of information exchange; instructions are the vital source of website operation. Finally, we challenged the uniqueness of the system administrator role subordinate to the customer role. \end{document} ``` ![](https://pics.latexstudio.net/data/images/202003/ebc9f48c3107579.png)

2 回答2

0
问题在 ```tex \defaultfontfeatures{Mapping=tex-text} ``` 我改成 ```tex \defaultfontfeatures{Ligatures=Required} ``` 就没事了。 当然更多细节要阅读 `fontspec`
0
```tex \defaultfontfeatures{Mapping=tex-text} \setmainfont{Times New Roman} \defaultfontfeatures{Mapping=} \setmonofont{Times New Roman} ``` 也可以。 PS:为什么要把非等宽字体 times new roman 设为等宽字族?

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。