From 6aa284727262f1c7ac0ec6c67becc28d5a678a8c Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 4 Apr 2021 02:30:37 +0000 Subject: tikztosvg (4apr21) git-svn-id: svn://tug.org/texlive/trunk@58737 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/support/tikztosvg/CHANGELOG.adoc | 7 -- .../texmf-dist/doc/support/tikztosvg/CHANGELOG.md | 18 +++ Master/texmf-dist/doc/support/tikztosvg/Makefile | 55 ++++----- Master/texmf-dist/doc/support/tikztosvg/README.md | 60 ++++++---- .../texmf-dist/doc/support/tikztosvg/example.svg | 126 ++++++++------------- .../texmf-dist/doc/support/tikztosvg/example.tikz | 4 +- Master/texmf-dist/doc/support/tikztosvg/install.sh | 7 +- Master/texmf-dist/doc/support/tikztosvg/man.adoc | 25 ++-- .../texmf-dist/doc/support/tikztosvg/tikztosvg.pdf | Bin 93967 -> 168699 bytes 9 files changed, 152 insertions(+), 150 deletions(-) delete mode 100644 Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.adoc create mode 100644 Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md (limited to 'Master/texmf-dist/doc/support') diff --git a/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.adoc b/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.adoc deleted file mode 100644 index e742d0cb5c6..00000000000 --- a/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.adoc +++ /dev/null @@ -1,7 +0,0 @@ -== Release 0.1.2 - -* The script is now posix-complient (it doesn't use bash anymore) -* Messages in the log output are now color-coded -* The script now support `stdin` input and `stdout` output -* The documentation is now rendered to PDF -* The documentation was updated diff --git a/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md b/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md new file mode 100644 index 00000000000..6355541f945 --- /dev/null +++ b/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md @@ -0,0 +1,18 @@ +# CHANGELOG + +## Release 0.2.0 + +* Removed code that added the `\huge` command to the beginning of the document +* Added an option for importing TikZ libraries (the `-l` option) +* Made it so that items from the `-p` and `-l` options aren't imported twice +* Made it so that tikz, tikz-cd, pgfplots, amsmath and amssymb are imported by + default +* Added instructions for installing the application with Git + +## Release 0.1.2 + +* The script is now posix-complient (it doesn't use bash anymore) +* Messages in the log output are now color-coded +* The script now support `stdin` input and `stdout` output +* The documentation is now rendered to PDF +* The documentation was updated diff --git a/Master/texmf-dist/doc/support/tikztosvg/Makefile b/Master/texmf-dist/doc/support/tikztosvg/Makefile index bae45ce4e39..ce66f807b6f 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/Makefile +++ b/Master/texmf-dist/doc/support/tikztosvg/Makefile @@ -1,35 +1,30 @@ +.PHONY: package install + # Packages the application for CTAN -package: - # Render the manpage - asciidoctor -b manpage -o man/tikztosvg.1 man/man.adoc +package: tikztosvg.tar.gz + +install: man/tikztosvg.1 tikztosvg + # Install the executable + cp tikztosvg ~/.local/bin/ + chmod +x ~/.local/bin/tikztosvg - # Render the README as PDF - asciidoctor -r asciidoctor-pdf -b pdf -o tikztosvg.pdf README.adoc - - # Render the README as Markdown - asciidoctor -b docbook -a leveloffset=+1 -o - README.adoc \ - | pandoc --atx-headers \ - --wrap=preserve \ - -t markdown_github \ - -f docbook - \ - | comby '![:[name]](:[link])' \ - '![:[name]](examples/:[link])' \ - -stdin \ - -stdout \ - -m .md \ - | comby ':imagesdir: :[[value]]' '' -stdin -stdout -m .md \ - | comby ':source-highlighter: :[[value]]' '' -stdin -stdout -m .md \ - > README.md + # Install the manpage + install -g 0 -o 0 -m 0644 man/tikztosvg.1 ~/.local/share/man/man1/ + +man/tikztosvg.1: man/man.adoc + asciidoctor -b manpage -o $@ $^ + +tikztosvg.pdf: README.md + pandoc -s -o $@ $^ + +example/example.svg: example/example.tikz + sh ./tikztosvg -p xfrac -p relsize -o $@ $^ - # Package the repository as a tar file - tar -cvO \ - --directory=.. \ - --exclude='.*' \ - --exclude='*.tar.gz' \ - --exclude='README.adoc' \ - tikztosvg \ - | gzip -c /dev/stdin > tikztosvg.tar.gz + # Try to compress the image with svgo + svgo --pretty --enable=sortAttrs $@ || exit 0 -install: - sh install.sh +# Packages the application for CTAN +tikztosvg.tar.gz: man/tikztosvg.1 tikztosvg.pdf README.md example/example.svg CHANGELOG.md + tar -cvO --directory=.. --exclude='.*' --exclude='*.tar.gz' tikztosvg \ + | gzip -c /dev/stdin > tikztosvg.tar.gz diff --git a/Master/texmf-dist/doc/support/tikztosvg/README.md b/Master/texmf-dist/doc/support/tikztosvg/README.md index ac986ae7472..866e73b690d 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/README.md +++ b/Master/texmf-dist/doc/support/tikztosvg/README.md @@ -1,22 +1,30 @@ # tikztosvg(1) -Pablo Emilio Escobar Gaviria <> - -The `tikztosvg(1)` command renders TikZ diagrams to SVG, using [`xetex`](http://xetex.sourceforge.net/) and [`pdf2svg`](https://github.com/dawbarton/pdf2svg). +The `tikztosvg(1)` command renders TikZ diagrams to SVG, using +[XeTeX](http://xetex.sourceforge.net/) and +[pdf2svg](https://github.com/dawbarton/pdf2svg). ## Usage - tikztosvg [OPTION]... INPUT_PATH +``` sh +$ tikztosvg [OPTION]... INPUT_PATH +``` If *INPUT\_PATH* is set to *-* the input will be read from stdin. ### Options **-o, --output**=*OUTPUT\_PATH* -Write output to file *OUTPUT\_PATH*. If set to *-* the output will be written to stdout. Defaults to the base name of the input file suffixed with the *.svg* extension. The file is resolved relative to the working directory. +Write output to file *OUTPUT\_PATH*. If set to *-* the output will be written +to stdout. Defaults to the base name of the input file suffixed with the *.svg* +extension. The file is resolved relative to the working directory. **-p, --package**=+*PACKAGE* -Include `\usepackage{PACKAGE}` when rendering the diagram. +Include `\usepackage{PACKAGE}` when rendering the diagram. The tikz, tikz-cd, +pgfplots, amsmath and amssymb packages are always included by default. + +**-l, --library**=+*LIBRARY* +Include `\usetikzlibrary{LIBRARY}` when rendering the diagram. **-q, --quiet** Silence application log messages and script warnings. @@ -33,35 +41,49 @@ Let’s say you want to convert the file `example.tikz` to SVG: ``` latex \begin{tikzcd} - G \arrow[r, "\varphi"] \arrow[d, "\psi"', two heads] & H \\ - \sfrac{G}{\ker \varphi} \arrow[ru, dotted] & + G \arrow[r, "\varphi"] \arrow[d, "\psi"', two heads] & H \\ + \mathlarger{\sfrac{G}{\ker \varphi}} \arrow[ru, dotted] & \end{tikzcd} ``` -You could achieve that by running the following command: +You could achieve this by running: +``` sh +# xfrac and relsize are only there so that we can +# call \sfrac and \mathlarger +$ tikztosvg -p xfrac -p relsize example.tikz +``` - tikztosvg -p tikz-cd -p xfrac example.tikz +The results will be stored in the file `example.svg`. -The results will be stored in the file `example.svg`: +## Installation -![example](examples/example.svg) +The `tikztosvg(1)` command and it’s man page can be installed in Unix systems +by running -## Installation +``` sh +$ curl -s https://git.sr.ht/~pablo-pie/tikztosvg/blob/master/install.sh | sudo sh +``` -The `tikztosvg(1)` command and it’s man page can be installed in Unix systems by running: +or it can be installed via Git with - $ curl -s https://gitlab.com/pablo-escobar/tikztosvg/-/raw/master/install.sh | sudo sh +``` sh +$ git clone https://git.sr.ht/~pablo-pie/tikztosvg +$ cd tikztosvg +$ sudo make install +``` -The executable is installed in `$HOME/.local/bin/` and the man-page is installed in `$HOME/.local/share/man/man1/`. +The executable is installed in `$HOME/.local/bin/` and the man-page is +installed in `$HOME/.local/share/man/man1/`. ## Authors -**tikztosvg** was written by [Pablo Emilio Escobar Gaviria](mailto:pablo-escobar@riseup.net). +**tikztosvg** was written by [Pablo](mailto:pablo-escobar@riseup.net). -**pdf2svg** was written by [David Barton](mailto:davebarton@cityinthesky.co.uk) and [Matthew Flaschen](mailto:matthew.flaschen@gatech.edu). +**pdf2svg** was written by [David Barton](mailto:davebarton@cityinthesky.co.uk) +and [Matthew Flaschen](mailto:matthew.flaschen@gatech.edu). ## License -© 2020 Pablo Emilio Escobar Gaviria. +© 2021 Pablo. Free use of this software is granted under the terms of the GPL-3.0 License. diff --git a/Master/texmf-dist/doc/support/tikztosvg/example.svg b/Master/texmf-dist/doc/support/tikztosvg/example.svg index 4de0d5e53ed..4c258f4f367 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/example.svg +++ b/Master/texmf-dist/doc/support/tikztosvg/example.svg @@ -1,80 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Master/texmf-dist/doc/support/tikztosvg/example.tikz b/Master/texmf-dist/doc/support/tikztosvg/example.tikz index 31106442122..416d667e54c 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/example.tikz +++ b/Master/texmf-dist/doc/support/tikztosvg/example.tikz @@ -1,4 +1,4 @@ \begin{tikzcd} -G \arrow[r, "\varphi"] \arrow[d, "\psi"', two heads] & H \\ -\sfrac{G}{\ker \varphi} \arrow[ru, dotted] & + G \arrow[r, "\varphi"] \arrow[d, "\psi"', two heads] & H \\ + \mathlarger{\sfrac{G}{\ker \varphi}} \arrow[ru, dotted] & \end{tikzcd} diff --git a/Master/texmf-dist/doc/support/tikztosvg/install.sh b/Master/texmf-dist/doc/support/tikztosvg/install.sh index bc5a26741b9..659199b883b 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/install.sh +++ b/Master/texmf-dist/doc/support/tikztosvg/install.sh @@ -1,4 +1,7 @@ #!/bin/sh +# +# 2021 (C) Pablo +# Free use of this software is granted under the terms of the GPL-3.0 License puts () { @@ -43,13 +46,13 @@ then rm "$HOME/.local/bin/tikztosvg" fi -wget https://gitlab.com/pablo-escobar/tikztosvg/-/raw/master/tikztosvg -P "$HOME/.local/bin/"\ +wget https://git.sr.ht/~pablo-pie/tikztosvg/blob/master/tikztosvg -P "$HOME/.local/bin/"\ && chmod +x "$HOME/.local/bin/tikztosvg"\ || exit 1 tmp="$(mktemp -d)" message "Installing manual entry for tikztosvg(1)" -wget https://gitlab.com/pablo-escobar/tikztosvg/-/raw/master/man/tikztosvg.1 -P "$tmp"\ +wget https://git.sr.ht/~pablo-pie/tikztosvg/blob/master/man/tikztosvg.1 -P "$tmp"\ && install -g 0 -o 0 -m 0644 "$tmp/tikztosvg.1" "$HOME/.local/share/man/man1/"\ || exit 1 diff --git a/Master/texmf-dist/doc/support/tikztosvg/man.adoc b/Master/texmf-dist/doc/support/tikztosvg/man.adoc index 5a8a4bf7f6f..5f2e5554cf0 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/man.adoc +++ b/Master/texmf-dist/doc/support/tikztosvg/man.adoc @@ -1,20 +1,20 @@ -= tikzsvg(1) += tikztosvg(1) :doctype: manpage :man-manual: tikztosvg Manual -:man-source: tikztosvg 0.1.2 +:man-source: tikztosvg 0.2.0 :page-layout: base == NAME -tikzsvg - Render TikZ diagrams to SVG. +tikztosvg - Render TikZ diagrams to SVG. == SYNOPSIS -*tikzsvg* [_OPTION_]... _INPUT_PATH_ +*tikztosvg* [_OPTION_]... _INPUT_PATH_ == DESCRIPTION -The tikzsvg(1) command renders TikZ diagrams to SVG. +The tikztosvg(1) command renders TikZ diagrams to SVG. If _INPUT_PATH_ is set to _-_ the input will be read from stdin. @@ -27,7 +27,11 @@ If _INPUT_PATH_ is set to _-_ the input will be read from stdin. extension. The file is resolved relative to the working directory. *-p, --package*=+_PACKAGE_:: - Include _\usepackage{PACKAGE}_ when rendering the diagram. + Include _\usepackage{PACKAGE}_ when rendering the diagram. The tikz, tikz-cd, +pgfplots, amsmath and amssymb packages are always included by default. + +*-l, --library*=+_LIBRARY:: + Include _\usetikzlibrary{LIBRARY}_ when rendering the diagram. *-q, --quiet*:: Silence application log messages and script warnings. @@ -40,7 +44,7 @@ If _INPUT_PATH_ is set to _-_ the input will be read from stdin. == ENVIRONMENT -*tikztosvg* requires _xetex_ and _pdf2svg_ to be installed. Make sure +*tikztosvg* requires XeTeX and pdf2svg to be installed. Make sure any additional LaTeX packages are installed before using them in a diagram. == EXIT STATUS @@ -56,18 +60,17 @@ any additional LaTeX packages are installed before using them in a diagram. == AUTHORS -*tikztosvg* was written by Pablo Emilio Escobar Gaviria -. +*tikztosvg* was written by Pablo . *pdf2svg* was written by David Barton and Matthew Flaschen . == RESOURCES -*Git source repository on GitLab:* https://gitlab.com/pablo-escobar/tikztosvg +*Git source repository on sourcehut:* https://git.sr.ht/~pablo-pie/tikztosvg == COPYING -Copyright \(C) 2020 Pablo Emilio Escobar Gaviria. +Copyright \(C) 2021 Pablo. Free use of this software is granted under the terms of the GPL-3.0 License. diff --git a/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf b/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf index 5627b2bd5e3..c7d54a4005b 100644 Binary files a/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf and b/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf differ -- cgit v1.2.3