1

I am currently trying to compile a TeX file as a PDF/A document using \usepackage[a-1b]{pdfx}. However, I have included the \pounds symbol therein, which produces the following error:

LaTeX Error: Command \pounds unavailable in encoding 0T1

Adding \usepackage[T1]{fontenc} produces the equivalent error:

LaTeX Error: Command \pounds unavailable in encoding T1

Does anyone has an idea how to solve this problem? Thanks in advance!

LPP

2
  • Welcome to TeX.SE!
    – Mensch
    Oct 14, 2022 at 17:04
  • 1
    always show a small and complete example. That makes test easier. Oct 14, 2022 at 17:08

2 Answers 2

2

Minimal working example below.

enter image description here

\documentclass{article}
\usepackage[english]{babel}

\usepackage[a-1b]{pdfx}

\begin{document}
British money is: \textsterling
\end{document}
4
  • 1
    The \textsterling command should work for a recent TeX distribution, even without textcomp.
    – Davislor
    Oct 14, 2022 at 23:13
  • You're right. I have corrected my example. Thanks for the correction!
    – B Hos
    Oct 14, 2022 at 23:15
  • Wonderful, thank you very much! :-) Oct 18, 2022 at 13:32
  • Is it possible to switch \textstirling to italic, so that it looks exactly like \pounds? Edit: \mathsterling does the trick. Oct 18, 2022 at 13:34
1

The reason for this bug has to do with the representation of currency symbols in seven-bit font encodings from the 1980s. As explained on page 272 of “The Comprehensive LaTeX Symbol List”, the pound sign and the dollar sign are encoded in the same slot in the default encoding (OT1). The italic slots have a pound sign, and the upright slots have a dollar sign. The document recommends:

Authors who use \pounds should select a font encoding other than OT1 [...] or use the textcomp package, which redefines \pounds to use the TS1 font encoding.

It appears that this workaround is incompatible with pdfx. If you want \pounds to work again in text mode, you can add the following lines after pdfx. (But a search-and-replace with \textsterling is probably better.)

\renewcommand\pounds\relax
\DeclareTextSymbol{\pounds}{TS1}{"A3}
\DeclareTextSymbol{\pounds}{TU}{"A3}
\DeclareTextSymbolDefault{\pounds}{TS1}

I do not know if this would break any other feature of the pdfx package on any engine, and have not for example tested it with PDF bookmarks, but it displays correctly in Text mode for both PDFTeX and Unicode engines. It does not fix $\pounds$.

Unicode is another good alternative. I’d recommend you use it when you can, and legacy 8-bit (or even 7-bit, as here) font encodings when you have to. In LuaLaTeX or XeLaTeX, simply \usepackage{textcomp}, or load any font package that sets the font encoding to Unicode (such as fontsetup). The \textsterling command will still work.

8
  • The question has nothing to do with legacy encodings and switching to an unicode engine wouldn't resolve this concrete problem, it would only change the error to ! LaTeX Error: Command \pounds unavailable in encoding TU.. Using \textsterling (or \mathsterling) as suggested by the other answer is imho the best. Oct 15, 2022 at 9:20
  • @UlrikeFischer As I saw it, the basic issue was that OT1 doesn’t have a pound symbol. The self-answer, which works fine, implicitly used TS1. Another, more modern, solution is to use Unicode rather than TS1. I thought it was an alternative worth mentioning.
    – Davislor
    Oct 15, 2022 at 9:30
  • no. OT1 has a pound, and T1 has it too. The problem is not that the symbol is missing but the way it is defined (it has no encoding dependent definition) and that pdfx changes this definition. I know that you want to promote the unicode engines, but here you gain nothing by switching to them. Try out the code in the other answer with lualatex + \pounds. Oct 15, 2022 at 9:33
  • @ulrike Ah, here we go. The pound sign appears in the italic OT1 fonts, and the dollar sign in upright.
    – Davislor
    Oct 15, 2022 at 16:49
  • @UlrikeFischer Okay, I hope you like this re-written answer better.
    – Davislor
    Oct 15, 2022 at 17:14

You must log in to answer this question.

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