0

Related: Finishing math with a period

I believe of the two options

\[|f(x)-(y)|<\epsilon\text{.}\]

or

\[|f(x)-(y)|<\epsilon.\]

the first one is correct. However, a problem that was brought up (link above) is the kerning between the symbol before the period (e.g. a letter Y) and the period itself.

I came up with a funky solution, and my question is to ask the TeX community for a better(?) solution. I say better(?) because it's all subjective; however in my opinion a better solution would use less computation time or use non-LaTeX primitive TeX commands even if the time saved is in the order of milliseconds.

My proposed solution is the following:

\newcommand{\TP}{.\sbox0{$.$}\kern-1.819\ht0\rlap{\color{white}\rule{1.006\ht0}{1.006\ht0}}\kern1.819\ht0\llap{.}}

A downside of this solution is that a color package must be utilized to generate the "white" box which is designed to cover the correctly-kerned math-period so that the text-period can be placed on top. I'm also pretty sure \rlap and \llap are not TeX primitives so there's that too.

EDIT(1) It's been two months, and I think I stumbled on a more aesthetic solution. I also now think \rlap and \llap are indeed TeX primitives because they are mentioned in the TeXbook by Donald Knuth.

\newcommand{\TP}{\kern1.11112pt\llap{.}\kern0pt}

6
  • Traditionally, there’s no period at the end of a display equation (although there could be in inline text). If you really want one, use \textnormal{.}. If you don’t like the kerning, add \kern-0.1pt\textnormal{.}.or whatever value looks best to you.
    – Davislor
    Commented Dec 29, 2020 at 6:05
  • Or maybe wrap it in \mathpunct.
    – Davislor
    Commented Dec 29, 2020 at 6:46
  • @Davislor I never considered \mathpunct I will do some testing with that; much thanks! Commented Dec 29, 2020 at 7:10
  • I found that \mathpunct{\text{.}} still does not kern properly. It would have been such a nice solution. Commented Dec 29, 2020 at 7:26
  • 2
    don't use color white to hide things, it fails miserably if the document is not printed on white or if sections cut and pasted. It is best to avoid sentence punctuation in displays but if it really can not be avoided separate it from the math with a large space such as \quad Inter-letter kerning should not be an issue at all here. Commented Dec 29, 2020 at 11:03

0

You must log in to answer this question.

Browse other questions tagged .