From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IFV+EcvUj2b/BQAAqHPOHw:P1 (envelope-from ) for ; Thu, 11 Jul 2024 12:49:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IFV+EcvUj2b/BQAAqHPOHw (envelope-from ) for ; Thu, 11 Jul 2024 14:49:15 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ap47vcMh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720702155; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=87h/Vl7JRW8kd0YGp3mfp78LJ/VZan0qy+ecHYQ+HDk=; b=eyw8n0hufcngzti+kDnnR+ufF2Qkj05hUwA37eqkJU37dgZlnoKHbju2wlwleQTnyn5DVd WNQ9e2b73lrT9od3y4nlDLkVx0Zqcplh5BadDQJAT0dS3FTM71vQIl5/AugHHw+xSmD7C9 xsj1mDgfW0rg4N9rnPE83aBlRGImCnGs0EyRBFhGREvH0H4op2L9ayyl2KwpNrEtZCuTZn qaj9AaEET1tnoLnv7CYm0g1iXremmscgd0gsfKOcK7V7vvI6D9edYPKfym6T05lW6XYhsd 7oWMiZ3m+WSnbOQb2VPEgacHjTxRSZ2e4rBXI/vxgYFU0nngybRtOu6nDSRT5Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720702155; a=rsa-sha256; cv=none; b=O2Vurhz9VqvfIcU4d03kEUq/4QJwGimgNwd8z3v7uYsjf/eM/WFJI+L7ymuSExaNSC1sZR IsTaMacux0NUuPTuskMS2itdVF6KPJcskf6kWPS/2l28Mgjsxhz7V8YdFAN/LwldU7rGHz ejTnBt4lNHCzelyY0wypV9rLizA1LwxypwKuY8Bi8RjzUpFrk0NeqWG4SdT7N93H11vAPf oDa09I1cDbdyevqsaW38ODUf+qE0ullMAnqSzXw1OYt/EiLb+fS2umQnG2/EYDo4EsNtjd MudR9uUE+qG3nUMNytRv9vEhWx4oY1b5hbVCbCbDutI6zyvQ2xmsUMYN49RvUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Ap47vcMh; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E693B63165 for ; Thu, 11 Jul 2024 14:49:14 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRtDd-0005Yx-8Q; Thu, 11 Jul 2024 08:48:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRtDX-0005Iu-Ja for emacs-orgmode@gnu.org; Thu, 11 Jul 2024 08:48:12 -0400 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRtDQ-0001P3-LZ for emacs-orgmode@gnu.org; Thu, 11 Jul 2024 08:48:11 -0400 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-25e919bec9eso365250fac.1 for ; Thu, 11 Jul 2024 05:48:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720702083; x=1721306883; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=87h/Vl7JRW8kd0YGp3mfp78LJ/VZan0qy+ecHYQ+HDk=; b=Ap47vcMhO7R3CgbVoKj+xw5DdhRrZ5LSRiMG5cgNJLZrMJr/bUx+RQF2k3gOiEKhrp 5IRhqKHB6joJBQunHcdNvv71dlIVUtTkCZ2tP6t26gDp9Up9b/4GExu61cNAantEiVRo qQTZo8PhBYjBiO9iipPSOV9WFqO0abr9EFefJNE6x5VXEjrpMkfNP5SD5g5EaQqzE6gD etoOB3LuxXVD9ahajtdPUQDld0DeP6ojjyFvTpvK0uLlhyektuzFSivy2oWJVk0dgpca QKwKqJxyFDv5Lke4ujCjq3aKxe5PP5T4xyHPAya9JuFfdT9XmSlUDn+tow+buzz+qDgZ YlCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720702083; x=1721306883; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=87h/Vl7JRW8kd0YGp3mfp78LJ/VZan0qy+ecHYQ+HDk=; b=jkr8daSN/uUqorJZSHQsYmk5K8jGobo53Hb6HPlewPdMEM/mpnd4BB18hVobbulLUv x4Kta7rkN6lSfbDNxho7c9y0nFw1lmGuVaz0/h8AmFpeI0M0OBIwgw8+GAtt+XRufhX5 DRgwAzIPci8TDygFOv/GSM7aSCHN46w0ZWyNRqWKQcOYQ8H1YDlB+XQLShkd4qmveGRb Ori3mHucVPjwgmiyx9cwGQzoWS3mwz9PUMKHIarY9k5Vk9zEKcZcd2fNeizgSaS16Iim 9rGkxRoA6KZ/NDfVs6uXJYZgI0pHNXkMtNU5MlhXNrsTIA+4iGquvxsVDlKBadzLUjgd l35w== X-Gm-Message-State: AOJu0YyEn6D3VEs39Am9cdHpWdyD62d1GeDrnLn7ocLECQb5R/7B+Wej 8kII5uEsZBs3LSe4WmpSGn2/40iZfuyZwlrzcNIpooHMXBNsyWgNnyra90elqHZOzPx5l5sytxW NJDJBj8oUBz0Z6+saoMH5ilVxlpT72USp X-Google-Smtp-Source: AGHT+IHOve5/01hjAgXmyX1TSIL+M/1oxJqTxGthnq/ZLK5tAsQrco5Soio427FSYvmMKmu+HZgMCrMVs2oulsJKF14= X-Received: by 2002:a05:6870:1588:b0:25e:1633:cb1d with SMTP id 586e51a60fabf-25eaec553e5mr6864906fac.58.1720702082899; Thu, 11 Jul 2024 05:48:02 -0700 (PDT) MIME-Version: 1.0 References: <87jzhu724w.fsf@gmail.com> <87r0c01fjf.fsf@gmail.com> In-Reply-To: From: mahmood sheikh Date: Thu, 11 Jul 2024 15:47:51 +0300 Message-ID: Subject: Re: figures not exported properly by ox-latex To: Karthik Chikmagalur Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="0000000000006a6b44061cf82ccc" Received-SPF: pass client-ip=2001:4860:4864:20::32; envelope-from=mahmod.m2015@gmail.com; helo=mail-oa1-x32.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.74 X-Spam-Score: -6.74 X-Migadu-Queue-Id: E693B63165 X-Migadu-Scanner: mx11.migadu.com X-TUID: oxyDI6/zRKUQ --0000000000006a6b44061cf82ccc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable im fairly certain that at the time i sent this email, ox-latex was failing to insert \label and \caption too after images in latex exports (like ox-html to html exports). but perhaps someone made a change that fixed that= . the fact that ox-latex even inserts \caption and \label tells me that it was the intention of the maintainer of ox-latex to handle latex blocks preceded by a `#+caption` as figures. so it would be natural if org inserted the figure environment itself like it does with images preceded by `#+caption`. i hope this reasoning does make sense to you? in ox-html, the function `org-html--wrap-image` is used to wrap an exported image with a `
` html environment with a caption and label, but it doesnt happen for me. after some more digging, i think inserting the `figure` environments automatically in latex exports may be undesired behavior and it would be preferred that the user do that themselves in the org document, because `org-latex--caption/label-string` checks for a `figure` or `listing` environment apparently, which tells me that the author expected the user to insert the figure environment themselves. another reason is that the user may use another, differently environment that accepts a \caption too. thanks p.s. sorry i keep hitting the "forward" button instead of the "forward all" button so you may receive duplicate emails. On Thu, Jul 11, 2024 at 11:59=E2=80=AFAM mahmood sheikh wrote: > this is an example of what i mean: > #+begin_src org > #+name: fig-switching-circuit-kmap-1 > #+caption: karnaugh table of \(p\) > \begin{tikzpicture} > \karnaughmap[function=3D, defaultmap=3D8, omitzeros=3Dfalse, omitidx, > variables=3Dxyz]{01101001} > \end{tikzpicture} > #+end_src > i vaguely recall org mode automatically turning captioned > tikzpicture's into figures by wrapping them in a figure environment. > currently, this is what i get when i export to latex: > #+begin_src latex > \begin{tikzpicture} > \karnaughmap[function=3D, defaultmap=3D8, omitzeros=3Dfalse, omitidx, > variables=3Dxyz]{01101001} > \caption{\label{fig-switching-circuit-kmap-1}karnaugh table of \(p\)} > \end{tikzpicture} > a tikzpicture environment doesnt expect a \caption and therefore this > gives an error. to avoid this the environment has to be wrapped manually = by > the user by a \begin{figure} environment, but i think this may be redunda= nt > because anything that takes a #+caption is expected to be a figure. > also, ox-html doesnt handle those anymore, it used to handle #+caption: > and insert it into the generated html output, it simply ignores that now. > example: > #+begin_src org > #+name: fig-switching-circuit-1 > #+caption: implementation of \(p\) > [[attachment:circuit.svg]] > #+end_src > ox-html generates the following html: > #+begin_src html >
> #+end_src > its not a different problem, its basically that after the new overhaul > figures are being handled differently than i recall, but i cant say for > sure. although the report above about the exported circuit.svg img does > make sense even if it wasnt handled the way i'd expect before the overhau= l. > thanks > > On Thu, Jul 11, 2024 at 11:47=E2=80=AFAM Karthik Chikmagalur < > karthikchikmagalur@gmail.com> wrote: > >> > it might've been fixed for figures as its been a while, but shouldnt >> > latex environments with #+caption: and #+name: above them be exported >> > as figures? because currently the user has to write \begin{figure} and >> > \end{figure} explicitly which would work >> >> This is not the case. The LaTeX output I posted in my previous response >> was the exported output from your example Org source. I did not add the >> \begin{figure} and \end{figure} tags manually. >> >> Karthik >> > --0000000000006a6b44061cf82ccc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
im fairly certain that at the time i sent= this email, ox-latex was failing to insert \label and \caption too after i= mages in latex exports (like ox-html to html exports). but perhaps someone = made a change that fixed that.
the fact that ox-latex even inserts \cap= tion and \label tells me that it was the intention of the maintainer of ox-= latex to handle latex blocks preceded by a `#+caption` as figures. so it wo= uld be natural if org inserted the figure environment itself like it does w= ith images preceded by `#+caption`. i hope this reasoning does make sense t= o you?
in ox-html, the function `org-html--wrap-image` is used to= wrap an exported image with a `<figure>` html environment with a cap= tion and label, but it doesnt happen for me.
after some more digg= ing, i think inserting the `figure` environments automatically in latex exp= orts may be undesired behavior and it would be preferred that the user do t= hat themselves in the org document, because `org-latex--caption/label-strin= g` checks for a `figure` or `listing` environment apparently, which tells m= e that the author expected the user to insert the figure environment themse= lves. another reason is that the user may use another, differently environm= ent that accepts a \caption too.
thanks
p.s. sorry i ke= ep hitting the "forward" button instead of the "forward all&= quot; button so you may receive duplicate emails.

