Tx · LaTeX & TikZ

How to Fix “\textcurrency Unavailable in Encoding T1”

Published By the 9to5Science editorial team

At a glance

  1. 1. Load textcomp

    Add \usepackage{textcomp} to the preamble so LaTeX can access text symbols in the TS1 encoding.

  2. 2. Use the command in text

    Write \textcurrency where you want the generic currency sign; it is a text symbol, not a math command.

  3. 3. Check the intended symbol

    If you need a specific currency sign, use that currency’s symbol rather than the generic sign.

The error LaTeX Error: Command \textcurrency unavailable in encoding T1 usually means LaTeX is looking for the generic currency sign in the wrong font encoding. T1 is primarily an encoding for text letters and related characters; the currency sign is supplied through the TS1 text-symbol encoding.

For most documents, the fix is to load textcomp. The example below shows the package and command in a complete document.

Minimal fix

Add this line to the preamble, before \begin{document}:

\usepackage{textcomp}

A minimal example is:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}

\begin{document}
The generic currency symbol is \textcurrency.
\end{document}

Compile the example with your usual LaTeX engine. fontenc selects T1 for the document’s text fonts, while textcomp makes text symbols from TS1 available. When LaTeX encounters \textcurrency, it can select the symbol from the appropriate encoding rather than trying to find it in T1.

If you already load textcomp, check that the line is in the preamble and that the document is being compiled from the file you edited. In a large project, a class or package may also affect font setup; test the minimal example above to distinguish that from a problem in the full document.

What the command prints

\textcurrency produces the generic currency sign, ¤. It does not choose a symbol based on your country or currency. If you intended a particular currency sign, use a command or font that provides that symbol instead. For example, with textcomp, \texteuro is commonly used for the euro sign:

\documentclass{article}
\usepackage{textcomp}

\begin{document}
Prices: \texteuro 20 and \textcurrency 20.
\end{document}

The first price uses a euro sign; the second uses the generic currency sign. For other currencies, check that the chosen command is provided by the packages and fonts in your document.

Why T1 appears in the error

LaTeX uses font encodings to map text characters to glyphs in a font. T1 is a common text encoding, especially for documents containing accented Latin letters. Text symbols such as the generic currency sign are handled through TS1. The error message says that the current encoding, T1, cannot supply the requested command. Loading textcomp gives LaTeX access to TS1 symbols and usually resolves the issue without changing the document’s main text encoding.

The message can also occur if the command is used in a context where LaTeX has been told to use a particular font encoding that lacks the symbol. If loading textcomp does not fix it, reduce the document to the minimal example and add packages and font settings back one at a time. This can reveal a package conflict or a font that lacks the required glyph.

Common mistakes

  • Putting the package command after \begin{document}: Packages belong in the preamble.
  • Using the symbol in math mode: \textcurrency is a text command. Put it in ordinary text, or use a text-in-math command such as \text{...} from amsmath when a symbol must appear inside a formula.
  • Expecting a specific currency: \textcurrency is generic. It does not mean dollar, pound, or euro.
  • Changing T1 to another encoding as the first fix: T1 may be needed for accented text. Loading textcomp is the usual way to add this text symbol while keeping T1.
  • Typing the visible character directly without checking the font: A literal symbol may depend on the input encoding and the selected font’s glyph coverage. The package command is a more predictable choice in a traditional LaTeX setup.

References

  1. The textcomp package

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.