latex error: file 'subfigure.sty' not found

原创 2017年04月19日 17:55:28

想用Latex并列插入多个图片,出现“latex error: file 'subfigure.sty' not found”错误!

原因:当前安装的Latex里面没有subfigure包!


解决方法:

把subfigure包添加到当前工程,具体步骤:

Step1:复制http://www.tug.org.in/tutorial/src/subfigure.sty里面的所有内容;

Step2:在当前工程下面创建文件,命名为:subfigure.sty;

Step3:将Step1复制的内容粘贴到Step2创建的文件中。


并列插入图片的例子:

\begin{figure*}
    \centering

        \subfigure[K**dup]{\label{fig:subfig:a}
        \includegraphics[width=0.23\linewidth]{./pic***p.eps}}
        %\hspace{0.01\linewidth}
        %\vfill
        \subfigure[Ce**up]{\label{fig:subfig:b}
        \includegraphics[width=0.23\linewidth]{./pics/ge***up.eps}}
        %\hspace{0.01\linewidth}
        %\vfill
        \subfigure[A**up]{\label{fig:subfig:c}
        \includegraphics[width=0.23\linewidth]{./pics/ge***edup.eps}}
        %\hspace{0.01\linewidth}
        %\hfill
        \subfigure[t**up]{\label{fig:subfig:d}
        \includegraphics[width=0.23\linewidth]{./pics/gene***up.eps}}
\end{figure*}

注:插入图片要引用的包有:

\usepackage{graphicx}
\usepackage{subfigure}


http://www.tug.org.in/tutorial/src/subfigure.sty里面的内容如下:

%% 
%% This is file `subfigure.sty',
%% generated with the docstrip utility.
%% 
%% The original source files were:
%% 
%% subfigure.dtx  (with options: `package')
%% 
%% Copyright (C) 1988-1995 Steven Douglas Cochran. 
%% 
%% This file is NOT the source for subfigure, because almost all comments 
%% have been stripped from it. It is NOT the preferred form of subfigure 
%% for making modifications to it. 
%% 
%% Therefore you can NOT redistribute and/or modify THIS file. You can 
%% however redistribute the complete source (subfigure.dtx and 
%% subfigure.ins) and/or modify it under the terms of the GNU General 
%% Public License as published by the Free Software Foundation; either 
%% version 2, or (at your option) any later version. 
%% 
%% The subfigure package is distributed in the hope that it will be 
%% useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
%% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
%% GNU General Public License for more details. 
%% 
%% You should have received a copy of the GNU General Public License 
%% along with this program; if not, write to the Free Software 
%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% @LaTeX-style-file{
%%    Author     = "Steven Douglas Cochran",
%%    Version    = "2.0",
%%    Date       = "1995/03/06",
%%    Time       = "14:43:14",
%%    Filename   = "subfigure.sty",
%%    Address    = "Digital Mapping Laboratory, School of Computer Science
%%                  Carnegie-Mellon University, 5000 Forbes Avenue
%%                  Pittsburgh, PA 15213-3891, USA",
%%    Telephone  = "(412) 268-5654",
%%    FAX        = "(412) 268-5576",
%%    Email      = "sdc+@CS.CMU.EDU (Internet)",
%%    CodeTable  = "ISO/ASCII",
%%    Keywords   = "LaTeX2e, float, figure, table",
%%    Supported  = "yes",
%%    Abstract   = "LaTeX package for providing support for the
%%                  inclusion of small, `sub,' figures and tables.  It
%%                  simplifies the positioning, captioning and
%%                  labeling of them within a single figure or table
%%                  environment.  In addition, this package allows
%%                  such sub-captions to be written to the List of
%%                  Figures or List of Tables if desired."
%% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\if@compatibility\undefined\else
  \NeedsTeXFormat{LaTeX2e}
  \ProvidesPackage{subfigure}[1995/03/06 v2.0 subfigure package]
  \typeout{Package: subfigure 1995/03/06 v2.0}
\fi
\newif\ifsubcaphang
\newif\ifsubcapcenter
\newif\ifsubcapcenterlast
\newif\ifsubcapnooneline
\newcommand{\subfigtopskip}{10pt}
\newcommand{\subfigbottomskip}{10pt}
\newcommand{\subfigcapskip}{10pt}
\newcommand{\subfigcapmargin}{10pt}
\newcommand{\subcapsize}{}
\newcommand{\subcaplabelfont}{}
\newcounter{subfigure}[figure]
\def\thesubfigure{(\alph{subfigure})}
\newcommand{\@thesubfigure}{{\subcaplabelfont\thesubfigure}\space}
\let\p@subfigure\thefigure
\let\ext@subfigure\ext@figure
\newcommand{\l@subfigure}{%
  \@dottedxxxline{\ext@subfigure}{2}{3.9em}{2.3em}}
\newcounter{lofdepth}
\setcounter{lofdepth}{1}
\newcounter{subtable}[table]
\def\thesubtable{(\alph{subtable})}
\newcommand{\@thesubtable}{{\subcaplabelfont\thesubtable}\space}
\let\p@subtable\thetable
\let\ext@subtable\ext@table
\newcommand{\l@subtable}{%
  \@dottedxxxline{\ext@subtable}{2}{3.9em}{2.3em}}
\newcounter{lotdepth}
\setcounter{lotdepth}{1}
\ifx\if@compatibility\undefined
  \subcaphangfalse
  \subcapcenterfalse
  \subcapcenterlastfalse
  \def\subcapsize{\footnotesize}
\else
  \DeclareOption{normal}{%
    \subcaphangfalse
    \subcapcenterfalse
    \subcapcenterlastfalse
    \subcapnoonelinefalse}
  \DeclareOption{hang}{\subcaphangtrue}
  \DeclareOption{center}{\subcapcentertrue}
  \DeclareOption{centerlast}{\subcapcenterlasttrue}
  \DeclareOption{nooneline}{\subcapnoonelinetrue}
  \DeclareOption{isu}{\ExecuteOption{hang}}
  \DeclareOption{anne}{\ExecuteOption{centerlast}}
  \DeclareOption{scriptsize}{\renewcommand{\subcapsize}{\scriptsize}}
  \DeclareOption{footnotesize}{\renewcommand{\subcapsize}{\footnotesize}}
  \DeclareOption{small}{\renewcommand{\subcapsize}{\small}}
  \DeclareOption{normalsize}{\renewcommand{\subcapsize}{\normalsize}}
  \DeclareOption{large}{\renewcommand{\subcapsize}{\large}}
  \DeclareOption{Large}{\renewcommand{\subcapsize}{\Large}}
  \DeclareOption{up}{\renewcommand{\subcaplabelfont}{\upshape}}
  \DeclareOption{it}{\renewcommand{\subcaplabelfont}{\itshape}}
  \DeclareOption{sl}{\renewcommand{\subcaplabelfont}{\slshape}}
  \DeclareOption{sc}{\renewcommand{\subcaplabelfont}{\scshape}}
  \DeclareOption{md}{\renewcommand{\subcaplabelfont}{\mdseries}}
  \DeclareOption{bf}{\renewcommand{\subcaplabelfont}{\bfseries}}
  \DeclareOption{rm}{\renewcommand{\subcaplabelfont}{\rmfamily}}
  \DeclareOption{sf}{\renewcommand{\subcaplabelfont}{\sffamily}}
  \DeclareOption{tt}{\renewcommand{\subcaplabelfont}{\ttfamily}}
  \ExecuteOptions{normal,footnotesize}
  \ProcessOptions
\fi
\newcommand{\subfigure}{%
  \bgroup
    \advance\csname c@\@captype\endcsname\@ne
    \refstepcounter{sub\@captype}%
    \leavevmode
    \@ifnextchar [%
      {\@subfloat{sub\@captype}}%
      {\@subfloat{sub\@captype}[\@empty]}}
\let\subtable\subfigure
\def\@subfloat#1[#2]#3{%
    \setbox\@tempboxa \hbox{#3}%
    \@tempdima=\wd\@tempboxa
    \vtop{%
      \vbox{
        \vskip\subfigtopskip
        \box\@tempboxa}%
      \ifx \@empty#2\relax \else
        \vskip\subfigcapskip
        \@subcaption{#1}{#2}%
      \fi
      \vskip\subfigbottomskip}%
  \egroup}
\newcommand{\@subfigcaptionlist}{}
\newcommand{\@subcaption}[2]{%
  \begingroup
    \let\label\@gobble
    \def\protect{\string\string\string}%
    \xdef\@subfigcaptionlist{%
      \@subfigcaptionlist,%
      {\protect\numberline {\@currentlabel}%
       \noexpand{\ignorespaces #2}}}%
  \endgroup
  \@nameuse{@make#1caption}{\@nameuse{@the#1}}{#2}}
\newcommand{\@makesubfigurecaption}[2]{%
  \setbox\@tempboxa \hbox{%
    \subcapsize
    \ignorespaces #1%
    \ignorespaces #2}%
  \@tempdimb=-\subfigcapmargin
  \multiply\@tempdimb\tw@
  \advance\@tempdimb\@tempdima
    \hbox to\@tempdima{%
      \hfil
      \ifdim \wd\@tempboxa >\@tempdimb
         \subfig@caption{#1}{#2}%
      \else\ifsubcapnooneline
         \subfig@caption{#1}{#2}%
      \else
        \box\@tempboxa
      \fi\fi
      \hfil}}
\let\@makesubtablecaption\@makesubfigurecaption
\newcommand{\subfig@caption}[2]{%
  \ifsubcaphang
    \sbox{\@tempboxa}{%
      \subcapsize
      \ignorespaces #1}%
    \addtolength{\@tempdimb}{-\wd\@tempboxa}%
    \usebox{\@tempboxa}%
    \subfig@captionpar{\@tempdimb}{#2}%
  \else
    \subfig@captionpar{\@tempdimb}{#1#2}%
  \fi}
\newcommand{\subfig@captionpar}[2]{%
  \parbox[t]{#1}{%
    \strut
    \ifsubcapcenter
      \setlength{\leftskip}{\@flushglue}%
      \setlength{\rightskip}{\@flushglue}%
      \setlength{\parfillskip}{\z@skip}%
    \else\ifsubcapcenterlast
      \addtolength{\leftskip}{0pt plus 1fil}%
      \addtolength{\rightskip}{0pt plus -1fil}%
      \setlength{\parfillskip}{0pt plus 2fil}%
    \fi\fi
    \subcapsize
    \ignorespaces #2%
    \par}}
\newcommand{\@dottedxxxline}[6]{%
  \ifnum #2>\@nameuse{c@#1depth}\else
    \@dottedtocline{0}{#3}{#4}{#5}{#6}
  \fi}
\let\subfig@oldcaption\@caption
\long\def\@caption#1[#2]#3{%
  \subfig@oldcaption{#1}[{#2}]{#3}%
  \@for \@tempa:=\@subfigcaptionlist \do {%
    \ifx\@empty\@tempa\relax \else
      \addcontentsline
        {\@nameuse{ext@sub#1}}%
        {sub#1}%
        {\@tempa}%
    \fi}%
  \gdef\@subfigcaptionlist{}}
\endinput
%% 
%% End of file `subfigure.sty'.




版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

LaTeX报错解决办法 Error: File 'amsmath.sty' not found

! LaTeX Error: File `amsmath.sty' not found. 解决方法:安装amsmath和amscls 包。
  • ZhuWho
  • ZhuWho
  • 2015年02月25日 20:49
  • 7336

LaTeX Error: File `lastpage.sty' not found. 解决办法

又是参考一堆。。。。 LaTeX .sty文件缺失解决办法 点击打开链接 关键在于把.sty文件找回来。有些宏包可能是从CTAN直接下载就有sty文件在,那样就是直接cp再texhas...

Delphi7高级应用开发随书源码

  • 2003年04月30日 00:00
  • 676KB
  • 下载

latex sty文件缺失问题

安装style文件方法一:自动安装terminal中sudo tlmgr install xxxx方法二:半自动安装如果压缩包中没有sty文件,可以先用latex命令编译一下sudo latex pa...

安装subfigure宏包(ubuntu)

>> 到CTAN上下载宏包 >> 解压后用latex编译dtx文件,得到sty文件 unzip subfigure.zip cd subfigure latex subfigure.dtx ...

ubuntu中latex解决“fontspec error: "font-not-found"”

问题的具体形式是: 这是因为我们的系统中没有安装宋体。 可以用命令fc-list :lang=ch来查看系统安装了哪些中文字体。 解决问题主要有以下几步: 1. 用font-manager来安装...
  • up_com
  • up_com
  • 2016年04月08日 21:45
  • 1569

win7硬盘安装Ubuntu12.04 64位时显示Error 15: File not found.

安装Ubuntu12.04 -64位时,用EasyBCD建好引导文件重启电脑后出现如下错误: Error 15: File not found 原因一个是安装文件所在盘符不对,另一个是文件名。Ubun...

WCF部署:IIS 7.0 - HTTP Error 404.17 - Not Found - Static File

Thread: IIS 7.0 - HTTP Error 404.17 - Not Found - Static File Handler.Last post 02-05-2011 3:52 PM b...
  • rise51
  • rise51
  • 2011年03月04日 13:29
  • 2698

OpenFileMapping失败 原因ERROR_FILE_NOT_FOUND

OpenFileMapping失败 原因ERROR_FILE_NOT_FOUND 两个win32 console的工程,每个代表一个进程,利用共享内存在两个进程之间通信,过程中遇...

error: file '/boot/grub/i386-pc/normal.mod' not found解决方案

真实讲述怎么一步步解决error: file '/boot/grub/i386-pc/normal.mod' not found问题的
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:latex error: file 'subfigure.sty' not found
举报原因:
原因补充:

(最多只允许输入30个字)