emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* figures not exported properly by ox-latex
@ 2024-02-02 11:39 mahmood sheikh
  2024-02-02 11:46 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: mahmood sheikh @ 2024-02-02 11:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

im on tecosaur's dev branch (version 9.7-pre)
i have the following in an org file:
```org
#+name: fig-switching-circuit-1
#+caption: implementation of \(p\)
[[attachment:circuit.svg]]
```
it gets turned into this
```
\includesvg[width=.9\linewidth]{/home/mahmooz/brain/notes/data/9e/5ba2ce-c383-4396-a2cb-891465f14d51/circuit}\\[0pt]
```
which isnt the behavior described in the docs:
> When captions follow the method as described in Captions, the LaTeX
export back-end wraps the picture in a floating ‘figure’ environment.
this is from https://orgmode.org/manual/Images-in-LaTeX-export.html

[-- Attachment #2: Type: text/html, Size: 788 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: figures not exported properly by ox-latex
  2024-02-02 11:39 figures not exported properly by ox-latex mahmood sheikh
@ 2024-02-02 11:46 ` Ihor Radchenko
  2024-07-05  9:20   ` mahmood sheikh
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2024-02-02 11:46 UTC (permalink / raw)
  To: mahmood sheikh, Timothy, Karthik Chikmagalur; +Cc: emacs-orgmode

mahmood sheikh <mahmod.m2015@gmail.com> writes:

> im on tecosaur's dev branch (version 9.7-pre)
> i have the following in an org file:
>...

CCing Timothy and Karhik.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: figures not exported properly by ox-latex
  2024-02-02 11:46 ` Ihor Radchenko
@ 2024-07-05  9:20   ` mahmood sheikh
  0 siblings, 0 replies; 3+ messages in thread
From: mahmood sheikh @ 2024-07-05  9:20 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Timothy, Karthik Chikmagalur, emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 860 bytes --]

hi,
i made a slight change to wrap the exported latex environments in a figure
environment so that the captions and labels get placed properly, this patch
i created on teco's branch.
i dont expect it to get accepted as it may be a naive fix and i may be
missing something, but it may point out to someone else where the issue is.
thanks!

On Fri, Feb 2, 2024 at 1:43 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> mahmood sheikh <mahmod.m2015@gmail.com> writes:
>
> > im on tecosaur's dev branch (version 9.7-pre)
> > i have the following in an org file:
> >...
>
> CCing Timothy and Karhik.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #1.2: Type: text/html, Size: 1515 bytes --]

[-- Attachment #2: latex_env_captions.patch --]
[-- Type: text/x-patch, Size: 534 bytes --]

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 46a3cae..11c3fc5 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -3005,7 +3005,10 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
 	;; the section instead).  Also insert caption if `latex-environment'
 	;; is not a math environment.
 	(with-temp-buffer
+          (insert "\\begin{figure}\n")
 	  (insert value)
+          (goto-char (point-max))
+          (insert "\\end{figure}")
 	  (if caption-above-p
 	      (progn
 		(goto-char (point-min))

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-05  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 11:39 figures not exported properly by ox-latex mahmood sheikh
2024-02-02 11:46 ` Ihor Radchenko
2024-07-05  9:20   ` mahmood sheikh

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).