summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/tikzscale
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/tikzscale')
-rw-r--r--Master/texmf-dist/source/latex/tikzscale/tikzscale.dtx26
1 files changed, 21 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/latex/tikzscale/tikzscale.dtx b/Master/texmf-dist/source/latex/tikzscale/tikzscale.dtx
index d5f7a29bb9e..86edfbf42d4 100644
--- a/Master/texmf-dist/source/latex/tikzscale/tikzscale.dtx
+++ b/Master/texmf-dist/source/latex/tikzscale/tikzscale.dtx
@@ -95,7 +95,7 @@ and the derived files tikzscale.ins,
%</internal>
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tikzscale}[2012/11/02 v0.1.2 tikzscale LaTeX package]
+\ProvidesPackage{tikzscale}[2012/11/03 v0.1.3 tikzscale LaTeX package]
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\RequirePackage{pgfkeys}
@@ -186,6 +186,7 @@ and the derived files tikzscale.ins,
%\changes{v0.1}{2012/10/31}{First public release}
%\changes{v0.1.1}{2012/11/02}{Fix some bugs, increase robustness, regenerate externalized files less often}
%\changes{v0.1.2}{2012/11/02}{Fix whitespace issues}
+%\changes{v0.1.3}{2012/11/02}{Fix error when loading TikZ but not PGFPlots; Fix error when scaling complicated TikZ graphics}
% \section{Introduction}
% When dealing with graphics, there are different scaling demands. For \emph{absolute} scaling, a width and/or height is given. Opposed to that, for relativ scaling, a horizontal and/or vertical scaling factor is needed. This package only is about absolute scaling of tikzpicture environments. The different absolute scaling demands and their solutions are shown in table \ref{scalingDemands}.
% \begin{table}
@@ -386,6 +387,11 @@ and the derived files tikzscale.ins,
% \begin{itemize}
% \item Created the \cmd{\xcmd} macro for this package, which is used in the documentation.
% \end{itemize}
+% \item Prof. Kai Arzheimer
+% \begin{itemize}
+% \item Reported a bug when not using TikZ without PGFPlots, which lead to a fix.
+% \item Reported a bug that a non-existent macro is used, which lead to a fix.
+% \end{itemize}
% \end{itemize}
%
%
@@ -767,10 +773,20 @@ and the derived files tikzscale.ins,
\tikzscale@includeAxisRatio{#2}%
}{test {\ifundef{\requestedAxisRatio}}}{%
% \end{macrocode}
- % If only either width or height is given it can be a normal tikzpicture or a plot with axisratio=1. Let's guess that it is a plot with default axisratio. If the guess is wrong, the called function detects that scaling the plot does not work and automatically calls \cmd{\tikzscale@includeNormalTikzpicture}.
+ % Use this test as a check if PGFPlots has been loaded.
% \begin{macrocode}
- \def\requestedAxisRatio{1}%
- \tikzscale@includeAxisRatio{#2}%
+ \ifdef{\pgfplotsset}{%
+% \end{macrocode}
+ % If only either width or height is given it can be a normal tikzpicture or a plot with axisratio=1. Let's guess that it is a plot with default axisratio. If the guess is wrong, the called function detects that scaling the plot does not work and automatically calls \cmd{\tikzscale@includeNormalTikzpicture}.
+% \begin{macrocode}
+ \def\requestedAxisRatio{1}%
+ \tikzscale@includeAxisRatio{#2}%
+ }{%
+% \end{macrocode}
+ % If PGFPlots has not been loaded, it can only be a TikZPicture.
+% \begin{macrocode}
+ \tikzscale@includeNormalTikzpicture{#2}%
+ }%
}{%
% Everything else results in an error.
\tikzscale@invalidKeyError{#2}%
@@ -899,7 +915,7 @@ and the derived files tikzscale.ins,
% \end{macrocode}
% First divide before multiply to avoid overflowing (at 16384).
% \begin{macrocode}
- \pgfmathparsemacro{\errorRatio}{\measuredIntermediate/\requestedSize}%
+ \pgfmathsetmacro{\errorRatio}{\measuredIntermediate/\requestedSize}%
\pgfmathsetglobalmacro{\tikzscale@scale}{\tikzscale@scale/\errorRatio}%
}{%
\breakforeach%