From e365c5950b1b6ee85123d4b376025a6bb0697f7d Mon Sep 17 00:00:00 2001 From: Max Bolingbroke Date: Sun, 4 Apr 2010 16:36:37 +0800 Subject: Give LaTeX images a maximum width using the prelude only --- tests/writer.latex | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/writer.latex b/tests/writer.latex index dbefdb8fd..4b54b9d07 100644 --- a/tests/writer.latex +++ b/tests/writer.latex @@ -14,6 +14,15 @@ \newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}} \usepackage{url} \usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} \usepackage[breaklinks=true,unicode=true]{hyperref} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} -- cgit v1.2.3