0

I want to remove the spaces in the titlemark, such as "H O W", I want it show like "HOW", but I do not know how to do this?

7
  • Does the command \Let\String\Spacechar\Relax work?
    – Peter Yang
    Apr 16, 2022 at 17:48
  • 3
    Post a minimal working example. Without knowing your document class or other settings, I don't see how we could tell how it got like that in the first place.
    – frabjous
    Apr 16, 2022 at 18:37
  • @frabjous Ok, let me give you an example, givan any string, say "H O W", we need to remove all the space in the string, namely, we want to obtain the straing "HOW", how should we do?
    – Peter Yang
    Apr 16, 2022 at 18:53
  • {\catcode32=9\relax\catcode`\ =9\relax H O W} might work. But I'm not sure that's the right strategy because I don't understand the use case.
    – frabjous
    Apr 16, 2022 at 19:03
  • @frabjous Thank you very much Fraabjous, what is meaning of {\catcode32=9\relax\catcode`\ =9\relax } ? could you explain?and how can test it?
    – Peter Yang
    Apr 16, 2022 at 19:20

2 Answers 2

2

You can set the value to the \spaceskip primitive register:

H O W                         % default spaces between letters H,O,W

{\spaceskip=1em\relax H O W}  % bigger spaces between letters H,O,W

{\spaceskip=1sp\relax H O W}  % no spaces between H,O,W, kerning disabled

{\catcode`\ =9\relax H O W}   % no spaces between H,O,W, kerning enabled

Note, that value 1sp is "almost zero" but it isn't exactly zero because zero value means: use default space, no \spaceskip value. But this solution doesn't allow kerning.

If you want to have kerning activated then use the example from the last line. The spaces are completely ignored here.

0

I have found out a very simple way to solve this problem by writing one command

\def\newdelespace{\let\yourspaceChar\relax},

here command \yourspaceChar is defined as follows

\def\yourspaceChar{\hskip \f@size \p@}

Then use the command \newdelespace anywhere you want to remove all its space! it works, for example:

\makeatletter
\def\yourspaceChar{\hskip \f@size \p@}
\def\newdelespace{\let\yourspaceChar\relax}
\makeatother

\begin{document}
H\yourspaceChar O \yourspaceChar W

{\newdelespace H\yourspaceChar O\yourspaceChar W}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged .