kpfonts changes appereance of textcomp symbols

A hacky solution:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{kpfonts}
\newcommand{\oldtextdied}{{\fontfamily{cmr}\selectfont\textdied}}
\newcommand{\oldtextborn}{{\fontfamily{cmr}\selectfont\textborn}}

\begin{document}

\textborn\,1984, \textdied\,2005

\oldtextborn\,1984, \oldtextdied\,2005 

\end{document}

enter image description here


A full solution that neutralizes the pesky encoding specific commands:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[full]{textcomp}
\usepackage{kpfonts}

\DeclareTextSymbol{\textbornstd}{TS1}{98}
\DeclareTextSymbol{\textdiedstd}{TS1}{100}
\UndeclareTextCommand{\textborn}{TS1}
\UndeclareTextCommand{\textdied}{TS1}
\makeatletter
\DeclareTextCommandDefault{\textbornstd}{\tc@check@symbol2\textbornstd}
\DeclareTextCommandDefault{\textdiedstd}{\tc@check@symbol2\textdiedstd}
\makeatother
\DeclareRobustCommand{\textborn}{{\fontfamily{cmr}\selectfont\textbornstd}}
\DeclareRobustCommand{\textdied}{{\fontfamily{cmr}\selectfont\textdiedstd}}


\begin{document}

\textborn\,1984, \textdied\,2005

\end{document}

This is the output

enter image description here

This is the output when \usepackage{kpfonts} and the added code are commented out

enter image description here

So you see that the European Modern TS1 glyphs are used in both cases.


The problem here is not that the package loads textcomp. That’s no longer needed explicitly, since it’s part of the LaTeX kernel now, but that lets you use these symbols in 8-bit TeX at all. It’s that kpfonts comes with a companion font that covers those symbols, and you don’t like it.

So, you can change the companion font used with the TS1 encoding back to Computer Modern, using substitutefont.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % The default since 2018
\usepackage[full]{textcomp} % No longer needed as of 2020
\usepackage{kpfonts}
\usepackage{substitutefont}

\substitutefont{TS1}{\rmdefault}{cmr}
\substitutefont{TS1}{\sfdefault}{cmss}

\begin{document}

\textborn~1984, \textdied~2005

\end{document}

KP/Computer Modern sample

As of 2020, you can remove both the inputenc and the textcomp packages from your preamble. A current version of LaTeX will load them both by default.

On a minor unrelated note, you probably want these symbols to be separated from the date by a non-breaking space, ~, rather than \,. This way, TeX will never break a line between the symbol and the date.