![巴斯克语中的字符 ñ](https://linux22.com/image/458916/%E5%B7%B4%E6%96%AF%E5%85%8B%E8%AF%AD%E4%B8%AD%E7%9A%84%E5%AD%97%E7%AC%A6%20%C3%B1%20.png)
我正在尝试将字符 ñ 放入巴斯克语中。我发现在某些语言中可以使用它,\~{n}
但它不起作用。我需要将其放入文本格式,而不是像$\tilde{n}$
。有人能帮我吗?
我收到以下错误信息:LaTeX Error: Command \texttilde unavailable in encoding T1.
当我添加时出现错误\usepackage{hyperref}
我可以看到有关放置 ~ 符号的问题,但却看不到如何放置西班牙语字符 ñ 的问题。
\documentclass[11pt,a4paper,twoside]{basque-book}
\usepackage[T1]{fontenc}
\usepackage[basque]{babel}
\usepackage{hyperref}
\begin{document} españa \end{document}
texlive 2022 的无错误日志
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.12.4) 21 DEC 2022 10:20
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**dd147
(./dd147.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2022-11-02>
(/usr/local/texlive/2022/texmf-dist/tex/latex/basque-book/basque-book.cls
Document Class: basque-book 2012/07/06 v1.20 Standard LaTeX document class adap
ted to Basque
(/usr/local/texlive/2022/texmf-dist/tex/latex/basque-date/basque-date.sty
Package: basque-date 2012/05/15 v1.05 basque-date Package
\c@urtea=\count185
)
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/bk11.clo
File: bk11.clo 2022/07/02 v1.4n Standard LaTeX file (size option)
)
\c@part=\count186
\c@chapter=\count187
\c@section=\count188
\c@subsection=\count189
\c@subsubsection=\count190
\c@paragraph=\count191
\c@subparagraph=\count192
\c@figure=\count193
\c@table=\count194
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\@contcwidth=\skip50
\bibindent=\dimen140
)
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
)
(/usr/local/texlive/2022/texmf-dist/tex/generic/babel/babel.sty
Package: babel 2022/11/30 3.83 The Babel package
\babel@savecnt=\count195
\U@D=\dimen141
\l@unhyphenated=\language87
(/usr/local/texlive/2022/texmf-dist/tex/generic/babel/txtbabel.def)
\bbl@readstream=\read2
\bbl@dirlevel=\count196
(/usr/local/texlive/2022/texmf-dist/tex/generic/babel-basque/basque.ldf
Language: basque 2005/03/29 v1.0f Basque support from the babel system
Package babel Info: Making " an active character on input line 85.
))
(/usr/local/texlive/2022/texmf-dist/tex/generic/babel/locale/eu/babel-basque.te
x
Package babel Info: Importing font and identification data for basque
(babel) from babel-eu.ini. Reported on input line 11.
) (/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-10-26 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count197
\l__pdf_internal_box=\box51
) (./dd147.aux)
\openout1 = `dd147.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
[1{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}
] (./dd147.aux) )
Here is how much of TeX's memory you used:
1723 strings out of 474968
29366 string characters out of 5776089
384723 words of memory out of 5000000
23280 multiletter control sequences out of 15000+600000
471154 words of font info for 31 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
40i,5n,52p,171b,149s stack positions out of 10000i,1000n,20000p,200000b,200000s
{/usr/local/texlive/2022/texmf-dist/fonts/enc/dvips/cm-super/c
m-super-t1.enc}</usr/local/texlive/2022/texmf-dist/fonts/type1/public/cm-super/
sfrm1095.pfb>
Output written on dd147.pdf (1 page, 14316 bytes).
PDF statistics:
14 PDF objects out of 1000 (max. 8388607)
8 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
答案1
预计到达时间:根据您的评论,实际发生的情况是,您在 MWE 中未列出的包存在错误。
原始答案
在 LuaLaTeX 或 XeLaTeX 上,添加行\usepackage{fontspec}
。
在 PDFLaTeX 上,请改为添加行\usepackage[T1]{fontenc}
。(在 2018 年之前的一些旧发行版中,您可能还需要\usepackage[utf8]{inputenc}
和\usepackage{textcomp}
,但在现代发行版中则不需要。)
您现在可以输入 ñ 或\~{n}
。
这可能已经满足了您的所有需求,但如果您希望文档的主要语言是巴斯克语,您还可以添加:
\usepackage[shorthands=off, basque]{babel}
您的错误消息表明您正在加载一些弄乱此字符定义的包。