3

I need to achieve something like this. I think using \hspace between each letter is not the best way, is there an alternative solution? enter image description here

5

2 Answers 2

6

From the showed example can be concluded that you looking for \so command from the soul package:

\documentclass{article}
\usepackage{soul}

\begin{document}
\so{text} text text
\end{document}

enter image description here

Edit: From Soul documentation (pp. 8):

You can define own spacing macros or overwrite the original \so meaning using the macro \sodef:

\sodef<cmd>{font inter-letter-space}{inner space}{outer space}

The space dimension, all of which are mandatory, should be defined in terms em letting them grow or shrink with the respective fonts.

An example:

\documentclass{article}

\usepackage{microtype}
\usepackage{soul}

\begin{document}
foobar \textls{barfoo} 

foobar \so{barfoo}

\sodef\an{}{.1em}{0.2em plus0.2em}{0.5em plus.1em minus.1em}

foobar \an{barfoo}
\end{document}

gives:

enter image description here

2
  • +1 for simplicity. Dec 28, 2019 at 16:34
  • @JohnKormylo Well, compare the result and warnings of \so{text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text} using this answer with what you get using \textls{text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text} in this answer. (I did not downvote this, though.)
    – user194703
    Dec 28, 2019 at 18:40
3

Guessing that your desired result is letter-spacing (or tracking) single words:

If you are already using fontspec or microtype in your code, those packages allow you to letterspace.

You can use microtype's letterspacing by using \textls{your text} around the part you want letterspaced.

\documentclass{article}

\usepackage{microtype}

\begin{document}
foobar \textls{barfoo}
\end{document}

output of code

You can adjust the amount of space between letters with the letterspace option. For example \usepackage[letterspace=200]{microtype}.

2
  • Hi, welcome. Can you give a fully compilable code as well as a screenshot of its result?
    – AndréC
    Dec 28, 2019 at 15:20
  • @AndréC Hello. Added an example, although I fear that it won't help much as they haven't specified anything in the question, really. As has been pointed out by js bibra below the post, if the question really was about letter-spacing, then it has been answered multiple times before.
    – TivV
    Dec 28, 2019 at 15:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .