2

Is there any possibility how to automatically stretch letter spaces in narrow columns to get fully justified text like that in the middle? Picture below is from soul package manual.

letter spacing

Here is my working example:

\documentclass[9pt,draft]{extarticle}

\usepackage[twoside,a5paper,top=16mm,inner=10mm,outer=10mm,bottom=16mm]{geometry}

\usepackage{fontspec}
    \setmainfont[Ligatures=TeX]{PT Serif}
    \newfontfamily\normalni{PT Sans}%[ItalicFont={Source Sans Pro Italic}]

\usepackage{polyglossia}
    \setmainlanguage{czech}
    \setotherlanguages{bulgarian,polish}

\usepackage[final]{microtype}
  \SetProtrusion
     [ load = default,    % Dědíme veškerá nastavení od `default`.
       factor   = 2000 ]      % Zdvojnásobení zděděných hodnot.
     { family   = {*},
       encoding = {EU1,EU2} } % Experimental Unicode: „kódování“ OpenType fontů.
     { . = {500,500} }

\usepackage[all]{nowidow}
\usepackage{setspace}
    \setstretch{1.1}
\usepackage{paracol}



\sloppy
\begin{document}
\begin{paracol}{3}

\switchcolumn[0]
\begin{description}\textbulgarian{\item{\bfseries{}АБСТРАКТНО СЪЩЕСТВИТЕЛНО (отвлечено съществително)}
{\small{}Съществително име, което назовава идеи, абстрактни понятия или нематериални неща напр. \textit{свобода}, \textit{справедливост} и~т.\,н.}}\end{description}


\vspace{2\baselineskip}\switchcolumn[1]
\begin{description}\textczech{\item{\bfseries{}ABSTRAKTUM (abstraktní podstatné jméno)}
{\small{}Substantivum postrádající denotát fyzické povahy. Abstrakta označují vlastnosti (\textit{lenost}, \textit{krása}), děje (\textit{běh}, \textit{plavání}), stavy (\textit{bdění}, \textit{spánek}) nebo propozice (\textit{podmínka}, \textit{okolnost}) jako třídy „objektů“, tj. jako něco, k~čemu lze referovat buď jako ke třídě, nebo k~prvku/prvkům třídy.}}\end{description}


\vspace{2\baselineskip}\switchcolumn[2]
\begin{description}\textpolish{\item{\bfseries{}RZECZOWNIK ABSTRAKCYJNY}
{\small{}Rzeczownik, którego znaczenia nie można ogarnąć podstawowymi zmysłami.}}\end{description}

\end{paracol}
\end{document}
0

The command for variable letterspacing is defined in the documentation to the soul package (\magstylepar).

Beware of the warning given in the caption, however! To get the results a bit more acceptable, I've also activated microtype's font expansion for all fonts, which allows to reduce the amount of stretch between letters.

Also note that soul is notoriously fragile, so it might fail for more complex cases.

\documentclass[9pt,draft]{extarticle}

\usepackage[twoside,a5paper,top=16mm,inner=10mm,outer=10mm,bottom=16mm]{geometry}

\usepackage{fontspec}
  \setmainfont[Ligatures=TeX]{PT Serif}
  \newfontfamily\normalni{PT Sans}%[ItalicFont={Source Sans Pro Italic}]
  \newfontfamily\cyrillicfont[Ligatures=TeX]{PT Serif} %% added to get rid of the polyglossia error

\usepackage{polyglossia}
  \setmainlanguage{czech}
  \setotherlanguages{bulgarian,polish}

\usepackage[final]{microtype}
\microtypesetup{expansion=all} %% This helps a lot!
%  \SetProtrusion   %% settings removed as they don't make any sense
%     [ load = default,    % Dědíme veškerá nastavení od `default`.
%       factor   = 2000 ]      % Zdvojnásobení zděděných hodnot.
%     { family   = {*},
%       encoding = {EU1,EU2} } % Experimental Unicode: „kódování“ OpenType fontů.
%     { . = {500,500} }

\usepackage[all]{nowidow}
\usepackage{setspace}
    \setstretch{1.1}
\usepackage{paracol}

\usepackage{soulutf8}
\makeatletter
\DeclareRobustCommand*\magstylepar{\SOUL@sosetup
   \def\SOUL@preamble{%
     \edef\SOUL@soletterskip{\z@\@plus.25\fontdimen2\font\@minus\z@}%
     \edef\SOUL@soinnerskip{\the\fontdimen2\font
       \@plus\the\fontdimen3\font\@minus\the\fontdimen4\font}%
     \let\SOUL@soouterskip\SOUL@soinnerskip
     \SOUL@sopreamble}%
   \lefthyphenmin2\righthyphenmin2\SOUL@}
\font\SOUL@tt="CMU Typewriter Text Regular"
\setbox\z@\hbox{\SOUL@tt-}
\SOUL@ttwidth\wd\z@
\makeatother

\sloppy
\begin{document}

\begin{paracol}{3}

\switchcolumn[0]
\begin{description}\textbulgarian{\item{\bfseries{}АБСТРАКТНО СЪЩЕСТВИТЕЛНО (отвлечено съществително)}
\magstylepar{\small{}Съществително име, което назовава идеи, абстрактни понятия или нематериални неща напр. \textit{свобода}, \textit{справедливост} и~т.\,н.}}\end{description}

\vspace{2\baselineskip}\switchcolumn[1]
\begin{description}\textczech{\item{\bfseries{}ABSTRAKTUM (abstraktní podstatné jméno)}
\magstylepar{\small{}Substantivum postrádající denotát fyzické povahy. Abstrakta označují vlastnosti (\textit{lenost}, \textit{krása}), děje (\textit{běh}, \textit{plavání}), stavy (\textit{bdění}, \textit{spánek}) nebo propozice (\textit{podmínka}, \textit{okolnost}) jako třídy „objektů“, tj. jako něco, k~čemu lze referovat buď jako ke třídě, nebo k~prvku/prvkům třídy.}}\end{description}

\vspace{2\baselineskip}\switchcolumn[2]
\begin{description}\textpolish{\item{\bfseries{}RZECZOWNIK ABSTRAKCYJNY}
\magstylepar{\small{}Rzeczownik, którego znaczenia nie można ogarnąć podstawowymi zmysłami.}}\end{description}

\end{paracol}
\end{document}

output

|improve this answer|||||
  • Thanks o lat, Robert! This is exactly what I wanted. – Ashrak Jun 22 '19 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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