emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Edouard Debry <edouard.debry@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: latex block tikz to svg
Date: Mon, 17 Jan 2022 16:01:17 +0000	[thread overview]
Message-ID: <871r164aia.fsf@posteo.net> (raw)
In-Reply-To: <86r196motz.fsf@gmail.com> (Edouard Debry's message of "Mon, 17 Jan 2022 15:14:32 +0100")

Hi Edouard,

Edouard Debry writes:

> I would like to find a way to generate svg images from latex src blocks
> (using tikz) which works and is compatible with default orgmode settings
> for latex export (at least does not break it)
>
> Did you experience such issues ? do you have some workings settings and
> examples ? I googled several times "org latex block tikz svg", but it is
> difficult to guess how relevant are the elements found, some of them
> seems quiet outdated. Hence my question on this mailing list

I've done some quick tests with your example block. I don't know if I'm
wrong, but I think the problem is on line 27 of `org-babel-execute:latex':

((string= "svg" extension)

I don't know if this should be considered an Org bug, but it's clear
that if the svg extension is detected in :file, the ':imagemagick yes'
option is ignored, and a type of preamble is generated that fails in
pgfsysdriver when compiling the temp tex document:

\documentclass[preview]{standalone}
\def\pgfsysdriver{pgfsys-tex4ht.def}

If I replace the above line with this conditional:

((and (string= "svg" extension) (not imagemagick))

then the imagemagick option is taken into account: it creates correctly
the pdf and then converts it to svg with 'convert' imagemagick program.
I did have to remove this line though:

#+HEADER: :imoutoptions -geometry 400 :iminoptions -density 600

otherwise, the conversion produced a dark image.

Best regards,

Juan Manuel 


  reply	other threads:[~2022-01-17 16:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 14:14 Edouard Debry
2022-01-17 16:01 ` Juan Manuel Macías [this message]
2022-01-25 23:24   ` Edouard Debry
2022-04-18 13:23   ` Edouard Debry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871r164aia.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=edouard.debry@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: latex block tikz to svg' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).