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


Hi Juan,

Thanks for your answeer.

Indeed, the generated tex files are different whether you use the png or
svg extension.

It seems that for svg, a distinct build system is used from the usual
one for other image types (png, jpg).

This build system seems based on tex4ht, given the latex file preamble.

I tried to compile manually this temporary latex file (the one for svg)
with "pdflatex" which fails. Then, I tried with "htlatex" and guess what
... it works ! A svg file is created, which unfortunately does not
contain everything, but this was only manual compiling, probably some
missing options.

I think at first there may be a bug in my own configuration of the
variable "org-latex-pdf-process" which should be passed the correct
build system.

Regards

Juan Manuel Macías <maciaschain@posteo.net> writes:

> 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-25 23:31 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
2022-01-25 23:24   ` Edouard Debry [this message]
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=86r18vz9ec.fsf@gmail.com \
    --to=edouard.debry@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=maciaschain@posteo.net \
    --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).