From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Lomov Subject: Re: Bug and quick bugfix Date: Sun, 13 Oct 2019 19:21:36 +0800 Message-ID: <20191013112136.GB1540@smoon.bkoty.ru> References: <6fda0619-e300-2b38-3070-ba48c25275cb@gmail.com> <87h84dcdhp.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="St7VIuEGZ6dlpu13" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34528) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJbwY-0007nF-M1 for emacs-orgmode@gnu.org; Sun, 13 Oct 2019 07:21:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJbwV-0004gz-HH for emacs-orgmode@gnu.org; Sun, 13 Oct 2019 07:21:44 -0400 Received: from forward105p.mail.yandex.net ([77.88.28.108]:36886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iJbwV-0004fU-02 for emacs-orgmode@gnu.org; Sun, 13 Oct 2019 07:21:43 -0400 Content-Disposition: inline In-Reply-To: <87h84dcdhp.fsf@nicolasgoaziou.fr> 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 , emacs-orgmode@gnu.org --St7VIuEGZ6dlpu13 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, ** Nicolas Goaziou [2019-10-13 09:26:42 +0200]: > Hello, >=20 > Godefroy writes: >=20 >> 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") >=20 > 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, >=20 > --=20 > Nicolas Goaziou --- WBR, Vladimir Lomov --=20 QOTD: "I thought I saw a unicorn on the way over, but it was just a horse with one of the horns broken off." --St7VIuEGZ6dlpu13 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQaopaKwcQWyz7yQfAHGfInzJc4BQUCXaMIwAAKCRAHGfInzJc4 BUcyAQDeKVaxDok9VkwlgKcX6zCZJio/dTZoA3q6mO0OW6Xc6gEAg4nDK3eSQ8GS m0zwzcwTHBshojt3xUEUOnjFwoulUAo= =OzMW -----END PGP SIGNATURE----- --St7VIuEGZ6dlpu13--