Discussion:
Forced space
(too old to reply)
db
2024-07-01 16:22:12 UTC
Permalink
In a text I'm writing, I have this line

is \begin{otherlanguage}{russian}река \end{otherlanguage}\;(rieka),

If I don't put the \; in and put a space in instead, there is
no space after compiling. As it is with \;, there is a space,
but now "(rieka)" is highlighted yellow. How come? What is the
best way to force a space where I have that \; ?
--
db
Pieter van Oostrum
2024-07-02 12:02:46 UTC
Permalink
Post by db
In a text I'm writing, I have this line
is \begin{otherlanguage}{russian}река \end{otherlanguage}\;(rieka),
If I don't put the \; in and put a space in instead, there is
no space after compiling. As it is with \;, there is a space,
but now "(rieka)" is highlighted yellow. How come? What is the
best way to force a space where I have that \; ?
--
db
When I put your line in a minimal LaTeX document with \; replaced by a space, there is a space between 'река' and '(rieka)'. I think this is the space that is after 'река' in the source.

And what do you mean by highlighted yellow?
--
Pieter van Oostrum <***@vanoostrum.org>
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
Ulrich D i e z
2024-07-02 12:22:14 UTC
Permalink
Post by db
In a text I'm writing, I have this line
is \begin{otherlanguage}{russian}река \end{otherlanguage}\;(rieka),
If I don't put the \; in and put a space in instead, there is
no space after compiling. As it is with \;, there is a space,
but now "(rieka)" is highlighted yellow. How come? What is the
best way to force a space where I have that \; ?
You do not provide sufficient information for reproducing and tracking
down the problem. Therefore the only option is resorting to guesswork:

Probably \end{otherlanguage} does \ignorespacesafterend.

What happens when you do:

\newcommand\myspacemacro{ }
...
\begin{otherlanguage}{russian}река\end{otherlanguage}\myspacemacro(rieka),

?

Or:

\newcommand\foo[1]{#1}
...
\begin{otherlanguage}{russian}река\end{otherlanguage}\foo{ }(rieka),

?

Your remark about yellow highlighting does not provide useful
information at all as it is not clear what exactly you look at and what
programs you use and what packages/tools you might use for achieving
whatsoever highlighting.

Ulrich
Dr Engelbert Buxbaum
2024-07-03 08:21:39 UTC
Permalink
In article <v5ul3k$15am2$***@dont-email.me>, ***@gmail.com
says...
Post by db
In a text I'm writing, I have this line
is \begin{otherlanguage}{russian}???? \end{otherlanguage}\;(rieka),
If I don't put the \; in and put a space in instead, there is
no space after compiling. As it is with \;, there is a space,
but now "(rieka)" is highlighted yellow. How come? What is the
best way to force a space where I have that \; ?
Have you tried using "\ "? That is the usual command to enter a space
after a TeX-command so it does not get eaten. Since you don't give a
minimal compilable example, it is difficult to give more specific
advice.
Ulrich D i e z
2024-07-03 15:41:07 UTC
Permalink
Post by Dr Engelbert Buxbaum
Have you tried using "\ "? That is the usual command to enter a space
after a TeX-command so it does not get eaten. Since you don't give a
minimal compilable example, it is difficult to give more specific
advice.
You use <control space> to insert that amount of discardable glue that
you get by a <space token> when the space factor is 1000.
Usually this is what you want in situations where preventing the eating
of spaces is neded.

Whether <control space> or <space token> after the
otherlanguage-environment is better for inserting discardable glue might
depend on behavior desired in the case of the phrase within the
otherlanguage-environment ending with punctuation.

Sincerely

Ulrich

Loading...