1

I managed to set precise font size in memoir class on the basis of this answer, e.g. normalsize is 14bp.

After applying tempora package I have to reset ttdefault, e.g. by Computer Modern Typewriter.

As a result the ttdefault has lost 14bp and become 13,77bp.

How can I ask 14bp come back?

MWE: main.tex

\providecommand*{\anyptfilebase}{bpfont} %set new fonts
\providecommand*{\anyptsize}{14}         %switch on bpfont14.clo - the copy of mem14.clo
\documentclass[extrafontsizes,a4paper,*pt,oneside,openany]{memoir}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}[2014/03/24]% Языки: русский, английский

\usepackage{tempora} %TemporaLGCUni of Times type
%\renewcommand{\ttdefault}{cmtt}
\renewcommand{\ttdefault}{lcmtt} %bigger
\begin{document}
    {\fontsize{14bp}{18bp}\selectfont ха-хаха Book\_name\_ch\_AuthorsSurnames}

    {\normalsize\selectfont ха-хаха Book\_name\_ch\_AuthorsSurnames}

    {\itshape  \verb|ха-хаха Book_name_ch_AuthorsSurnames|}.

    {\normalsize\selectfont \verb|ха-хаха Book_name_ch_AuthorsSurnames|}

    {\fontsize{14bp}{18bp}\selectfont\texttt{ха-хаха Book\_name\_ch\_AuthorsSurnames}}

    {\texttt{\fontsize{14bp}{18bp}\selectfont ха-хаха Book\_name\_ch\_AuthorsSurnames}}

    {\small{\texttt{ха-хаха Book\_name\_ch\_AuthorsSurnames}}}
\end{document}

MWE: bpfont14.clo is mem14.clo(link) with 4 lines of the code replaced (please, set this file in the folder with main.tex):

\@setfontsize\normalsize{14bp}{18bp}    % SET 14 Adobe pt and 1,5 Adobe intervals. One can wish to delete all other text for precise result.
\abovedisplayskip 14\p@ \@plus3\p@ \@minus8\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@

PDF:

enter image description here

1

You aren't really using lmodern, because it has no support for Cyrillic; what you get are the fonts defined in t2alcmtt.fd that are only defined at discrete steps. Indeed you get a warning about

LaTeX Font Warning: Size substitutions with differences
(Font)              up to 1.82pt have occurred.

because this is the font definition:

\ProvidesFile{t2alcmtt.fd}
  [2001/08/11 v1.0a Computer Modern Cyrillic font definitions]
\DeclareFontFamily{T2A}{lcmtt}{\hyphenchar\font\m@ne}
\DeclareFontShape{T2A}{lcmtt}{m}{n}{%
  <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
  laltt8%
}{}
\DeclareFontShape{T2A}{lcmtt}{m}{In}{%
  <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
  ilaltt8%
}{}
\DeclareFontShape{T2A}{lcmtt}{m}{it}{%
  <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
  lait1000%
}{}
\endinput

You have to redefine the font family.

\providecommand*{\anyptfilebase}{bpfont} %set new fonts
\providecommand*{\anyptsize}{14}         %switch on bpfont14.clo - the copy of mem14.clo
\documentclass[extrafontsizes,a4paper,*pt,oneside,openany]{memoir}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}[2014/03/24]% Языки: русский, английский

\usepackage{tempora} %TemporaLGCUni of Times type

\makeatletter
\providecommand{\EC@ttfamily}[5]{%
  \DeclareFontShape{#1}{#2}{#3}{#4}{
    <-8.5>#50800
    <8.5-9.5>#50900
    <9.5-10.5>#51000
    <10.5-11.5>#51095
    <11.5-13>#51200
    <13-15.5>#51440
    <15.5-18.5>#51728
    <18.5-22>#52074
    <22-27>#52488
    <27-32>#52986
    <32->#53583}{}}
\DeclareFontFamily{T2A}{cmtt}{\hyphenchar\font\m@ne}
\EC@ttfamily{T2A}{cmtt}{m}{n}{latt}
\EC@ttfamily{T2A}{cmtt}{m}{sl}{last}
\EC@ttfamily{T2A}{cmtt}{m}{it}{lait}
\EC@ttfamily{T2A}{cmtt}{m}{sc}{latc}
\DeclareFontShape{T2A}{cmtt}{bx}{n}%
  {<->ssub*cmtt/m/n}{}
\DeclareFontShape{T2A}{cmtt}{bx}{it}%
  {<->ssub*cmtt/m/it}{}
\makeatletter

\renewcommand{\ttdefault}{cmtt}

\begin{document}

\newcommand{\fn}{\expandafter\string\the\font}

{\fontsize{14bp}{18bp}\selectfont ха-хаха Book\_name\_ch\_AuthorsSurnames\fn}

{\normalsize\selectfont ха-хаха Book\_name\_ch\_AuthorsSurnames\fn}

{\fontsize{14bp}{18bp}\selectfont\texttt{ха-хаха Book\_name\_ch\_AuthorsSurnames\fn}}

{\texttt{\fontsize{14bp}{18bp}\selectfont ха-хаха Book\_name\_ch\_AuthorsSurnames\fn}}

{\small{\texttt{ха-хаха Book\_name\_ch\_AuthorsSurnames\fn}}}

14bp=\the\dimexpr14bp\relax

\end{document}

enter image description here

If you plan to use the cmtt fonts in the T1 encoding, similar code has to be added also for them.

  • thank you so much. It would be great if you explain, how to get the similar results for other fonts. Where can I read about \EC@ttfamily? What does <-8.5>#50800....<32->#53583 mean? There is also no idea where could I find information about \hyphenchar\font\m@ne and <->ssub* to solve the problem by myself. – Vladimir Parkhomenko Sep 23 '17 at 15:50
  • some explanations can be found on the following web-page: tex.stackexchange.com/a/109673/44348 – Vladimir Parkhomenko Sep 23 '17 at 16:13
  • there is one extra problem I can not get global \hyphenation when I use \texttt in Index : tex.stackexchange.com/q/394500/44348 – Vladimir Parkhomenko Oct 4 '17 at 10:12

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.