TeX - LaTeX Asked by David Woitkowski on June 26, 2021
I’m using the genealogic symbols textborn
and textdied
from the textcomp
package together with the kpfonts
.
Unfortunately kpfonts
loads textcomp
with the [full]
option (unless someone specifies notextcomp
) but seems to modify the appereance of said symbols.
If you try out the following example with and without kpfonts
you will observe that the symbols get changed to a much heavier, darker version when loading kpfonts
.
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[full]{textcomp}
%usepackage{kpfonts}
begin{document}
textborn,1984, textdied,2005
end{document}
I would like to use the original version of these symbols while staying with kpfonts
. To achieve this I tried saving them using let
with no success.
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[full]{textcomp}
letoldtextdiedtextdied
letoldtextborntextborn
usepackage{kpfonts}
begin{document}
textborn,1984, textdied,2005
oldtextborn,1984, oldtextdied,2005
end{document}
Also loading kpfonts
with notextcomp
and textcomp
on its own doesn’t change this behavior.
Any ideas how to preserve the original appereance of these symbols?
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@symbol2textbornstd}
DeclareTextCommandDefault{textdiedstd}{tc@check@symbol2textdiedstd}
makeatother
DeclareRobustCommand{textborn}{{fontfamily{cmr}selectfonttextbornstd}}
DeclareRobustCommand{textdied}{{fontfamily{cmr}selectfonttextdiedstd}}
begin{document}
textborn,1984, textdied,2005
end{document}
This is the output
This is the output when usepackage{kpfonts}
and the added code are commented out
So you see that the European Modern TS1 glyphs are used in both cases.
Correct answer by egreg on June 26, 2021
A hacky solution:
documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{kpfonts}
newcommand{oldtextdied}{{fontfamily{cmr}selectfonttextdied}}
newcommand{oldtextborn}{{fontfamily{cmr}selectfonttextborn}}
begin{document}
textborn,1984, textdied,2005
oldtextborn,1984, oldtextdied,2005
end{document}
Answered by Franck Pastor on June 26, 2021
Using
usepackage[euro,warn]{textcomp}
usepackage[notextcomp]{kpfonts}
worked for the textmarried
:) Thanks David Woitkovski.
Answered by Shaghayegh Javadi on June 26, 2021
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}
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.
Answered by Davislor on June 26, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP