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}
1
  • 1
    Use ss \FACTORING\ aa.
    – Sigur
    Jun 19 '20 at 22:14
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

1

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

1
  • 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. Jun 19 '20 at 22:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.