I would like to use the OCR-B font provided by the ocr package as the default mono font in my document. Because of other font choices, I would also like to use the T1 fontenc.

The below MWE compiles with this warning and the "TT Test" text comes out in Computer Modern:

LaTeX Font Warning: Font shape `T1/ocrb/m/n' undefined
(Font)              using `T1/cmr/m/n' instead on input line 9.
\documentclass[convert, varwidth]{standalone}


Roman Test
\texttt{TT Test}

MWE output showing both lines in Roman instead of the second line in OCR-B

This works properly without the T1 fontenc.

Is it possible to mix font encodings in this way?


You can locally switch to OT1 encoding. Be aware that this means that Umlauts and other chars with accents are built with accents and so don't copy&paste correctly.


\texttt{TT Test äöüßé}

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.