0

Sometimes you want to say "the new method is 18x faster" pronounced "eighteen times faster", how do you produce that cross in latex?

I tried

the new method is 18\times faster

But that italicises everything after it

What's the typesetting standard to use? To be honest, $\times$ doesn't look exactly right in the first place.

minseong
  • 487
  • $ starts or ends math mode. So if you have $\times, then you've started math mode, but not ended it. That will give you strange errors later on. gigair's answer shows how you would properly end math mode. – Teepeemm Mar 23 '21 at 17:56
  • @Teepeemm i didn't have $\times Oh sorry, I see the confusion caused by the typo in the last sentence. I have never put $\times into my document though. – minseong Mar 23 '21 at 17:59
  • Did you have a look at `\texttimes? (see e.g. https://tex.stackexchange.com/a/15131/44119) – albert Mar 23 '21 at 18:05
  • 3
    If you say 18\times there will be an error --- TeX will suggest to add a $ because it's seeing a math-mode thing. If you run in nonstopmode you will have the same effect as writing 18$\times. Then TeX will add another $ (with another error) at the end of the paragraph: this is why it "italicises everything after it" (in reality is math mode, not italics). So, never ignore errors... and better not run with nosnstopmode. – Rmano Mar 23 '21 at 18:08

2 Answers2

4

Define a command, even if you use this once. This way you can change your mind whenever you please and are not tied to a particular representation.

I propose two realizations, take your pick or experiment in different ways.

\documentclass{article}

\newcommand{\grA}[1]{#1$\mskip1mu\times$} \newcommand{\grB}[1]{#1\textsf{,x}}

\begin{document}

This method is \grA{10} faster.

This method is \grB{10} faster.

\end{document}

enter image description here

egreg
  • 1,121,712
  • I just tried with \def\x{\textsf{x}}, but it gets rid of the following space. Producing 10xfaster instead of 10x faster like your rendering. Do you know why? – minseong Mar 23 '21 at 19:01
  • Making it a non-ASCII character fixes it, I'm using \def\×{\textsf{x}} now – minseong Mar 23 '21 at 19:17
2

Try

the new method is 18$\times$ faster
gigiair
  • 1,812