3

When I create shortcuts for individual glyphs, no kerning is applied.

\documentclass{article}
\newcommand{\myF}{\textit{f}}
\newcommand{\myA}{\textit{a}}
\begin{document}
\myF\myA\par \textit{fa}
\end{document}

enter image description here

Any way to retain kerning without having to type things like \textit{fa} directly?

Anticipating some questions about why I do this:

Just to make it clear, I define such shortcuts for more sensisble cases than the one above, such as (1) when the glyphs aren't characters you can find on a keyboard, and I want to avoid typing things like \char"XXXX every time, codes I would have to look up all the time, and (2) when using a transcription system in which upright and italic glyphs mean different things - in which case I predefine each glyph (many of which aren't even in Unicode) so that I don't need to remember whether that specific glyph in that context is supposed to be italic or upright.

7

enter image description here

\documentclass{article}
\newcommand{\myF}{\textit{f}}
\newcommand{\myA}{\textit{a}}
\newcommand{\yourF}{\begingroup\itshape f\endgroup}
\newcommand{\yourA}{\begingroup\itshape a\endgroup}
\begin{document}

\myF\myA

\yourF\yourA

\textit{fa}
\end{document}
|improve this answer|||||
  • I get the same with {\itshape f}, so why the {\begingroup .. \endgroup}? – Sverre Sep 1 '15 at 11:50
  • @Sverre: Remove them and then try out \yourF abc clclclc – Ulrike Fischer Sep 1 '15 at 12:09
  • @UlrikeFischer I did - I see no difference ... ?? – Sverre Sep 1 '15 at 12:12
  • You should. Without the grouping the following text should be in italic too. – Ulrike Fischer Sep 1 '15 at 12:13
  • @UlrikeFischer Oh! But that happens with \begingroup ... \endgroup as well! – Sverre Sep 1 '15 at 12:16

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.