emacs-humanities
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-humanities] Images in org mode


From: Richard Teverson
Subject: Re: [emacs-humanities] Images in org mode
Date: Wed, 17 Aug 2022 22:43:52 -0400

Hi Juan Manuel,

Thanks for your help!

I’ll check out org publish, thanks for the tip.

Org attach I’ve played around with before. The way I understood it 
worked—-—with id numbers in properties drawers—-doesn’t suit the way my mind 
works, all the id numbers blur into one.

Your package looks really interesting, and the screen shot of using helm to see 
all the figures in a file might be what I need to feel organized.

I tried to reproduce the problems I’d been having with opening odt files 
exported from really large org files, and that was my fault. They were caused 
by opening the odt files in Word---opening them in Libre Office was fine. So 
that wasn’t an emacs problem at all, apologies.

> Do you mean automatically create a #+name keyword for the image every
> time you add one?

I will use a yasnippet for this. I realise from experimenting with odt export 
that it automatically creates figure numbers, so I don’t need to number them in 
org itself.

Thanks again,
Richard


On 17 Aug 2022, at 10:33, Juan Manuel Macías wrote:

> Hi, Richard,
>
> Richard Teverson writes:
>
>> Dear All,
>>
>> I’m on the hunt for good ideas about how to write image-heavy academic
>> papers in org mode, and then export them sensibly to Word, which is
>> typically the required final format in my field.
>>
>> I’m looking for three things:
>>
>> 1 How do people store images during the research and writing phase? I find:
>> +#NAME:
>> +#CAPTION:
>> [[link]]
>>
>> in the document rather awkward to keep altogether during the chaos
>> that is writing. Do people give them their own block, or file or
>> subtree? Is there a genius package out there somewhere to link images
>> + captions to a subtree?
>
> You might want to take a look at org-attach, which allows you to attach
> a directory to an Org node. I also use org-publish a lot, both for my
> blogs and to work on books (with output to LaTeX/pdf). Perhaps for small
> projects like academic articles, org-publish is too much. But for
> projects of a certain scope, such as books, it is certainly very useful,
> since it allows you to have all the parts of the project conveniently
> ordered, and you can also establish a default directory for the images.
>
> https://orgmode.org/manual/Attachments.html
>
> https://orgmode.org/manual/Publishing.html
>
> On the other hand, I recently wrote this little package that allows you
> to easily navigate (using Helm) through the images, blocks, and tables
> in a document:
>
> https://gitlab.com/maciaschain/helm-org-names
>
>> 2 Does anyone have an automatic way to number images, rather than
>> having to change the numbers whenever a new image is added,
>
> Do you mean automatically create a #+name keyword for the image every
> time you add one?
>
>> and/or a way to move all the images at once to an appendix at the end?
>> (Some journals like the images in the text, some at the end)
>
> For my work I wrote something a long time ago that doesn't do exactly
> what you're looking for, but maybe you could adapt it to your workflow.
> This function (when called inside dired) inserts in a temporal org
> document, as org links, all the images stored in the current directory.
>
> #+begin_src emacs-lisp
>   (defun my-org-img-dired-preview ()
>     (interactive)
>     (if (not (derived-mode-p 'dired-mode))
>         (error "not in dired")
>       (let* ((dir-name default-directory)
>              (buf (concat "*" dir-name "--images *")))
>         (setq my-img-dired-list nil)
>         (save-excursion
>           (goto-char (point-min))
>           (while (re-search-forward "\\.png\\|\\.jpg\\|\\.tif" nil t)
>             (let* ((img-path (dired-get-filename)))
>               (add-to-list 'my-img-dired-list img-path t))))
>         (when (get-buffer buf)
>           (kill-buffer buf))
>         (get-buffer-create buf)
>         (set-buffer buf)
>         (org-mode)
>         (let ((img-list (mapconcat (lambda (el)
>                                      (let ((link (concat "[[file:" el "]]")))
>                                        link))
>                                    my-img-dired-list
>                                    "\n\n"))
>               (img-num (number-to-string
>                         (length my-img-dired-list))))
>           (insert (concat "* Images in " dir-name "\n\n"))
>           (insert (concat img-num " files:\n\n"))
>           (insert img-list)
>           (org-toggle-inline-images))
>         (pop-to-buffer buf)
>         (beginning-of-buffer))))
> #+end_src
>
>
>> 3 What’s the most robust export path / set up for images? I’ve found
>> odt sometimes just gives up,
>
> Can you give please an example where exporting to odt has given you a problem
> with images?
>
>> and latex is usually pretty reliable (but
>> the worst format for pandoc to put into word). Pandoc org—>word never
>> does images for me.
>
> Indeed, it's not a good idea to export from LaTeX to odt/docx via pandoc.
> An alternative could be to export using tex4ht, which is included in
> texlive and respects the LaTeX format better. But with certain caveats:
>
> https://tug.org/tex4ht/
>
> Best regards,
>
> Juan Manuel
>
> --
> --
> ------------------------------------------------------
> Juan Manuel Macías
>
> https://juanmanuelmacias.com
>
> https://lunotipia.juanmanuelmacias.com
>
> https://gnutas.juanmanuelmacias.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]