Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rmarkdown space without line break ~

In Latex, it is possible to insert a space that does not end a line by a ~ character. So writing Fig.~\ref{fig:f1} will write as

Fig. 1

and it makes sure that text wrapping never breaks a line between Fig. and the number 1.

However, in Rmarkdown writing Fig.~\@ref(fig:f1), Fig.\~\@ref(fig:f1), or Fig.\\~\@ref(fig:f1 translates to Fig.\textasciitilde{}\ref{fig:f1} giving

Fig.~1

in the output. How do you insert the equivalent of ~ in rmarkdown? I am actually using bookdown.

like image 504
highBandWidth Avatar asked Jun 06 '16 19:06

highBandWidth


1 Answers

Insert a non breaking space manually using regular HTML:

...Fig. \@ref{fig:f1}...
like image 86
Werner Avatar answered Sep 17 '22 17:09

Werner