2

I am trying to define a command that writes the word "FACTORING" in sans serif. I did define the command as follows:

\newcommand{\FACTORING}{\textsf{FACTORING}}

But the when I use the command "FACTORING" does not have any distance to the following letters (see the following small document.) Could you please tell me what I am doing wrong?

 \documentclass[a4paper, 11pt, oneside]{book}

\makeatletter \makeatother \usepackage[a4paper,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}

\usepackage[style=numeric,firstinits,sorting=none]{biblatex}

\usepackage{etoolbox} \usepackage{fancyhdr} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage[utf8]{inputenc} \usepackage{latexsym} \usepackage{lmodern} % The Font Type \usepackage{mdframed} \usepackage{titlesec} \usepackage[absolute,overlay]{textpos}

\newcommand{\FACTORING}{\textsf{FACTORING}}

\begin{document}

ssssssssssssssss \FACTORING aaaaaa.

\end{document}

egreg
  • 1,121,712
3nondatur
  • 483

2 Answers2

5

LaTeX ignores space(s) after a command name. You can use

\FACTORING{} text
% or
\FACTORING\ text

to manually reserve or add a space.

Or, you can use the \xspace command from xspace package to automatically add a space.

\documentclass{article}
\usepackage{xspace}
\newcommand{\FACTORING}{\textsf{FACTORING}\xspace}

\begin{document} Followed by punctuation: text \FACTORING.

Followd by inter-word space: text \FACTORING text. \end{document}

enter image description here

muzimuzhi Z
  • 26,474
1

You have to use an additional spacing char after your command. Use: \newcommand{\FACTORING}{\textsf{FACTORING}\ } instead

  • 3
    Welcome to TeX.SX! What if I want to write \FACTORING at the end of a sentence: ss \FACTORING.? It's better not to hardcode the space in the definition. – Phelype Oleinik Jun 19 '20 at 22:27