0

I'm trying to put the character ñ with basque language. I've seen that in some languages you can use \~{n} but it doesn't work. I need to put it in the text format, not like $\tilde{n}$. Can someone help me?

I have this error message: LaTeX Error: Command \texttilde unavailable in encoding T1.

The error appears when I add \usepackage{hyperref}

I can see questions about putting ~ symbol but not how to put the spanish character ñ.

\documentclass[11pt,a4paper,twoside]{basque-book}
\usepackage[T1]{fontenc}
\usepackage[basque]{babel}
\usepackage{hyperref}
\begin{document} españa \end{document}

Error free log from 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)
13
  • 1
    You can use ñ or \~{n} Dec 21, 2022 at 9:23
  • 2
    You are doing something wrong but if you do not show your code or your error message we can not help You should get this output from \documentclass{article} \usepackage[T1]{fontenc} \usepackage[basque]{babel} \begin{document} woñrds wo\~{n}rds wo\~nrds \end{document} Dec 21, 2022 at 9:31
  • 1
    The basque-book manual says that the document class is incompatible with babel. Does commenting out the babel package (or using the shorthands-off option) fix it?
    – Davislor
    Dec 21, 2022 at 10:04
  • 3
    @Davislor ooh a manual:-) Can you reproduce the OP's error? Dec 21, 2022 at 10:10
  • 1
    @DavidCarlisle I cannot reproduce it, no. In another comment, OP says there are two additional packages not included in the MWE.
    – Davislor
    Dec 21, 2022 at 10:59

1 Answer 1

4

ETA: From your comments, what’s actually happening is that a package you did not list in your MWE is buggy.

Original Answer

On LuaLaTeX or XeLaTeX, add the line \usepackage{fontspec}.

On PDFLaTeX, add the line, \usepackage[T1]{fontenc} instead. (On some old distributions, from before 2018, you might additionally need \usepackage[utf8]{inputenc} and \usepackage{textcomp}, but on modern ones, you don’t.)

You can now type either ñ or \~{n}.

That will probably do everything you need, but if you want the main language of the document to be Basque, you can additionally add:

\usepackage[shorthands=off, basque]{babel}

Your error message suggests you’re loading some package that messes up the definition of this character.

8
  • even with OT1 ñ should work for display. \documentclass{article} \begin{document} ñ \end{document} with no package Dec 21, 2022 at 9:52
  • @DavidCarlisle Also, the error message mentions the T1 encoding.
    – Davislor
    Dec 21, 2022 at 9:53
  • OP added that later, but then that means they are already using T1 so adding On PDFLaTeX, add the line, \usepackage[T1]{fontenc} will do nothing Dec 21, 2022 at 9:55
  • 2
    @Irati Okay, neither of those packages are in your MWE. Can you please edit your question to give a MWE that actually reproduces the bug?
    – Davislor
    Dec 21, 2022 at 10:56
  • 1
    @Davislor I'll study how to post a MWE thanks! Changing the order to charge the packages it works! Thanks u :)
    – Irati
    Dec 21, 2022 at 14:09

Not the answer you're looking for? Browse other questions tagged .