# Controlling an Interpunct as a Spacing Character?

I am using XeLaTeX and the fontspec package to work with text that uses UTF-8 interpuncts (·) instead of spaces.

However, interpuncts are not understood by 'TeX to be spacing characters, and so long lines of text using interpuncts overflow the page boundary.

Example:

\documentclass[openany]{book}
\usepackage{fontspec}

\begin{document}
Lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem·ipsum·lorem...
\end{document}


I know that the seqsplit package exists, but that seems to be more for splitting long strings at wrapping boundaries (DNA/RNA transcription) rather than splitting in cases like this.

Two inter-related questions:

• Is there a package or command that could be used to define the interpunct character generally as a spacing character?
• Would it be possible to eliminate the interpunct character when wrapping occurs? That is, the line wrap replaces the need for the interpunct character.

(Note: I am using interpunct characters only as spaces, not for any of the other common usages of interpuncts, so this solution can break other usages of interpuncts.)

A variation on https://tex.stackexchange.com/a/44951/4427 (see there for attributions).

\documentclass{article}
\usepackage{fontspec}
\usepackage{newunicodechar}

\newcommand{\spaceinterpunct}{\unskip
\hskip 2pt plus 1pt minus 1pt
\hskip 2pt plus 1pt minus 1pt
\ignorespaces}
\newsavebox\interpunctbox
\sbox\interpunctbox{·}

\newunicodechar{·}{\spaceinterpunct}

\begin{document}

\end{document}


You can even break lines (after or before the interpunct, it doesn't matter. The following code with line breaks will produce the same output.

Nulla·malesuada·porttitor·diam.·Donec·felis·erat,·
congue·non,·volutpat·at,·tincidunt·tristique,·libero.·
Vivamus·viverra·fermentum·felis.·Donec·nonummy·