Not sure what is beyond the capability of latex export and what might be a bug.
1. Font sizes don't seem to be respected. For example:
@startuml
head: <img:myLogo.png>
skinparam LegendBackgroundColor LightGrey
skinparam LegendFontSize 8
:A;
:B;
legend right
**References:**
# [[http://dx.doi.org/10.1056/NEJMoa1011923 Conroy et al. N Engl J Med 2011; 364:1817-25]]
# [[http://dx.doi.org/JCO.1997.15.6.2403 Burris et al. J Clin Oncol 1997; 15:2403-13]]
end legend
@enduml
The legend and the A and B are the same size. Same applies to text elsewhere. The legend box however is reduced in size, so the text doesn't fit. It appears the uml gets its font from the latex document (if the document is serif its serif, if its sans its sans)
I'm not good with font sizing in latex! But if I do: \footnotesize in front of the text in a node it is smaller. So if plantuml could pass some text sizing info it should be possible.
2. Hyperlinks don't work. They look like links (blue underline, no link address shown etc, but they aren't clickable
From the example above the latex for the first line of legend is:
\node at (557.6215pt,973.5996pt)[below right,color=black]{1.};
\node at (566.4882pt,973.5996pt)[below right,color=plantucolor0004]{\underline{Conroy et al. N Engl J Med 2011; 364:1817-25}};
Manually 'hacking' that to:
\node at (557.6215pt,973.5996pt)[below right,color=black]{1.};
\node at (566.4882pt,973.5996pt)[below right,color=plantucolor0004]{\href{http://dx.doi.org/10.1056/NEJMoa1011923}{Conroy et al. N Engl J Med 2011; 364:1817-25}};
Gives me a link that opens (should probably actually leave the /underline as this isn't underlined.
(Needs \usepackages{hypperref} in the premble)
3. PNG image in header shows as NULL
The latex code for that is:
\node at (609.1542pt,10pt)[below right]{{null}};
So its plant that is providing the "NULL".
Replacing that with
\node at (609.1542pt,10pt)[below right]{\includegraphics{myLogo.png}};
Sort of works. There is a scaling issue because I've scaled the whole think (see below) and this doesn't scale with it but its close to what I'd want.
4. Scaling the image to the page
Outputing a large (wide or tall) uml it runs off the end of the page. I was able to wrap my code to scale it but it requires a manual edit...
... \begin{tikzpicture}[scale=\tikzscale, yscale=-1,
With this hack in the pre-amble
\usepackage{environ}
\makeatletter
\newsavebox{\measure@tikzpicture}
\NewEnviron{scaletikzpicturetowidth}[1]{%
\def\tikz@width{#1}%
\def\tikzscale{1}\begin{lrbox}{\measure@tikzpicture}%
\BODY
\end{lrbox}%
\pgfmathparse{#1/\wd\measure@tikzpicture}%
\edef\tikzscale{\pgfmathresult}%
\BODY
}
\makeatother
And then inputing the uml using:
\begin{scaletikzpicturetowidth}{\textwidth}
\input{myFlow.latex}
\end{scaletikzpicturetowidth}
And that is only scaling width not height.
Is there a better way to do this?
What I'm trying to achieve is a PDF document with 5 or 6 full A4 page size UMLs that may need scaled to fit (scale down, but not up). They need clickable html links. There will be a parallel set of SVGs which will be embedded in a website. Those SVGs are clickable (). The PNG logo is about attributing ownership and copyright info etc and so is needed in the SVGs where they are stand alone files if saved. The PDF could have them in the other latex bit.
If latex could just import an SVG I'd probably be fine!