On Thu, Jul 11= , 2024 at 11:59=E2=80=AFAM mahmood sheikh <mahmod.m2015@gmail.com> wrote:
this i= s an example of what i mean:
#+begin_src org
=C2=A0 #+name: fig-swit= ching-circuit-kmap-1
=C2=A0 #+caption: karnaugh table of \(p\)
=C2=A0= \begin{tikzpicture}
=C2=A0 =C2=A0=C2=A0\karnaughmap[function=3D, defaul= tmap=3D8, omitzeros=3Dfalse, omitidx, variables=3Dxyz]{01101001}
=C2=A0 = \end{tikzpicture}
#+end_src
i vaguely recall org mode automatically t= urning captioned tikzpicture's=C2=A0into=C2=A0figures by wrapping them = in a figure environment. currently, this is what i get when i export to lat= ex:
#+begin_src latex
=C2=A0 \begin{tikzpicture}
=C2=A0 =C2=A0= =C2=A0\karnaughmap[function=3D, defaultmap=3D8, omitzeros=3Dfalse, omitidx,= variables=3Dxyz]{01101001}
=C2=A0 =C2=A0 \caption{\label{fig-switching-= circuit-kmap-1}karnaugh table of \(p\)}
=C2=A0 \end{tikzpicture}
a ti= kzpicture environment doesnt=C2=A0expect a \caption and therefore this give= s an error. to avoid this the environment has to be wrapped manually by the= user by a \begin{figure} environment, but i think this may be redundant be= cause anything that takes a #+caption is expected to be a figure.
also,= ox-html doesnt=C2=A0handle those anymore, it used to handle #+caption: and= insert it into the generated html output, it simply ignores that now. exam= ple:
#+begin_src org
=C2=A0 #+name= : fig-switching-circuit-1
=C2=A0 #+caption: implementation of \(p\)
= =C2=A0 [[attachment:circuit.svg]]
#+end_src
ox-html generates = the following html:
#+begin_src html
=C2=A0 <img src=3D"/circ= uit.svg" /><br />
#+end_src
its not a different probl= em, its basically that after the new overhaul figures are being handled dif= ferently than i recall, but i cant=C2=A0say for sure. although the report a= bove about the exported circuit.svg img does make sense even if it wasnt ha= ndled the way i'd expect before the overhaul.
thanks

On = Thu, Jul 11, 2024 at 11:47=E2=80=AFAM Karthik Chikmagalur <karthikchikmagalur@gma= il.com> wrote:
> it might've been fixed for figures as its been a while, but = shouldnt
> latex environments with #+caption: and #+name: above them be exported<= br> > as figures? because currently the user has to write \begin{figure} and=
> \end{figure} explicitly which would work

This is not the case.=C2=A0 The LaTeX output I posted in my previous respon= se
was the exported output from your example Org source.=C2=A0 I did not add t= he
\begin{figure} and \end{figure} tags manually.

Karthik
--0000000000006a6b44061cf82ccc--