2

I want to glue two glyphs together in order to produce a new glyph because I ran out of letters for my formulas. For example, I combine H and K such that the right vertical part of H coincides with the left vertical of K:

\newcommand{\HK}{H\hspace*{-0.5em}K}

This looks quite good and even scales because of the em unit. But in formulas, namely fractions, it doesn't scale properly any more. Which trick solves this?

My minimal example

 \documentclass{article}
 \usepackage[latin9]{luainputenc}
 \begin{document}

 \newcommand{\HK}{H\hspace*{-0.5em}K}

 $\HK$

 $HK$ for comparison.

 {\Large{}$\HK${\Large{}$\HK$}}{\Large \par}

 {\huge{}$\HK$}{\huge \par}

 {\huge{}$\frac{\HK}{2}$}{\huge \par} 

 {$\frac{\HK}{2}$}{\par}

 %{$\frac{\bsHK}{2}$}{\par}
 \end{document}

produces

output

I want the new glyphs in the fractions to look like the preceding ones. By the way, this procedure would also offer a way to kludge bold glyphs if they do not exist.

1
\documentclass{article}
% \usepackage[latin9]{luainputenc}
\usepackage{scalerel}
\def\scriptstyleScaleFactor{0.75}
%\def\scriptscriptstyleScaleFactor{0.5}
\begin{document}

 \newcommand{\HK}{\ThisStyle{H\hspace*{-1.15\LMex}K}}

 $\HK$

 $HK$ for comparison.

 {\Large{}$\HK${\Large{}$\HK$}}{\Large \par}

 {\huge{}$\HK$}{\huge \par}

 {\huge{}$\frac{\HK}{2}$}{\huge \par} 

 {$\frac{\HK}{2}$}{\par}

 %{$\frac{\bsHK}{2}$}{\par}
 \end{document}

enter image description here

4
  • What is the advantage of this solution with the scalerel package? Aug 9 '16 at 16:29
  • 1
    @HorstGrünbusch None, given that egreg showed it was not needed. I probably should delete the answer. Aug 9 '16 at 16:53
  • @HorstGrünbusch ...although his method does seem to have some issues with \huge$\HK$ unless my eyes deceive me. Aug 9 '16 at 17:04
  • 1
    Please do not delete this answer. +1 for using scalerel on horizontal spacing. I'm still comparing the answers. Aug 9 '16 at 18:21
4

You want to use the em in the proper size:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\HK}{H\text{\hspace*{-0.5em}}K}

\begin{document}

$\HK_{\HK}\frac{\HK}{2}$

\end{document}

enter image description here

I'm not sure your readers will be happy, though.

3
  • I prefer uniqueness to beauty. Spurius Carvilius Ruga is said to have done something similar as he invented the letter "G". ;) Aug 9 '16 at 16:11
  • Why does \huge$\HK$ look so bad? Aug 9 '16 at 17:09
  • @StevenB.Segletes Maybe some more kerning is needed in large sizes.
    – egreg
    Aug 9 '16 at 17:26

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.