summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/figsize
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:55:43 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:55:43 +0000
commit1532d9c81824c389182bbd6d69e3298e27e371f2 (patch)
treebce8a8214b420c163a3409546826f22824f9f0e3 /Master/texmf-dist/tex/latex/figsize
parentc865026ba961cdc11740772de201ef95e4cc022b (diff)
figsize
git-svn-id: svn://tug.org/texlive/trunk@913 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/figsize')
-rw-r--r--Master/texmf-dist/tex/latex/figsize/figsize.sty61
1 files changed, 61 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/figsize/figsize.sty b/Master/texmf-dist/tex/latex/figsize/figsize.sty
new file mode 100644
index 00000000000..b472fb0e52c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/figsize/figsize.sty
@@ -0,0 +1,61 @@
+%% FIGSIZE
+%% Package to dynamically size figures relative to the page
+%% size.
+%%
+%% USER COMMANDS
+%% \usepackage{figsize}
+%% If option distort is present then the included images will
+%% be allowed to have different x & y scaling. Otherwise
+%% the aspect ratio will be kept.
+%%
+%% \SetFigLayout[extra lines of space to add]{rows}{cols}
+%% To set the sizes of graphics relative to the page size in a
+%% cell of a matrix with rows and cols specified. Optional
+%% integers can be specified to increase the space allowed for
+%% captions. If a value of 8 is placed, then 8 extra lines of
+%% caption text will be allowed for.
+%%
+%% \includegraphics{file}
+%% To include the graphics with the current most size settings.
+%%
+%%
+%% Anthony Tanbakuchi
+%% Mar.18.2002
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{figsize}[2002/03/18 v0.1 FigSize sizes graphics for graphicx package]
+\RequirePackage{calc}[1998/07/07]
+
+%\RequirePackage[tight]{subfigure}[2002/01/01]
+\RequirePackage{subfigure}
+
+
+\RequirePackage{graphicx}[1999/01/01]
+\RequirePackage{ifthen}[1994/06/01]
+
+ %The new includegraphics command to automatically size figure
+ \let\Oldincludegraphics\includegraphics
+ \renewcommand{\includegraphics}[2][width=\figwidth, totalheight=\figheight, keepaspectratio]{\Oldincludegraphics[#1]{#2}}
+
+
+
+\newlength{\figwidth}
+\newlength{\figheight}
+
+
+\newcommand{\SetFigLayout}[3][0]{\setlength{\figheight}{\textheight}%
+%\addtolength{\figheight}{-0.1\textheight}% 10% for the bottom caption
+%\addtolength{\figheight}{-1.4cm}% for caption text 1 line
+\addtolength{\figheight}{-\baselineskip-\parskip}% for caption text 1 line
+\addtolength{\figheight}{-\abovecaptionskip}%
+\addtolength{\figheight}{-\belowcaptionskip}%
+\setlength{\figheight}{\figheight / #2}%
+\addtolength{\figheight}{(-\baselineskip-\parskip) * (#2-1)}% for subcaption 1 line
+\addtolength{\figheight}{-\baselineskip * #1}% %For additional optional spacing
+%
+\setlength{\figwidth}{\textwidth}%
+\ifthenelse{#3 > 1}{\addtolength{\figwidth}{-0.05\textwidth}}{}% 5% space if multiple cols
+\setlength{\figwidth}{\figwidth / #3}%
+}
+
+\endinput