Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

14 Nov '18, 18:12

cis's gravatar image

cis
9.6k103460491

TikZ / svg.path: Wie kann ich svg Code in tikzpicture direct tikzpictures direkt verwenden?

Bei wikipedia werden oft die svg-Codes zu [gezeichneten Bildern][1] angegeben: [![Als einfaches Beispiel direkt zum svg Code aus dem Link oben][2]][3] Kann ich diesen Code irgendwie direkt mit TikZ verarbeiten? <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="600" viewBox="0 0 5 3"> <desc>Flag of Germany</desc> <rect id="black_stripe" width="5" height="3" y="0" x="0" fill="#000"/> <rect id="red_stripe" width="5" height="2" y="1" x="0" fill="#D00"/> <rect id="gold_stripe" width="5" height="1" y="2" x="0" fill="#FFCE00"/> </svg> [![alt text][4]][4] \documentclass{article} \usepackage{tikz} \usepgflibrary{svg.path} \begin{document} IST: \begin{verbatim} <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="600" viewBox="0 0 5 3"> <desc>Flag of Germany</desc> <rect id="black_stripe" width="5" height="3" y="0" x="0" fill="#000"/> <rect id="red_stripe" width="5" height="2" y="1" x="0" fill="#D00"/> <rect id="gold_stripe" width="5" height="1" y="2" x="0" fill="#FFCE00"/> </svg> \end{verbatim} SOLL: ??? \begin{pgfpicture} \pgfpathsvg{ M 0 0 l 20 0 0 20 -20 0 q 10 0 10 10 } \pgfusepath{stroke} \end{pgfpicture} \end{document} [1]: https://de.wikipedia.org/wiki/Datei:Flag_of_Germany.svg [2]: https://validator.w3.org/check?uri=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FSpecial%3AFilepath%2FFlag_of_Germany.svg&doctype=Inline&ss=1#source [3]: https://validator.w3.org/check?uri=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FSpecial%3AFilepath%2FFlag_of_Germany.svg&doctype=Inline&ss=1#source [4]: https://texwelt.de/wissen/upfiles/55555555_281.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

14 Nov '18, 18:08

cis's gravatar image

cis
9.6k103460491

TikZ / svg.path: Wie kann ich svg Code in tikzpicture direct verwenden?

Bei wikipedia werden oft die svg-Codes zu [gezeichneten Bildern][1] angegeben: [![Als einfaches Beispiel direkt zum svg Code aus dem Link oben][2]][3] Kann ich diesen Code irgendwie direkt mit TikZ verarbeiten? <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="600" viewBox="0 0 5 3"> <desc>Flag of Germany</desc> <rect id="black_stripe" width="5" height="3" y="0" x="0" fill="#000"/> <rect id="red_stripe" width="5" height="2" y="1" x="0" fill="#D00"/> <rect id="gold_stripe" width="5" height="1" y="2" x="0" fill="#FFCE00"/> </svg> [![alt text][4]][4] \documentclass{article} \usepackage{tikz} \usepgflibrary{svg.path} \begin{document} IST: \begin{verbatim} <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="600" viewBox="0 0 5 3"> <desc>Flag of Germany</desc> <rect id="black_stripe" width="5" height="3" y="0" x="0" fill="#000"/> <rect id="red_stripe" width="5" height="2" y="1" x="0" fill="#D00"/> <rect id="gold_stripe" width="5" height="1" y="2" x="0" fill="#FFCE00"/> </svg> \end{verbatim} SOLL: ??? \begin{pgfpicture} \pgfpathsvg{ M 0 0 l 20 0 0 20 -20 0 q 10 0 10 10 } \pgfusepath{stroke} \end{pgfpicture} \end{document} [1]: https://de.wikipedia.org/wiki/Datei:Flag_of_Germany.svg [2]: https://validator.w3.org/check?uri=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FSpecial%3AFilepath%2FFlag_of_Germany.svg&doctype=Inline&ss=1#source [3]: https://validator.w3.org/check?uri=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FSpecial%3AFilepath%2FFlag_of_Germany.svg&doctype=Inline&ss=1#source [4]: https://texwelt.de/wissen/upfiles/55555555_281.png