Sebastian Sauer
Sebastian Sauer

Reputation: 1673

How to supress extra space after period in rmarkdown Latex?

I have .rmd file which I would like to compile to latex/pdf. That's the issue:

Latex puts more space after period characters such as "." or "?". Sometimes is not useful. I would like to supress this behavior in rmarkdown (knitr) files.

Consider this .rmd file:

---
output: pdf_document
---

Prof. Dr. hc. mult. now. ay. I. Ch. Weiss-Ois  

I would expect less space after each period than is rendered.

I have tried these without success:

Prof. Dr.\ hc.\@ mult. now. ay. I. Ch. Weiss-Ois  
Prof. Dr.~hc.\@ mult. now. ay. I. Ch. Weiss-Ois

I have looked up this link where the Pandoc author replies to a similar question but it seems without solution.

Software used:

Upvotes: 4

Views: 2123

Answers (2)

mb21
mb21

Reputation: 39179

Pandoc simply inserts non-breaking spaces after some abbreviations. They have, however, still the same width. Try e.g.

foo\hspace{.15em}bar

Upvotes: 2

David Klotz
David Klotz

Reputation: 2431

Are you sure they don't work, or are the differences just too small to detect? If I do the whole text this way, the cumulative difference is noticeable when comparing lines side by side:

Prof. Dr. hc. mult. now. ay. I. Ch. Weiss-Ois

Prof.\ Dr.\ hc.\ mult.\ now.\ ay.\ I.\ Ch.\ Weiss-Ois

\frenchspacing 
Prof. Dr. hc. mult. now. ay. I. Ch. Weiss-Ois

Upvotes: 3

Related Questions