Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have checked thekpfonts.sty:

\renewcommand{\sfdefault}{jkpss\kp@petitesmajuscules\kp@flig\kp@style}

It seems that this name jkpss\kp@petitesmajuscules\kp@flig\kp@style is not correct. So what's the real name of this font?

So how to invoke Kpfonts as a second font?

share|improve this question
    
The low level font names are documented in the manual! \kp@petitesmajuscules\kp@flig\kp@style is a series of 3 LaTeX commands, which are replaced according to the package options you give. This is shown in jfbu’s answer. –  Speravir Jan 21 '13 at 18:57

2 Answers 2

up vote 2 down vote accepted

As I already commented, the low level names of all Kp-Font variants are documented in the manual. But I must admit, that this may be hard to understand.

So I thought, I should show some examples here. Regarding your question in comments see at the end.

\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

\usepackage{lmodern} % "Latin Modern" as default font set

\newcommand*{\testfont}[2]{\textsf{#1 (\texttt{#2}):} {\fontfamily{#2}\selectfont
                           Best off (sic!) 1234567890 Questions}\par}

\setlength{\parindent}{0pt}

\begin{document}

\section*{Examples for low level names of Kp-Fonts}

\testfont{Roman}{jkp}
\testfont{Roman light}{jkpl}
\testfont{Roman, large smallcaps}{jkpk}
\testfont{Roman light, no f-ligatures}{jkplf}
\testfont{Roman, large smallcaps, old style numbers}{jkpkosn}
\testfont{Roman light, oldstyle}{jkplos}
\testfont{Roman, very oldstyle}{jkpvos}

\smallskip

\textsc{\fontfamily{jkp}\selectfont Usual SmallCaps vs.\\
        \fontfamily{jkpk}\selectfont Large SmallCaps}

\bigskip

\testfont{Sans Serif}{jkpss}
\testfont{Sans Serif, large smallcaps}{jkpssk}
\testfont{Sans Serif, no f-ligatures}{jkpssf}
\testfont{Sans Serif, oldstyle}{jkpssos}
\testfont{Sans Serif, very oldstyle}{jkpssvos}

\smallskip

\textsc{\fontfamily{jkpss}\selectfont Usual SmallCaps vs.\\
        \fontfamily{jkpssk}\selectfont Large SmallCaps}

\bigskip

\testfont{Teletype}{jkptt}
\testfont{Teletype, oldstyle numbers}{jkpttosn}
\testfont{Teletype, oldstyle}{jkpttos}
\testfont{Teletype, very oldstyle}{jkpttvos}

\end{document}

code output

For your document you should define one or two commands depending on, what you like better. I will use here the basic Kp-Font roman, as seen above it is jkp:

  • A switch similar to \rmfamily or \bfseries: \newcommand{\kproman}{\fontfamily{jkp}\selectfont}, but then you have to set it in a group. Compare what I did in the example inside of \newcommand*{\testfont}.

  • Similar to \textrm or \textbf a grouping command: \newcommand{\textkproman}[1]{{\fontfamily{jkp}\selectfont#1}}, note the doubled braces for the grouping.

share|improve this answer

The fonts depend on the options you pass to the package. I have not checked the package file, but I presume you did not enclose your code within \makeatletter and \makeatother, as the following works:

(the font names are printed using the roman family kpfont, with the corresponding options except for the third example where I switched to the Computer Modern font to print the names)

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[lighttext,oldstylenums]{kpfonts}
\begin{document}

\makeatletter
jkpss\kp@petitesmajuscules\kp@flig\kp@style
\makeatother

\sfdefault

\end{document}

output

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[lighttext,veryoldstyle]{kpfonts}
\begin{document}\pagestyle{empty}

\makeatletter
jkpss\kp@petitesmajuscules\kp@flig\kp@style
\makeatother

\sfdefault

\end{document}

output

In this third example I use another font to print the names, so as to address the point raised in a comment by Scott H.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[lighttext,veryoldstyle,largesmallcaps]{kpfonts}
\begin{document}\pagestyle{empty}
\usefont{T1}{cmr}{m}{n}

\makeatletter
jkpss\kp@petitesmajuscules\kp@flig\kp@style
\makeatother

\sfdefault

\end{document}

output

share|improve this answer
    
As I commented to the question, the low level names are documented (it is perhaps a bit hard to understand), so your fine approach is actually not needed. –  Speravir Jan 21 '13 at 19:05
2  
Just to head off any confusion, in the examples that use veryoldstyle a "long s" is being used rather than the usual s in the printed font name. So for example, the internal name in the second example would be typed jkpssvos (I think) rather than what appears at first glance to be jkpffvof. –  Scott H. Jan 21 '13 at 19:09
    
@Speravir, @ScottH.: @Speravir you were right to point out to the OP that these were LaTeX commands. @ScottH.: good point, I have edited my anwer. –  jfbu Jan 21 '13 at 19:15
    
So I was wondering, how to use Kp-Font as a second font for a whole document. For instance, while the main font is Times, how to invoke the Kp-Font? –  KOF Jan 21 '13 at 21:02
1  
@KOF Kp-Fonts has extensive math support, so it would be sad not to load the package. You can load the package, do \let\kprmfont\rmdefault \let\kpsffont\sfdefault, \let\kpttfont\ttdefault then load another font package and when you want to use the Kp-Fonts do \usefont{T1}{\kprmfont}{m}{n} or \fontfamily{\kprmfont}\selectfont for roman or \fontfamily{\kpsffont}\selectfont for sans etc... –  jfbu Jan 21 '13 at 22:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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