From mboxrd@z Thu Jan 1 00:00:00 1970 From: Godefroy Subject: Re: Bug and quick bugfix Date: Tue, 15 Oct 2019 11:09:27 +0200 Message-ID: References: <6fda0619-e300-2b38-3070-ba48c25275cb@gmail.com> <87h84dcdhp.fsf@nicolasgoaziou.fr> <20191013112136.GB1540@smoon.bkoty.ru> 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]:35176) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKIpg-0002yi-4T for emacs-orgmode@gnu.org; Tue, 15 Oct 2019 05:09:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKIpf-0004lY-0D for emacs-orgmode@gnu.org; Tue, 15 Oct 2019 05:09:31 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:54581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iKIpe-0004lH-Qg for emacs-orgmode@gnu.org; Tue, 15 Oct 2019 05:09:30 -0400 Received: by mail-wm1-x329.google.com with SMTP id p7so19968434wmp.4 for ; Tue, 15 Oct 2019 02:09:30 -0700 (PDT) In-Reply-To: <20191013112136.GB1540@smoon.bkoty.ru> 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: Vladimir Lomov , emacs-orgmode@gnu.org Thanks for your replies. Your solution works for me, thank you a lot for your work. Sincerely, Godefroy Vannoye On 10/13/19 1:21 PM, Vladimir Lomov wrote: > Hello, > ** Nicolas Goaziou [2019-10-13 09:26:42 +0200]: > >> Hello, >> >> Godefroy writes: >> >>> 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") >> IIRC, the label has to be included in the caption command. I applied >> a different solution. Let me know if that works for you. > There is no strict rule but a general good practice: for caption > material put label command inside the caption macro. Otherwise there > might be some side effects. > >> Regards, >> >> -- >> Nicolas Goaziou > --- > WBR, Vladimir Lomov >