From 1532d9c81824c389182bbd6d69e3298e27e371f2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2006 23:55:43 +0000 Subject: figsize git-svn-id: svn://tug.org/texlive/trunk@913 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/figsize/figsize.sty | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/figsize/figsize.sty (limited to 'Master/texmf-dist/tex/latex/figsize') 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 -- cgit v1.2.3