Comments (2)
在 \annotate
定义末尾添加允许换行的位置 \linebreak[0]
,似乎有用。
- 辅助和样式性修改
- 我用
\usepackage[pass, showframe]{geometry}
绘制了 text area 的边框,方便看到「超出页面」的视觉效果。 - 我在 macOS,没有 simsun,所以用 FandolSong 作为了后备。
- 用 lualatex/xelatex 时
ctex
会自动加载fontspec
,所以我注释了后者。 - 给内容换了行。不确定行末的
%
是否必要。
- 我用
- 功能性修改
- 注意
\newfontfamily\chinesefont{STSong}
这样定义的是西文字体,定义中文字体要用\newCJKfontfamily
。
如果是用\newfontfamily
定义的,\chinesefont 汉字
使用的依然是ctex
默认设置的中文字体。 - 因为标点是直接输入的,于是
\annotate{中}{[t͡soŋ˥]}。
里的「中」字会用\chinesefont
的字体(假设它已经是用\newCJKfontfamily
定义的),而句号用ctex
默认设置的中文字体。我把\chinesefont
提到外面使用了,这样所有的中文字和标点都统一用\chinesefont
指定的字体。
- 注意
% !TeX program = lualatex
\documentclass[12pt]{article}
\usepackage[pass, showframe]{geometry}
\usepackage{stackengine}
%\usepackage{fontspec}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{ctex}
\IfFontExistsTF{simsun.ttf}
{\newCJKfontfamily\chinesefont{simsun.ttf}}
{\newCJKfontfamily\chinesefont{FandolSong}} % for non-win user
\newfontfamily\ipafont{CharisSIL-Regular.ttf}
\definecolor{lightblue}{RGB}{135,206,250}
\newcommand{\annotate}[2]{%
\stackon{%
\textcolor{black}{#1}%
}{%
\textcolor{lightblue}{\ipafont #2}%
}%
\linebreak[0]%
}
\begin{document}
\chinesefont
\annotate{今}{[kɐm˥]}\annotate{日}{[jɐt̚˨]}%
\annotate{天}{[tʰiːn˥]}\annotate{气}{[hei̯˧]}%
\annotate{唔}{[m̩˨˩]}\annotate{错}{[t͡sʰɔː˧]},%
\annotate{阳}{[jœːŋ˨˩]}\annotate{光}{[kʷɔːŋ˥]}%
\annotate{普}{[pʰou̯˧˥]}\annotate{照}{[t͡siːu̯˧]},%
\annotate{温}{[wɐn˥]}\annotate{度}%
{[tou̯˨]}\annotate{适}{[sek̚˥]}\annotate{中}{[t͡soŋ˥]}。
\annotate{我}{[ŋɔː˩˧]}%
\annotate{谂}{[nɐm˧˥]}\annotate{住}{[t͡syː˨]}%
\annotate{趁}{[t͡sʰɐn˧]}\annotate{住}{[t͡syː˨]}%
\annotate{呢}{[nei̯˥]}\annotate{个}{[kɔː˧]}%
\annotate{好}{[hou̯˧˥]}\annotate{天}{[tʰiːn˥]}\annotate{气}{[hei̯˧]}%
\annotate{去}{[hɵy̑˧]}\annotate{行}{[hɐŋ˨˩]}\annotate{下}{[haː˩˧]}%
\annotate{公}{[koŋ˥]}\annotate{园}{[jyːn˧˥]},%
\annotate{呼}{[fuː˥]}\annotate{吸}{[kʰɐp̚˥]}\annotate{下}{[haː˩˧]}%
\annotate{新}{[sɐn˥]}\annotate{鲜}{[siːn˥]}%
\annotate{空}{[hoŋ˥]}\annotate{气}{[hei̯˧]}。
\end{document}
from forum.
感谢答疑,问题已解决。
from forum.
Related Issues (20)
- error
- 如何让“摘要”出现在目录中,但不要显示后面的“......页码” 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.