-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbmpsize-hack.tex
More file actions
38 lines (38 loc) · 820 Bytes
/
bmpsize-hack.tex
File metadata and controls
38 lines (38 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
\RequirePackage{bmpsize-base}
\RequirePackage{ifpdf}
\makeatletter
% Fix \includegraphics for dvi mode, but only if not making a pdf
\ifpdf
\expandafter\@gobble
\else
\expandafter\@firstofone
\fi{%
\AtBeginDocument{%
\let\Gin@ii@old=\Gin@ii
\def\Gin@ii[#1]#2{%
\begingroup
\let\@found\@empty
\@for\@type:=\bmpsize@types\do{%
\ifx\@found\@empty
\@nameuse{bmpsize@read@\@type}{#2.\@type}%
\ifbmpsize@ok
\let\@found=\@type
\fi
\fi
\ifx\@found\@empty
\@nameuse{bmpsize@read@\@type}{#2}%
\ifbmpsize@ok
\let\@found=\@type
\fi
\fi
}%
\ifx\@found\@empty
\Gin@ii@old[#1]{#2}%
\else
\Gin@ii@old[natwidth=\bmpsize@width bp,natheight=\bmpsize@height bp,#1]{#2}%
\fi
\endgroup
}%
}
}
\makeatother