From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: inter-word space in org -> latex Date: Mon, 14 Sep 2015 18:50:20 +0200 Message-ID: <87y4g93pyr.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWxe-0004Al-LJ for emacs-orgmode@gnu.org; Mon, 14 Sep 2015 12:50:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbWxZ-0004ML-EG for emacs-orgmode@gnu.org; Mon, 14 Sep 2015 12:50:34 -0400 Received: from plane.gmane.org ([80.91.229.3]:53675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWxZ-0004M8-3A for emacs-orgmode@gnu.org; Mon, 14 Sep 2015 12:50:29 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZbWxX-0000W0-LG for emacs-orgmode@gnu.org; Mon, 14 Sep 2015 18:50:27 +0200 Received: from 62.80.108.12 ([62.80.108.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2015 18:50:27 +0200 Received: from rasmus by 62.80.108.12 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Sep 2015 18:50:27 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Dan, Dan Griswold writes: > Dear org-mode community, > > In LaTeX, a space after a period is treated as an inter-sentence space, > which is wider than an inter-word space. This can lead to overly wide > spacing after a period that ends an abbreviation rather than a space. The > way to cover this in LaTeX is to use a backslash prior to the space, as in: > > Mr.\ Henry Higgins. > > I have some documents in org that have the same issue: periods concluding > abbreviations, with the result that LaTeX puts more space than I want after > the abbreviation. Yet the use of "\ " does not work, as the backslash is > exported to LaTeX as a literal backslash. > > How should I mark in org mode that I want a space following a period > concluding an abbreviation to be seen by LaTeX as an interword space? .@@latex:\ @@ Though I practice I type double space after full sentences and when there's a single space and small letters. (defun rasmus/org-latex-filter-nobreaks-double-space (text backend info) "Tries to export \"S1. S2\" as \"S1.\\ S2\", while letting \"S1. S2\" be exported without tilde" ;; TODO: error with this output: ;; [[file:nasty dir/Screenshot. from 2015-03-05 19:05:00.png]] (when (and text (org-export-derived-backend-p backend 'latex)) (let ((preamble (or (string-match-p "\\\\begin{document}" text) 0)) (case-fold-search nil)) (concat (substring text 0 preamble) (replace-regexp-in-string "\\. \\([^ A-Z\n]\\)" ".\\\\ \\1" (substring text preamble)))))) (add-to-list 'org-export-filter-final-output-functions 'rasmus/org-latex-filter-nobreaks-double-space) Or, (defcustom rasmus/org-latex-unicode-to-tex '((" " "~") (" " "\\,") ("​" "")) "list of re rep pairs which are replaced during latex export") (defun rasmus/org-latex-unicode-to-tex (text backend info) "Replace unicode strings with their TeX equivalents. Currently: ' ' (no break space) to '~' ' ' (thin space) to '\,' '​' (zero width space) to ''." (when (org-export-derived-backend-p backend 'latex) (cl-loop for (re rep) in rasmus/org-latex-unicode-to-tex do (setq text (replace-regexp-in-string re rep text t t))) text)) (add-to-list 'org-export-filter-final-output-functions 'rasmus/org-latex-unicode-to-tex) Rasmus -- I hear there's rumors on the, uh, Internets. . .