To put faint, non-kerning lines between syllables, is there a way for the command to detect if it is adjacent to a space and if so to (a) restore the space, and (b) place the bar midway? (Alternately, user could place \m between spaces, like to be, \m or not \m to be, in which case code should detect that and back up half a space to place bar.)
PSEUDOCODE:
Am I adjacent to a space?
Y: restore the space (that I have destroyed by coming before it and being a command), and place bar in the middle of that space
N: place bar between letters without impacting letter spacing
\documentclass[varwidth]{standalone} \usepackage{xcolor}\newcommand\m{% {% \color{gray!50}% \rule[-\dp\strutbox]{0.3pt}% {\baselineskip}% }% }%
\begin{document}
\noindent To be,\m or not\m to be,\m that is\m the question:\ Whether\m 'tis nob\m ler in\m the mind\m to suffer\ The slings\m and ar\m rows of\m outrage\m ous fortune,\ Or to\m take arms\m against\m a sea\m of troubles
\end{document}

\mit would be easier to use a syntax such as|soTo be,| or not| to beandnob|lerthen the space is tokenised (or not) – David Carlisle Jan 25 '23 at 12:02\mit would be much easier to use | (which you still define to be the grey rule). Also what to you mean by unchanged do you wantnob|lerthe same width asnoblerwith the rule over-printing theblslightly, or do you wantnob|lerto be wider by the width of the rule? – David Carlisle Jan 25 '23 at 12:16|an active character and define it as whatever kind of vertical rule you want. – Gaussler Jan 25 '23 at 12:49\m! Oooo, I like the idea of "wider by the width of the rule", both for words and inter-word spaces. – commonhare Jan 25 '23 at 13:13\catcode`|=\activeand then\def|{<whatever you want>}. – Gaussler Jan 25 '23 at 13:22