diff options
author | Karl Berry <karl@freefriends.org> | 2024-09-17 19:56:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-09-17 19:56:14 +0000 |
commit | 24c86d8f923f6049b8f2df20a2d2756c3a34913e (patch) | |
tree | e696f25e95ac053a7f217117665edbeb6dcb7c57 /Master | |
parent | 72624704e11fac8652023cea69e4da2cced056de (diff) |
plantuml (17sep24)
git-svn-id: svn://tug.org/texlive/trunk@72315 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md | 12 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/README.md | 25 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--svg.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-component-diagram.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/example-multiple-diagrams-svg.tex | 42 | ||||
-rw-r--r-- | Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf | bin | 47705 -> 48809 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/plantuml/plantuml.lua | 9 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty | 8 |
8 files changed, 90 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md b/Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md index d52aecffd6d..6cc76d6b7c7 100644 --- a/Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md +++ b/Master/texmf-dist/doc/lualatex/plantuml/CHANGELOG.md @@ -5,13 +5,21 @@ 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.4.0] – 2024-09-17 + +### Fixed + +- Updated command-line parameters for inkscape. [#33](https://github.com/koppor/plantuml/pull/33) +- Updated command-line parameters for plantuml. [#33](https://github.com/koppor/plantuml/pull/33) +- Works if multiple diagrams are present. [#15](https://github.com/koppor/plantuml/issues/15), [#17](https://github.com/koppor/plantuml/issues/17) + ## [0.3.2] – 2023-05-12 ### Changed - Updated file extension for including diagrams to `.tex` to align with changes introduced in PlantUML v1.2023.0. This change is not backwards compatible with - older versions of PlantUML. + older versions of PlantUML. [#29](https://github.com/koppor/plantuml/pull/29) ## [0.3.1] – 2020-05-19 @@ -66,7 +74,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Initial public release -[unreleased]: https://github.com/koppor/plantuml/compare/0.3.2...HEAD +[0.4.0]: https://github.com/koppor/plantuml/compare/0.3.2...0.4.0 [0.3.2]: https://github.com/koppor/plantuml/compare/0.3.1...0.3.2 [0.3.1]: https://github.com/koppor/plantuml/compare/0.3.0...0.3.1 [0.3.0]: https://github.com/koppor/plantuml/compare/0.2.3...0.3.0 diff --git a/Master/texmf-dist/doc/lualatex/plantuml/README.md b/Master/texmf-dist/doc/lualatex/plantuml/README.md index 0a9f37cba9f..bbd4adb0e00 100644 --- a/Master/texmf-dist/doc/lualatex/plantuml/README.md +++ b/Master/texmf-dist/doc/lualatex/plantuml/README.md @@ -14,7 +14,7 @@ Check [issue #1](https://github.com/koppor/plantuml/issues/1) for the current st 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`. +2. Windows: Environment 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. @@ -55,6 +55,29 @@ Check [issue #1](https://github.com/koppor/plantuml/issues/1) for the current st \usepackage{graphics} \usepackage{epstopdf} \epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{ + inkscape #1 --export-filename=\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} +``` + +**For older Inkscape use this LaTeX source:** + +```latex +\documentclass{scrartcl} +\usepackage{graphics} +\usepackage{epstopdf} +\epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{ inkscape -z --file=#1 --export-pdf=\OutputFile } \usepackage[output=svg]{plantuml} 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 index 5d7d9b8ed81..f26045d0f21 100644 --- a/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--svg.tex +++ b/Master/texmf-dist/doc/lualatex/plantuml/example-class-relations--svg.tex @@ -8,7 +8,7 @@ % We just include the SVG as is. \usepackage{epstopdf} \epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{% - inkscape -z --file=#1 --export-pdf=\OutputFile + inkscape #1 --export-filename=\OutputFile } \usepackage[output=svg]{plantuml} diff --git a/Master/texmf-dist/doc/lualatex/plantuml/example-component-diagram.tex b/Master/texmf-dist/doc/lualatex/plantuml/example-component-diagram.tex index 785d2e7a561..5ce270d101b 100644 --- a/Master/texmf-dist/doc/lualatex/plantuml/example-component-diagram.tex +++ b/Master/texmf-dist/doc/lualatex/plantuml/example-component-diagram.tex @@ -1,13 +1,13 @@ \documentclass{scrartcl} -\usepackage{graphics} +\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 + inkscape #1 --export-filename=\OutputFile } \usepackage[output=svg]{plantuml} diff --git a/Master/texmf-dist/doc/lualatex/plantuml/example-multiple-diagrams-svg.tex b/Master/texmf-dist/doc/lualatex/plantuml/example-multiple-diagrams-svg.tex new file mode 100644 index 00000000000..359bc6d9600 --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/plantuml/example-multiple-diagrams-svg.tex @@ -0,0 +1,42 @@ +\documentclass{scrartcl} + +\usepackage{graphics} + +\usepackage{epstopdf} +\epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{% + inkscape #1 --export-filename=\OutputFile +} + +\usepackage[output=svg]{plantuml} + +\begin{document} + + \begin{plantuml} + @startuml + () "Interface 2" as I2 + () "Interface 3" as I3 + + [component 1] as c1 + [component 2] as c2 + [component 3] as c3 + + c1 -- I2 + c1 -- I3 + + I2 )-- c2 + I3 )-- c3 + @enduml + \end{plantuml} + +\newpage + + \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/plantuml.pdf b/Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf Binary files differindex ecb703caef6..114c9026ffb 100644 --- a/Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf +++ b/Master/texmf-dist/doc/lualatex/plantuml/plantuml.pdf diff --git a/Master/texmf-dist/tex/lualatex/plantuml/plantuml.lua b/Master/texmf-dist/tex/lualatex/plantuml/plantuml.lua index 7edb923d6b1..8bb14c8abbd 100644 --- a/Master/texmf-dist/tex/lualatex/plantuml/plantuml.lua +++ b/Master/texmf-dist/tex/lualatex/plantuml/plantuml.lua @@ -7,9 +7,6 @@ function convertPlantUmlToTikz(jobname, mode) local plantUmlSourceFilename = jobname .. "-plantuml.txt" local plantUmlTargetFilename = jobname .. "-plantuml." .. mode - -- delete generated file to ensure they are really recreated - os.remove(plantUmlTargetFilename) - if not (lfs.attributes(plantUmlSourceFilename)) then texio.write_nl("Source " .. plantUmlSourceFilename .. " does not exist.") return @@ -25,9 +22,15 @@ function convertPlantUmlToTikz(jobname, mode) local cmd = "java -Djava.awt.headless=true -jar " .. plantUmlJar .. " -charset UTF-8 -t" if (mode == "latex") then cmd = cmd .. "latex:nopreamble" + -- plantuml has changed output format in https://github.com/plantuml/plantuml/pull/1237 + plantUmlTargetFilename = jobname .. "-plantuml.tex" else cmd = cmd .. mode end + + -- delete generated file to ensure they are really recreated + os.remove(plantUmlTargetFilename) + cmd = cmd .. " " .. plantUmlSourceFilename texio.write_nl(cmd) local handle,error = io.popen(cmd) diff --git a/Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty b/Master/texmf-dist/tex/lualatex/plantuml/plantuml.sty index bb978dfa9c6..91c15789e43 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} - [2023/05/12 v0.3.2 + [2024/09/17 v0.4.0 Embed PlantUML diagrams in latex documents.] % Required by PlantUML LaTeX output @@ -24,9 +24,11 @@ \RequirePackage{adjustbox} +\newcounter{PlantUmlFigureNumberSVG} +\def\UMLcountUp{\stepcounter{PlantUmlFigureNumberSVG} \def\PlantUMLJobname{PlantUML\thePlantUmlFigureNumberSVG}} % \jobname has an encoding issue if the .tex filename includes a multibyte string. % One needs to redefine PlantUMLJobname to fix it -\def\PlantUMLJobname{\jobname} +\def\PlantUMLJobname{\jobname\thePlantUmlFigureNumberSVG} \ExplSyntaxOn \keys_define:nn { plantuml } { @@ -93,6 +95,7 @@ \end{adjustbox} }{ \includegraphics[width=\maxwidth{\textwidth}]{\PlantUMLJobname-plantuml.\PlantUmlMode} + \UMLcountUp } } \or @@ -102,4 +105,3 @@ }{} \fi \makeatother - |