The seeds of this question were planted in my mind and have been growing since I read this answer.

I think it'd be nice to have a database from which some newcommand making use of TikZ picks up coordinates based on a text string to draw (the border of) a country. (I'm thinking of something like \drawcountry[black,fill=red]{Italy}.)

One of the points to address is how to store such coordinates in a way that they can be easily used by TikZ. I'm spontaneously thinking about a two column file with blank lines to indicate non-connected regions (e.g. islands), so that ~\draw plot file{...}` could be used.

On the other hand I read that SVG files can contain several path constructors which work in a similar fashion as TikZ's controls. With this in mind, the idea of the two-column file would be good only if M, L, and z are the only constructors to be used.

So the question becomes: how should I store coordinates retrieved from a SVG file in order to use them in TikZ?

By the way, is someone interested in such pastime? I was thinking about making a GitHub repo.

  • 1
    I really like the idea! – TeXnician Mar 19 '17 at 16:39
  • Then let's wait for someone giving us some good advice, so that we can start! – Enrico Maria De Angelis Mar 19 '17 at 16:47
  • 3
    You can use the svg operation (cf. section 14.11 "The SVG operation" , pgfmanual, p.156, v3.0.1a) – Paul Gaborit Mar 19 '17 at 16:47
  • How didn't I think searching for SVG in the manual?! Thank you, @PaulGaborit; yours is more of an answer than a simple comment. I'll be glad to accept if you post it :) – Enrico Maria De Angelis Mar 19 '17 at 18:09
  • In my experience feeding the SVG directly to tikz is not very efficient...I think converting it to direct tikz paths would make the package more flexible and efficient. – Bordaigorl Mar 19 '17 at 19:05
up vote 2 down vote accepted

You can use the svg operation (cf. section 14.11 "The SVG operation" , pgfmanual, p.156, v3.0.1a).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.