1

is there a way to achieve constant word spacing in paragraph using latex/ luatex/ xelatex/ context? I came across posts that mention Tex applies glue between words, but am not sure how to exactly control them, if at all it’s possible (am more hopeful that there is a lualatex way of doing that). I guess it can be achieved in InDesign by specifying same value for minimum, desirable, and maximum: https://creativepro.com/the-complete-guide-to-word-spacing/

codepoet
  • 1,316
  • 1
    Welcome to TEXSE. Please show us an example of your problem. Do not add external links as it may go dead over time. – Raaja_is_at_topanswers.xyz Jul 13 '19 at 05:51
  • 1
    The ragged2e package may help. \raggedright too, but \RaggedRight from ragged2e is likely to find better-looking line breaks. – frougon Jul 13 '19 at 06:27
  • See also https://tex.stackexchange.com/questions/19236/how-to-change-the-interword-spacing and https://tex.stackexchange.com/questions/23921/how-to-shorten-shrink-spaces-between-words – David Purton Jul 13 '19 at 06:28
  • 1
    If you fix the space between words, then your justification alignment went wrong, so please confirm whether you require both justification with space fixing or only space fixing? – MadyYuvi Jul 13 '19 at 07:23
  • 1
    Take also in mind \parfillskip, \emergencystretch and the microtype package. – Fran Jul 13 '19 at 07:59
  • 1
    Note also word spacing in InDesign is a paragraph property, while in TeX it's a font property (which, for me, usually makes a lot more sense). – Javier Bezos Jul 13 '19 at 10:58

1 Answers1

1

Really constant word spacing seems very hard to get, but however, there is an aspect of how we observe the distance between the last letter of a word and the first of the following one.

In the picture below in the last or second last line the distance between »of« and »words« seems smaller compared to »match« and »the«.

I played around a bit with the rich options the fontspec package offers. The option OpticalSize has an effect, while the justifying and RaggedRight environments of the ragged2e package don't.

However, you will need a broad right margin, because the usual word wrap doesn't word, if the stretch and the shrink of the interword space become zero, as with WordSpace={1,0,0}.

\documentclass[english, fontsize=14pt, parskip=full, usegeometry]{scrartcl}
\usepackage{babel}
\usepackage{fontspec}
\usepackage{roboto-mono}
\usepackage[sfdefault]{FiraSans}
%\usepackage{ragged2e}
\usepackage{blindtext}
\usepackage[right=5cm]{geometry}
%\frenchspacing
\begin{document}
\fontspec{FiraSans-Regular.otf}[WordSpace={1,0,0}, PunctuationSpace=0, Kerning=Off,
OpticalSize=0]

\blindtext

\ttfamily{}
\fontspec{RobotoMono-Regular.otf}[WordSpace={.5,0,0}, PunctuationSpace=0,
%OpticalSize=0
]

%\fontspec{RobotoMono-Regular.otf}
\blindtext

\fontspec{RobotoMono-Regular.otf}[WordSpace={.5,0,0}, PunctuationSpace=0,
OpticalSize=0
]
%\begin{RaggedRight}
  \blindtext{}
%\end{RaggedRight}

\end{document}

printout pic

Keks Dose
  • 30,892