Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译出错:疑似国际音标宏包tipa和模板冲突 #157

Open
jin-li opened this issue Aug 1, 2021 · 3 comments
Open

编译出错:疑似国际音标宏包tipa和模板冲突 #157

jin-li opened this issue Aug 1, 2021 · 3 comments

Comments

@jin-li
Copy link

jin-li commented Aug 1, 2021

编译出错:我在Linux上使用TeX Live 2019编译ElegantBook 4.1时出现报错,编译方式为 xelatex(因为使用的是中文,所以用xelatex而非pdflatex),这是我的最小工作代码(MWE):

\documentclass[11pt,fancy]{elegantbook}
\usepackage[T1]{tipa}

\begin{document}
\chapter{Elegant}
Elegant Book
\end{document}

报错为:

! Argument of \UseTextAccent has an extra }.
<inserted text> 
                \par 
l.5 \chapter{Elegant}
                     
? 

备注:
1、问题出在用来输入国际音标的tipa宏包。
2、最小工作代码示例中未输入国际音标,只引用这个宏包就已经出现了报错。
3、此问题在ElegantBook 3.11版本上不存在,只存在于ElegantBook 4.1版本。

我很好奇v4.1版相比v3.11做了哪些改动,造成了这个问题?
谢谢!

@caffelab
Copy link

可参考我的方案。https://zhuanlan.zhihu.com/p/421420547

@jin-li
Copy link
Author

jin-li commented Mar 31, 2022

可参考我的方案。https://zhuanlan.zhihu.com/p/421420547

@caffelab 谢谢!不过按你的方案改了之后编译依然有报错:

(/usr/share/texmf/tex/latex/tipa/tipa.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texmf/tex/latex/tipa/t3enc.def

Package fontspec Warning: Font "FandolHei-Regular" does not contain requested
(fontspec)                Script "CJK".


LaTeX Font Warning: Font shape `U/qhv/m/n' undefined
(Font)              using `U/cmr/m/n' instead on input line 357.

)

! Package fontenc Error: Encoding file `uenc.def' not found.
(fontenc)                You might have misspelt the name of the encoding.

See the fontenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.104 \ProcessOptions*
                      
? 

@syvshc
Copy link
Contributor

syvshc commented May 28, 2022

可以考虑使用 tipauni , 可以使用 CMU Serif 作为 tipauni 的字体, 具体使用方法请读文档

% xelatex
\documentclass{elegantbook}
\newfontfamily{\ipafont}{CMU Serif}
\usepackage[preservefont]{tipauni}
\let\oldtextipa\textipa
\renewcommand*{\textipa}[1]{{\ipafont\oldtextipa{#1}}}

\begin{document}
Quack (in TeX Gyre TermesX)

\fbox{\textipa{4}} (in CMU Serif)
\end{document}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants