diff options
author | Karl Berry <karl@freefriends.org> | 2021-07-30 01:23:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-07-30 01:23:15 +0000 |
commit | 3f26569dd2bbb857c3b68649d930d990d30b7f72 (patch) | |
tree | a29f8a3f1757cb2523601205853208bc44644a00 | |
parent | c07240d2ee4cce06dd036288a0812765bfba3331 (diff) |
tikztosvg (29jul21)
git-svn-id: svn://tug.org/texlive/trunk@60114 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/tikztosvg/tikztosvg | 78 | ||||
-rw-r--r-- | Master/texmf-dist/doc/man/man1/tikztosvg.1 | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/man/man1/tikztosvg.man1.pdf | bin | 24272 -> 26192 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/tikztosvg/Makefile | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/tikztosvg/README.md | 12 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/tikztosvg/install.sh | 18 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/tikztosvg/man.adoc | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf | bin | 168699 -> 170837 bytes | |||
-rwxr-xr-x | Master/texmf-dist/scripts/tikztosvg/tikztosvg | 78 |
10 files changed, 135 insertions, 108 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/tikztosvg/tikztosvg b/Build/source/texk/texlive/linked_scripts/tikztosvg/tikztosvg index 398d06499fc..d1b1f8bb290 100755 --- a/Build/source/texk/texlive/linked_scripts/tikztosvg/tikztosvg +++ b/Build/source/texk/texlive/linked_scripts/tikztosvg/tikztosvg @@ -38,13 +38,13 @@ showHelp() showVersion() { - echo 0.1.2 + echo 0.2.1 exit 0 } # The default list of packages and libraries that should be imported -PACKAGES="tikz tikz-cd pgfplots amsmath amssymb" -LIBRARIES="" +packages="tikz tikz-cd pgfplots amsmath amssymb" +libraries="" if ! [ -x "$(command -v xelatex)" ] then @@ -76,7 +76,7 @@ do error "Invalid package name. LaTeX package names cannot contain scapes!" ;; *) - PACKAGES="$PACKAGES $2" + packages="$packages $2" shift shift esac @@ -91,26 +91,26 @@ do error "Invalid library name. TikZ library names cannot contain scapes!" ;; *) - LIBRARIES="$LIBRARIES $2" + libraries="$libraries $2" shift shift esac ;; -o|--output) - if [ -n "$OUTPUT" ] + if [ -n "$output" ] then error "The output path was specified multiple times" elif [ -z "$2" ] then error "Unexpected EOF" else - OUTPUT="$2" + output="$2" shift shift fi ;; -q|--quit) - QUIET=1 + quiet=1 shift ;; *) @@ -130,75 +130,75 @@ case "$1" in error "No input path provided" ;; "-") - INPUT=/dev/stdin + input=/dev/stdin ;; *) - INPUT="$1" + input="$1" ;; esac -case "$OUTPUT" in +case "$output" in # Set the output to stdout -) - QUIET=1 - OUTPUT=/dev/stdout + quiet=1 + output=/dev/stdout ;; # If no output path is provided, use the basename of the input "") if [ -x "$(command -v dirname)" ] then - OUTPUT="$(dirname "$INPUT")/$(basename "$INPUT" | cut -d "." -f1).svg" + output="$(dirname "$input")/$(basename "$input" | cut -d "." -f1).svg" fi ;; # If the output path is provided, but it resolves to directory, output a # a file with the same basename as the input in the target directory */) - OUTPUT="$OUTPUT$(basename "$INPUT" | cut -d "." -f1).svg" + output="$output$(basename "$input" | cut -d "." -f1).svg" ;; esac -TEMP_DIR="$(mktemp -d)" -TEX_FILE="$TEMP_DIR/tmp.tex" +tmp_dir="$(mktemp -d)" +tex_file="$tmp_dir/tmp.tex" # Generate the LaTeX document -printf "\documentclass[crop,tikz,multi=false]{standalone}\n" > "$TEX_FILE" +printf "\documentclass[crop,tikz,multi=false]{standalone}\n" > "$tex_file" -for PACKAGE in $(echo "$PACKAGES" | tr " " "\n" | sort | uniq) +for package in $(echo "$packages" | tr " " "\n" | sort | uniq) do - printf "\usepackage{%s}\n" "$PACKAGE" >> "$TEX_FILE" + printf '\\usepackage{%s}\n' "$package" >> "$tex_file" done -for LIBRARY in $(echo "$LIBRARIES" | tr " " "\n" | sort | uniq) +for library in $(echo "$libraries" | tr " " "\n" | sort | uniq) do - printf "\usetikzlibrary{%s}\n" "$LIBRARY" >> "$TEX_FILE" + printf '\\usetikzlibrary{%s}\n' "$library" >> "$tex_file" done -printf "\\\begin{document}\n" >> "$TEX_FILE" -cat "$INPUT" >> "$TEX_FILE" +printf '\\begin{document}\n' >> "$tex_file" -if [ $? -ne 0 ] + +if ! cat "$input" >> "$tex_file" then - rm "$TEMP_DIR" -r - error "File not found: $INPUT" + rm "$tmp_dir" -r + error "File not found: $input" fi -printf "\\\end{document}\n" >> "$TEX_FILE" +printf "\\\end{document}\n" >> "$tex_file" -if [ -z "$QUIET" ] +if [ -z "$quiet" ] then message "Rendering the LaTeX document. . ." - xelatex -halt-on-error -output-directory="$TEMP_DIR" "$TEX_FILE" + xelatex -halt-on-error -output-directory="$tmp_dir" "$tex_file" else - xelatex -halt-on-error -output-directory="$TEMP_DIR" "$TEX_FILE" 1> /dev/null 2>&1 + xelatex -halt-on-error -output-directory="$tmp_dir" "$tex_file" 1> /dev/null 2>&1 fi S=$? if [ $S -ne 0 ] then - rm "$TEMP_DIR" -r - if [ -z "$QUIET" ] + rm "$tmp_dir" -r + if [ -z "$quiet" ] then error "xelatex exited with code $S" $S else @@ -206,18 +206,18 @@ then fi fi -if [ -z "$QUIET" ] +if [ -z "$quiet" ] then message "Converting the output to SVG. . ." fi -pdf2svg "$TEMP_DIR/tmp.pdf" "$OUTPUT" 1 +pdf2svg "$tmp_dir/tmp.pdf" "$output" 1 S=$? if [ $S -ne 0 ] then - rm "$TEMP_DIR" -r - if [ -z "$QUIET" ] + rm "$tmp_dir" -r + if [ -z "$quiet" ] then error "pdf2svg exited with code $S" $S else @@ -225,10 +225,10 @@ then fi fi -if [ -z "$QUIET" ] +if [ -z "$quiet" ] then message "Done!" fi -rm "$TEMP_DIR" -rf +rm "$tmp_dir" -rf diff --git a/Master/texmf-dist/doc/man/man1/tikztosvg.1 b/Master/texmf-dist/doc/man/man1/tikztosvg.1 index 224c93d9ad1..37b1840770c 100644 --- a/Master/texmf-dist/doc/man/man1/tikztosvg.1 +++ b/Master/texmf-dist/doc/man/man1/tikztosvg.1 @@ -1,13 +1,13 @@ '\" t .\" Title: tikztosvg .\" Author: [see the "AUTHOR(S)" section] -.\" Generator: Asciidoctor 2.0.12 -.\" Date: 2021-03-30 +.\" Generator: Asciidoctor 2.0.15 +.\" Date: 2021-07-29 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "TIKZTOSVG" "1" "2021-03-30" "\ \&" "\ \&" +.TH "TIKZTOSVG" "1" "2021-07-29" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 @@ -49,7 +49,7 @@ extension. The file is resolved relative to the working directory. .sp \fB\-p, \-\-package\fP=+\fIPACKAGE\fP .RS 4 - Include \fI\(rsusepackage{PACKAGE}\fP when rendering the diagram. The tikz, tikz\-cd, +Include \fI\(rsusepackage{PACKAGE}\fP when rendering the diagram. The tikz, tikz\-cd, pgfplots, amsmath and amssymb packages are always included by default. .RE .sp @@ -94,18 +94,30 @@ Failure (document processing failure). .RE .SH "AUTHORS" .sp -\fBtikztosvg\fP was written by Pablo <\c -.MTO "pablo\-escobar\(atriseup.net" "" ">." +\fBtikztosvg\fP was written by Pablo \c +.MTO "pablo\-escobar\(atriseup.net" "" "." .sp -\fBpdf2svg\fP was written by David Barton <\c -.MTO "davebarton\(atcityinthesky.co.uk" "" ">" +\fBpdf2svg\fP was written by David Barton \c +.MTO "davebarton\(atcityinthesky.co.uk" "" "" and -Matthew Flaschen <\c -.MTO "matthew.flaschen\(atgatech.edu" "" ">." +Matthew Flaschen \c +.MTO "matthew.flaschen\(atgatech.edu" "" "." .SH "RESOURCES" .sp -\fBGit source repository on sourcehut:\fP \c +Git source repository on sourcehut +.RS 4 .URL "https://git.sr.ht/~pablo\-pie/tikztosvg" "" "" +.RE +.sp +Bug tracker +.RS 4 +.URL "https://todo.sr.ht/~pablo\-pie/tikztosvg" "" "" +.RE +.sp +CTAN package +.RS 4 +.URL "https://www.ctan.org/pkg/tikztosvg" "" "" +.RE .SH "COPYING" .sp Copyright (C) 2021 Pablo. diff --git a/Master/texmf-dist/doc/man/man1/tikztosvg.man1.pdf b/Master/texmf-dist/doc/man/man1/tikztosvg.man1.pdf Binary files differindex 760171d241f..ceb75959127 100644 --- a/Master/texmf-dist/doc/man/man1/tikztosvg.man1.pdf +++ b/Master/texmf-dist/doc/man/man1/tikztosvg.man1.pdf diff --git a/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md b/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md index 6355541f945..65dc1bae6e9 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md +++ b/Master/texmf-dist/doc/support/tikztosvg/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## Release 0.2.1 + +* Fixed #1 +* Improved the installation scripts +* Added aditional links in the documentation + ## Release 0.2.0 * Removed code that added the `\huge` command to the beginning of the document diff --git a/Master/texmf-dist/doc/support/tikztosvg/Makefile b/Master/texmf-dist/doc/support/tikztosvg/Makefile index ce66f807b6f..1d5779d30ae 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/Makefile +++ b/Master/texmf-dist/doc/support/tikztosvg/Makefile @@ -5,11 +5,10 @@ package: tikztosvg.tar.gz install: man/tikztosvg.1 tikztosvg # Install the executable - cp tikztosvg ~/.local/bin/ - chmod +x ~/.local/bin/tikztosvg + install -g 0 -o 0 -m 755 tikztosvg /usr/bin/ # Install the manpage - install -g 0 -o 0 -m 0644 man/tikztosvg.1 ~/.local/share/man/man1/ + install -g 0 -o 0 -m 644 man/tikztosvg.1 /usr/share/man/man1/ man/tikztosvg.1: man/man.adoc asciidoctor -b manpage -o $@ $^ @@ -17,14 +16,14 @@ man/tikztosvg.1: man/man.adoc tikztosvg.pdf: README.md pandoc -s -o $@ $^ -example/example.svg: example/example.tikz +example/%.svg: example/%.tikz sh ./tikztosvg -p xfrac -p relsize -o $@ $^ # Try to compress the image with svgo svgo --pretty --enable=sortAttrs $@ || exit 0 # Packages the application for CTAN -tikztosvg.tar.gz: man/tikztosvg.1 tikztosvg.pdf README.md example/example.svg CHANGELOG.md +tikztosvg.tar.gz: tikztosvg man/tikztosvg.1 tikztosvg.pdf README.md example/example.tikz example/example.svg CHANGELOG.md LICENSE 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 866e73b690d..b8710da39f5 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/README.md +++ b/Master/texmf-dist/doc/support/tikztosvg/README.md @@ -72,8 +72,16 @@ $ 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 `/usr/bin/` and the man-page is +installed in `/usr/share/man/man1/`. + +## Resources + +**Git source repository on sourcehut:** <https://git.sr.ht/~pablo-pie/tikztosvg> + +**Bug tracker:** <https://todo.sr.ht/~pablo-pie/tikztosvg> + +**CTAN package:** <https://www.ctan.org/pkg/tikztosvg> ## Authors diff --git a/Master/texmf-dist/doc/support/tikztosvg/install.sh b/Master/texmf-dist/doc/support/tikztosvg/install.sh index 659199b883b..1d6a22957b6 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/install.sh +++ b/Master/texmf-dist/doc/support/tikztosvg/install.sh @@ -46,21 +46,21 @@ then rm "$HOME/.local/bin/tikztosvg" fi -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)" +wget https://git.sr.ht/~pablo-pie/tikztosvg/blob/master/tikztosvg -P "$tmp" \ + && install -g 0 -o 0 -m 755 "$tmp/tikztosvg" /usr/bin/ \ + || exit 1 + message "Installing manual entry for tikztosvg(1)" -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/"\ +wget https://git.sr.ht/~pablo-pie/tikztosvg/blob/master/man/tikztosvg.1 -P "$tmp" \ + && install -g 0 -o 0 -m 644 "$tmp/tikztosvg.1" /usr/share/man/man1/ \ || exit 1 -if [ -f "$HOME/.local/share/man/man1/tikztosvg.1.gz" ] +if [ -f "/usr/share/man/man1/tikztosvg.1.gz" ] then - rm "$HOME/.local/share/man/man1/tikztosvg.1.gz" + rm "/usr/share/man/man1/tikztosvg.1.gz" fi -gzip "$HOME/.local/share/man/man1/tikztosvg.1" +gzip "/usr/share/man/man1/tikztosvg.1" rm "$tmp" -r diff --git a/Master/texmf-dist/doc/support/tikztosvg/man.adoc b/Master/texmf-dist/doc/support/tikztosvg/man.adoc index 5f2e5554cf0..ad5d8cca2af 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/man.adoc +++ b/Master/texmf-dist/doc/support/tikztosvg/man.adoc @@ -1,7 +1,7 @@ = tikztosvg(1) :doctype: manpage :man-manual: tikztosvg Manual -:man-source: tikztosvg 0.2.0 +:man-source: tikztosvg 0.2.1 :page-layout: base == NAME @@ -28,7 +28,7 @@ If _INPUT_PATH_ is set to _-_ the input will be read from stdin. *-p, --package*=+_PACKAGE_:: Include _\usepackage{PACKAGE}_ when rendering the diagram. The tikz, tikz-cd, -pgfplots, amsmath and amssymb packages are always included by default. + pgfplots, amsmath and amssymb packages are always included by default. *-l, --library*=+_LIBRARY:: Include _\usetikzlibrary{LIBRARY}_ when rendering the diagram. @@ -67,7 +67,9 @@ Matthew Flaschen <matthew.flaschen@gatech.edu>. == RESOURCES -*Git source repository on sourcehut:* https://git.sr.ht/~pablo-pie/tikztosvg +Git source repository on sourcehut:: https://git.sr.ht/~pablo-pie/tikztosvg +Bug tracker:: https://todo.sr.ht/~pablo-pie/tikztosvg +CTAN package:: https://www.ctan.org/pkg/tikztosvg == COPYING diff --git a/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf b/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf Binary files differindex c7d54a4005b..3fb78c6fb4b 100644 --- a/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf +++ b/Master/texmf-dist/doc/support/tikztosvg/tikztosvg.pdf diff --git a/Master/texmf-dist/scripts/tikztosvg/tikztosvg b/Master/texmf-dist/scripts/tikztosvg/tikztosvg index 398d06499fc..d1b1f8bb290 100755 --- a/Master/texmf-dist/scripts/tikztosvg/tikztosvg +++ b/Master/texmf-dist/scripts/tikztosvg/tikztosvg @@ -38,13 +38,13 @@ showHelp() showVersion() { - echo 0.1.2 + echo 0.2.1 exit 0 } # The default list of packages and libraries that should be imported -PACKAGES="tikz tikz-cd pgfplots amsmath amssymb" -LIBRARIES="" +packages="tikz tikz-cd pgfplots amsmath amssymb" +libraries="" if ! [ -x "$(command -v xelatex)" ] then @@ -76,7 +76,7 @@ do error "Invalid package name. LaTeX package names cannot contain scapes!" ;; *) - PACKAGES="$PACKAGES $2" + packages="$packages $2" shift shift esac @@ -91,26 +91,26 @@ do error "Invalid library name. TikZ library names cannot contain scapes!" ;; *) - LIBRARIES="$LIBRARIES $2" + libraries="$libraries $2" shift shift esac ;; -o|--output) - if [ -n "$OUTPUT" ] + if [ -n "$output" ] then error "The output path was specified multiple times" elif [ -z "$2" ] then error "Unexpected EOF" else - OUTPUT="$2" + output="$2" shift shift fi ;; -q|--quit) - QUIET=1 + quiet=1 shift ;; *) @@ -130,75 +130,75 @@ case "$1" in error "No input path provided" ;; "-") - INPUT=/dev/stdin + input=/dev/stdin ;; *) - INPUT="$1" + input="$1" ;; esac -case "$OUTPUT" in +case "$output" in # Set the output to stdout -) - QUIET=1 - OUTPUT=/dev/stdout + quiet=1 + output=/dev/stdout ;; # If no output path is provided, use the basename of the input "") if [ -x "$(command -v dirname)" ] then - OUTPUT="$(dirname "$INPUT")/$(basename "$INPUT" | cut -d "." -f1).svg" + output="$(dirname "$input")/$(basename "$input" | cut -d "." -f1).svg" fi ;; # If the output path is provided, but it resolves to directory, output a # a file with the same basename as the input in the target directory */) - OUTPUT="$OUTPUT$(basename "$INPUT" | cut -d "." -f1).svg" + output="$output$(basename "$input" | cut -d "." -f1).svg" ;; esac -TEMP_DIR="$(mktemp -d)" -TEX_FILE="$TEMP_DIR/tmp.tex" +tmp_dir="$(mktemp -d)" +tex_file="$tmp_dir/tmp.tex" # Generate the LaTeX document -printf "\documentclass[crop,tikz,multi=false]{standalone}\n" > "$TEX_FILE" +printf "\documentclass[crop,tikz,multi=false]{standalone}\n" > "$tex_file" -for PACKAGE in $(echo "$PACKAGES" | tr " " "\n" | sort | uniq) +for package in $(echo "$packages" | tr " " "\n" | sort | uniq) do - printf "\usepackage{%s}\n" "$PACKAGE" >> "$TEX_FILE" + printf '\\usepackage{%s}\n' "$package" >> "$tex_file" done -for LIBRARY in $(echo "$LIBRARIES" | tr " " "\n" | sort | uniq) +for library in $(echo "$libraries" | tr " " "\n" | sort | uniq) do - printf "\usetikzlibrary{%s}\n" "$LIBRARY" >> "$TEX_FILE" + printf '\\usetikzlibrary{%s}\n' "$library" >> "$tex_file" done -printf "\\\begin{document}\n" >> "$TEX_FILE" -cat "$INPUT" >> "$TEX_FILE" +printf '\\begin{document}\n' >> "$tex_file" -if [ $? -ne 0 ] + +if ! cat "$input" >> "$tex_file" then - rm "$TEMP_DIR" -r - error "File not found: $INPUT" + rm "$tmp_dir" -r + error "File not found: $input" fi -printf "\\\end{document}\n" >> "$TEX_FILE" +printf "\\\end{document}\n" >> "$tex_file" -if [ -z "$QUIET" ] +if [ -z "$quiet" ] then message "Rendering the LaTeX document. . ." - xelatex -halt-on-error -output-directory="$TEMP_DIR" "$TEX_FILE" + xelatex -halt-on-error -output-directory="$tmp_dir" "$tex_file" else - xelatex -halt-on-error -output-directory="$TEMP_DIR" "$TEX_FILE" 1> /dev/null 2>&1 + xelatex -halt-on-error -output-directory="$tmp_dir" "$tex_file" 1> /dev/null 2>&1 fi S=$? if [ $S -ne 0 ] then - rm "$TEMP_DIR" -r - if [ -z "$QUIET" ] + rm "$tmp_dir" -r + if [ -z "$quiet" ] then error "xelatex exited with code $S" $S else @@ -206,18 +206,18 @@ then fi fi -if [ -z "$QUIET" ] +if [ -z "$quiet" ] then message "Converting the output to SVG. . ." fi -pdf2svg "$TEMP_DIR/tmp.pdf" "$OUTPUT" 1 +pdf2svg "$tmp_dir/tmp.pdf" "$output" 1 S=$? if [ $S -ne 0 ] then - rm "$TEMP_DIR" -r - if [ -z "$QUIET" ] + rm "$tmp_dir" -r + if [ -z "$quiet" ] then error "pdf2svg exited with code $S" $S else @@ -225,10 +225,10 @@ then fi fi -if [ -z "$QUIET" ] +if [ -z "$quiet" ] then message "Done!" fi -rm "$TEMP_DIR" -rf +rm "$tmp_dir" -rf |