From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug and quick bugfix Date: Sun, 13 Oct 2019 09:26:42 +0200 Message-ID: <87h84dcdhp.fsf@nicolasgoaziou.fr> References: <6fda0619-e300-2b38-3070-ba48c25275cb@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45868) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJYHH-0001Fl-E7 for emacs-orgmode@gnu.org; Sun, 13 Oct 2019 03:26:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJYHG-0005YI-8l for emacs-orgmode@gnu.org; Sun, 13 Oct 2019 03:26:55 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:51623) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iJYHG-0005WP-2m for emacs-orgmode@gnu.org; Sun, 13 Oct 2019 03:26:54 -0400 In-Reply-To: <6fda0619-e300-2b38-3070-ba48c25275cb@gmail.com> (Godefroy's message of "Wed, 9 Oct 2019 00:19:57 +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" To: Godefroy Cc: emacs-orgmode@gnu.org 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} > =E2=80=A6 > \caption{\label{=E2=80=A6} > 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} > =E2=80=A6 > \caption{Content of the caption} > \label{=E2=80=A6} > \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" > =C2=A0"\\caption%s%s{%s%s}\n") > > becomes > > (format (if nonfloat "\\captionof{%s}%s{%s}\n%s" > =C2=A0"\\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. Regards, --=20 Nicolas Goaziou