Updated tests for new LaTeX template.
This commit is contained in:
parent
9ea9b916af
commit
ac104c4fdb
1 changed files with 6 additions and 16 deletions
|
@ -22,24 +22,14 @@
|
||||||
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
|
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
|
||||||
\usepackage{fancyvrb}
|
\usepackage{fancyvrb}
|
||||||
\usepackage{graphicx}
|
\usepackage{graphicx}
|
||||||
% Redefine \includegraphics so that, unless explicit options are
|
|
||||||
% given, the image width will not exceed the width of the page.
|
|
||||||
% Images get their normal width if they fit onto the page, but
|
|
||||||
% are scaled down if they would overflow the margins.
|
|
||||||
\makeatletter
|
\makeatletter
|
||||||
\def\ScaleIfNeeded{%
|
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
|
||||||
\ifdim\Gin@nat@width>\linewidth
|
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
|
||||||
\linewidth
|
|
||||||
\else
|
|
||||||
\Gin@nat@width
|
|
||||||
\fi
|
|
||||||
}
|
|
||||||
\makeatother
|
\makeatother
|
||||||
\let\Oldincludegraphics\includegraphics
|
% Scale images if necessary, so that they will not overflow the page
|
||||||
{%
|
% margins by default, and it is still possible to overwrite the defaults
|
||||||
\catcode`\@=11\relax%
|
% using explicit options in \includegraphics[width, height, ...]{}
|
||||||
\gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\ScaleIfNeeded]}}%
|
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
|
||||||
}%
|
|
||||||
\ifxetex
|
\ifxetex
|
||||||
\usepackage[setpagesize=false, % page size defined by xetex
|
\usepackage[setpagesize=false, % page size defined by xetex
|
||||||
unicode=false, % unicode breaks when used with xetex
|
unicode=false, % unicode breaks when used with xetex
|
||||||
|
|
Loading…
Reference in a new issue