Ligatures in LaTeX - how to get both cut-and-paste from pdf and smooth rendering

180 Views Asked by At

I would like to use ligatures in LaTeX but (a) be able to cut and paste from a PDF, and (b) with rendering that looks reasonable in a PDF. I can figure out how to do either of these but seemingly not both. A minimum example that works in overleaf is below.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
waffle fig fluff TIP TOP
\end{document}

When I open the resulting PDF in Adobe Reader, highlight, cut and paste tex to another text editor, everything is fine. So this snippet achieves goal (a). However the top lines of the characters are not aligned. In this image from 125 percent zoom in Adobe Reader, the top of the letter "T" is below the tops of the other capital letters. (screenshot of the PDF with misaligned characters is here)

When I comment out the two \usepackage lines above, the rendering of the PDF is improved. So this snippet achieves goal (b). However, I can no longer cut and paste. Cutting and pasting the ligatures sends across special characters that paste into text as shown. (screenshot of a text editor with special characters from cutting and pasting is here)

How does one best go about achieving both goals (a) and (b)?

0

There are 0 best solutions below