# Adding more space between words in tcolorbox

Here is the code:

% Preview source code

%% LyX 2.3.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,hebrew,american]{article}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
{hyperref}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[x11names,usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[many]{tcolorbox}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\setotherlanguage{hebrew}
\begin{document}
\tcbset{enhanced,colback=gray!30!white,boxrule=1pt,colframe=blue!75!white,fonttitle=\bfseries}
\begin{tcolorbox}[valign=center,halign=center,colback=gray!50,drop large lifted shadow=BurlyWood!70,fit basedim=7pt,left=1mm, right=1mm] \bfseries\tcbfontsize{6}
AAA AAA AAA
\end{tcolorbox}

\end{document}


The result is:

How do I get more space between those words? I'm looking for a command or something like it, because I use this as a environment at LyX, so I want it to be automatically

P.S. There are many ways to change the font size. But no matter which way - the result is the same....

Thank you!

• It appears to relate to inter-word spacing. Please have a look at this answer. You can probably issue a \spaceskip=1.5\fontdimen2\font plus 1.5\fontdimen3\font minus 1.5\fontdimen4\font at the beginning of the tcolorbox environment. – Ruixi Zhang Aug 1 '18 at 22:21

Since you want an automatic solution in LyX, I propose implementing this answer by @GonzaloMedina as follows: Add

\usepackage{etoolbox}
\AtBeginEnvironment{tcolorbox}{%
\spaceskip=1.5\fontdimen2\font plus 1.5\fontdimen3\font minus 1.5\fontdimen4\font
}


to your customized preamble (after \usepackage[many]{tcolorbox}, of course). You may adjust the three 1.5’s to whatever numbers you find appropriate.

Added: The inter-word space, \spaceskip, is a glue which consists of 1) a fixed “ideal” length, taken from \fontdimen2\font; 2) a stretch length, taken from \fontdimen3\font; and 3) a shrink length, taken from \fontdimen4\font. These values are set up by the font designers and you normally shouldn’t change them. To increase \spaceskip, we can simply multiply each of the three lengths by a factor we want. In the above example, we are telling TeX to use inter-word space 1.5 times the original, with 1.5 times the stretchability and shrinkability. Also, the change happens inside tcolorbox, which makes it local.

• Can you explain me more about the numbers (what they mean)? Thank you so much!! – heblyx Aug 1 '18 at 22:43
• @heblyx Answer updated. :) – Ruixi Zhang Aug 1 '18 at 22:57