diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-22 21:43:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-22 21:43:32 +0000 |
commit | 340a2df114efeb3ef71b7b7c65f150bf30634bf5 (patch) | |
tree | 6825d98c3a96fb505e5a689c9cde72d6112d4e27 /Master/texmf-dist | |
parent | 92926991fee4079a0d527dad92cf06a8077c8a64 (diff) |
plantuml (22mar18)
git-svn-id: svn://tug.org/texlive/trunk@47076 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md | 31 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/README.md | 85 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--latex.tex | 19 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--svg.tex | 26 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.png | bin | 13997 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.tex | 29 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-minimal.png | bin | 4829 -> 0 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf | bin | 0 -> 45918 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty | 74 |
9 files changed, 119 insertions, 145 deletions
diff --git a/Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md b/Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md new file mode 100644 index 00000000000..14230fdd7cf --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md @@ -0,0 +1,31 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [0.2.1] - 2017-03-21 + +### Fixed + +- Added short version of `README.md` to CTAN distribution again, because of [CTAN rules](https://mirror.informatik.hs-fulda.de/tex-archive/help/ctan/CTAN-upload-addendum.html#readme). + +## [0.2.0] - 2017-03-20 + +### Changed + +- `README.md` is not distributed to CTAN anymore, because `plantuml.pdf` is distributed to follow latex software conventions to name the manual according to the name of the package. + `plantuml.pdf` generated out of `README.md`. +- Removed call to `pdfcrop` is not necessary anymore, because inkscape is called without `-D` for svg convertion. + +### Added + +- `release.sh` for creating a release. + +## 0.1.0 - 2018-03-08 + +Initial public release + +[Unreleased]: https://github.com/latextemplates/plantuml/compare/0.2.1...HEAD +[0.2.1]: https://github.com/latextemplates/plantuml/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/latextemplates/plantuml/compare/0.1.0...0.2.0 diff --git a/Master/texmf-dist/doc/lualatex/plantuml/README.md b/Master/texmf-dist/doc/lualatex/plantuml/README.md index 195ec4d06be..ff607be7f9f 100644 --- a/Master/texmf-dist/doc/lualatex/plantuml/README.md +++ b/Master/texmf-dist/doc/lualatex/plantuml/README.md @@ -7,88 +7,3 @@ This package allows for embedding PlantUML diagrams using the PlantUML source. Currently, this project runs with [lualatex](http://www.luatex.org/) only. Check [issue #1](https://github.com/latextemplates/plantuml/issues/1) for the current state of affairs for support pdflatex. - -## Preconditions - -1. Environment variable `PLANTUML_JAR` set to the location of `plantuml.jar`. - You get it from <https://sourceforge.net/projects/plantuml/files/plantuml.jar/download>. -2. Enviroment variable `GRAPHVIZ_DOT` set to the location of `dot.exe`. - Example: `C:\Program Files (x86)\Graphviz2.38\bin\dot.exe`. - You can install graphviz using `choco install graphviz`. -3. lualatex available with command line parameter `-shell-escape` included. -4. In case you want to have the images as PDFs (and not using TikZ or PNG), ensure that `inkscape.exe` and `pdfcrop` are in your path. - You can get inkscape using `choco install inkscape`. - `pdfcrop` should be part of your latex distribution. - -## Examples - -### Minimal Example - -**LaTeX source:** - -```latex -\documentclass{scrartcl} -\usepackage{plantuml} -\begin{document} -\begin{plantuml} - @startuml - Alice -> Bob: test - @enduml -\end{plantuml} -\end{document} -``` - -**Compilation:** `lualatex -shell-escape example-minimal` - -**Result:** - -![example minimal](example-minimal.png) - -### Example Class Relations Rendered using SVG - -**LaTeX source:** - -```latex -\documentclass{scrartcl} -\usepackage{graphics} -\usepackage{epstopdf} -\epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{% - inkscape -z -D --file=#1 --export-pdf=\jobname-plantuml-svg.pdf && - pdfcrop \jobname-plantuml-svg.pdf \OutputFile -} -\usepackage[output=svg]{plantuml} -\begin{document} -\begin{plantuml} -@startuml -class Car - -Driver - Car : drives > -Car *- Wheel : have 4 > -Car -- Person : < owns -@enduml -\end{plantuml} -\end{document} -``` - -**Compilation:** `lualatex -shell-escape example-class-relations` - -**Result:** - -![example minimal](example-class-relations.png) - -## Installation - -Your latex distribution should take care. - -For manual installation, copy `plantuml.*` to your local texmf folder in the subdirectoy `tex/latex/plantuml`. -See [the discussion at tex.sx](https://tex.stackexchange.com/q/27982/9075) for the concrete location of the folder on your system. - -## Development - -### Releasing - -- `ctanify --notds plantuml.sty plantuml.lua README.md "*.png" "example-*.tex"` - -## License - -`SPDX-License-Identifier: LPPL-1.3c+` diff --git a/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--latex.tex b/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--latex.tex new file mode 100644 index 00000000000..190b2f56680 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--latex.tex @@ -0,0 +1,19 @@ +\documentclass{scrartcl} + +\usepackage{graphics} + +\usepackage[output=latex]{plantuml} +% Have sans serif font at each tikz diagram. Source: https://tex.stackexchange.com/a/4888/9075 +\tikzstyle{every picture}+=[font=\sffamily] + +\begin{document} +\begin{plantuml} +@startuml +class Car + +Driver - Car : drives > +Car *- Wheel : have 4 > +Car -- Person : < owns +@enduml +\end{plantuml} +\end{document} diff --git a/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--svg.tex b/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--svg.tex new file mode 100644 index 00000000000..5d7d9b8ed81 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--svg.tex @@ -0,0 +1,26 @@ +\documentclass{scrartcl} + +\usepackage{graphics} + +% Enables inclusion of SVG graphics - 1:1 approach +% This is NOT the approach of https://ctan.org/pkg/svg-inkscape +% which allows text in SVG to be typeset using LaTeX. +% We just include the SVG as is. +\usepackage{epstopdf} +\epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{% + inkscape -z --file=#1 --export-pdf=\OutputFile +} + +\usepackage[output=svg]{plantuml} + +\begin{document} +\begin{plantuml} +@startuml +class Car + +Driver - Car : drives > +Car *- Wheel : have 4 > +Car -- Person : < owns +@enduml +\end{plantuml} +\end{document} diff --git a/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.png b/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.png Binary files differdeleted file mode 100644 index 2461e00812f..00000000000 --- a/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.png +++ /dev/null diff --git a/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.tex b/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.tex deleted file mode 100644 index e5c131104db..00000000000 --- a/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations.tex +++ /dev/null @@ -1,29 +0,0 @@ -\documentclass{scrartcl} - -\usepackage{graphics} - -% Enables inclusion of SVG graphics - 1:1 approach -% This is NOT the approach of http://www.ctan.org/tex-archive/info/svg-inkscape, -% which allows text in SVG to be typeset using LaTeX -% We just include the SVG as is -\usepackage{epstopdf} -\epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{% - inkscape -z -D --file=#1 --export-pdf=\jobname-plantuml-svg.pdf && - %due to https://bugs.launchpad.net/inkscape/+bug/1754167 we need to use pdfcrop - pdfcrop \jobname-plantuml-svg.pdf \OutputFile -} - -\usepackage[output=svg]{plantuml} -%\usepackage[output=latex]{plantuml} - -\begin{document} -\begin{plantuml} -@startuml -class Car - -Driver - Car : drives > -Car *- Wheel : have 4 > -Car -- Person : < owns -@enduml -\end{plantuml} -\end{document} diff --git a/Master/texmf-dist/doc/lualatex/plantuml/example-minimal.png b/Master/texmf-dist/doc/lualatex/plantuml/example-minimal.png Binary files differdeleted file mode 100644 index 7699a8b1850..00000000000 --- a/Master/texmf-dist/doc/lualatex/plantuml/example-minimal.png +++ /dev/null diff --git a/Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf b/Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf Binary files differnew file mode 100644 index 00000000000..3c3fa134fc9 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf diff --git a/Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty b/Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty index 3f16671ea06..2fb13e34644 100644 --- a/Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty +++ b/Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty @@ -3,7 +3,7 @@ %% SPDX-License-Identifier: LPPL-1.3c+ \NeedsTeXFormat{LaTeX2e}\relax \ProvidesPackage{plantuml} - [2018/03/08 v0.1.0 + [2018/03/21 v0.2.1 Embed PlantUML diagrams in latex documents.] % Required by PlantUML LaTeX output @@ -41,50 +41,62 @@ \def\maxwidth#1{\ifdim\Gin@nat@width>#1 #1\else\Gin@nat@width\fi} \makeatother +\ExplSyntaxOn +\let\PlantUmlMode\l_plantuml_mode +\ExplSyntaxOff + +\newcounter{PlantUmlFigureNumber} + \ifluatex - \ExplSyntaxOn - \let\PlantUmlMode\l_plantuml_mode - \ExplSyntaxOff \RequirePackage{luacode} - \makeatletter - \ifcase\pdf@shellescape - \message{No shell escape. PlantUML cannot be called. Start lualatex with -shell-escape.} - \newenvironment{plantuml}{% - No shell escape. PlantUML cannot be called. Start lualatex with -shell-escape. - }{} - \or +\else + \RequirePackage[usefamily=bash]{pythontex} +\fi + +\makeatletter +\ifcase\pdf@shellescape + \message{No shell escape. PlantUML cannot be called. Start pdflatex/lualatex with -shell-escape.} + \newenvironment{plantuml}{% + No shell escape. PlantUML cannot be called. Start pdflatex/lualatex with -shell-escape. + }{} +\or + \ifluatex \directlua{ local plantUmlJar = os.getenv("PLANTUML_JAR") if not plantUmlJar then texio.write_nl("Environment variable PLANTUML_JAR not set.") end } - \NewDocumentEnvironment{plantuml}{}{% - \VerbatimOut{\jobname-plantuml.txt}} - {% - \endVerbatimOut + \fi + \NewDocumentEnvironment{plantuml}{}{% + \VerbatimOut{\jobname-plantuml.txt}} + {% + \endVerbatimOut + \ifluatex \directlua{ local jobname=\luastring{\jobname} local plantUmlMode=\luastring{\PlantUmlMode} require("plantuml.lua") convertPlantUmlToTikz(jobname, plantUmlMode) } - \ifthenelse{\equal{\PlantUmlMode}{latex}}{ - \begin{adjustbox}{max width=\linewidth} - \input{\jobname-plantuml.latex} - \end{adjustbox} - }{ - \includegraphics[width=\maxwidth{\textwidth}]{\jobname-plantuml.\PlantUmlMode} - } + \else + \stepcounter{PlantUmlFigureNumber} + %TODO: Execute pyhton here + \typeout{*** plantuml only works with lualatex ***} + \fi + \ifthenelse{\equal{\PlantUmlMode}{latex}}{ + \begin{adjustbox}{max width=\linewidth} + \input{\jobname-plantuml.latex} + \end{adjustbox} + }{ + \includegraphics[width=\maxwidth{\textwidth}]{\jobname-plantuml.\PlantUmlMode} } - \or - \message{Restricted shell escape. PlantUML cannot be called. Start lualatex with -shell-escape.} - \newenvironment{plantuml}{% - Restricted shell escape. PlantUML cannot be called. Start lualatex with -shell-escape. - }{} - \fi - \makeatother -\else - \typeout{*** plantuml only works with lualatex ***} + } +\or + \message{Restricted shell escape. PlantUML cannot be called. Start pdflatex/lualatex with -shell-escape.} + \newenvironment{plantuml}{% + Restricted shell escape. PlantUML cannot be called. Start pdflatex/lualatex with -shell-escape. + }{} \fi +\makeatother |