From mboxrd@z Thu Jan 1 00:00:00 1970 From: Godefroy Subject: Bug and quick bugfix Date: Wed, 9 Oct 2019 00:19:57 +0200 Message-ID: <6fda0619-e300-2b38-3070-ba48c25275cb@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53769) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHxpq-0001K4-QP for emacs-orgmode@gnu.org; Tue, 08 Oct 2019 18:20:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHxpp-0004XI-DT for emacs-orgmode@gnu.org; Tue, 08 Oct 2019 18:20:02 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:40302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHxpp-0004WF-2f for emacs-orgmode@gnu.org; Tue, 08 Oct 2019 18:20:01 -0400 Received: by mail-wr1-x429.google.com with SMTP id h4so40792wrv.7 for ; Tue, 08 Oct 2019 15:20:00 -0700 (PDT) Received: from [192.168.1.41] (static-176-185-165-179.axione.abo.bbox.fr. [176.185.165.179]) by smtp.gmail.com with ESMTPSA id e9sm5589114wme.3.2019.10.08.15.19.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Oct 2019 15:19:58 -0700 (PDT) Content-Language: en-US-large 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" To: emacs-orgmode@gnu.org Hello, As it is my first email to the list, please forgive me if I do anything the wrong way. I recently encountered a bug when exporting an org file to LaTeX: when generating a figure with a caption, the LaTeX result has the following shape: \begin{figure} … \caption{\label{…} Content of the caption} \end{figure} When compiling to LaTeX, the carriage return causes a indesirable white space in some cases. What I would expect is: \begin{figure} … \caption{Content of the caption} \label{…} \end{figure} To fix this, I have changed the org-latex--caption/label-string function in ox-latex.el on lines 1314 and 1315: (format (if nonfloat "\\captionof{%s}%s{%s%s}\n"  "\\caption%s%s{%s%s}\n") becomes (format (if nonfloat "\\captionof{%s}%s{%s}\n%s"  "\\caption%s%s{%s}\n%s") I hope that this bug report and the quickfix I found will help you. Sincerely, Godefroy Vannoye