【问题标题】:Why Figure is not displayed in the latex file and text is shown instead of it为什么图不显示在乳胶文件中,而是显示文本而不是它
【发布时间】:2022-01-17 01:23:38
【问题描述】:

我是乳胶新手,并尝试将图形添加到乳胶文件中,如下所示:

\documentclass{bmcart}

%%% Load packages
\usepackage{amsthm,amsmath}

\usepackage[utf8]{inputenc} %unicode support
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{graphicx}


\def\includegraphic{}
\def\includegraphics{}

\startlocaldefs
\endlocaldefs

\begin{document}
    
\begin{figure}[h!]
    \includegraphics{figures/GBMfigure3.jpg}
    \caption{show the results of the different settings for the parameters of the penalty model for solving the problem \ref{q11}.}
    
\end{figure}

\end{document}

但是,没有显示图形,而是显示了文本本身而不是图形,例如生成的文件如下:

那么,请问这个问题的解决方案是什么。

【问题讨论】:

    标签: latex figure


    【解决方案1】:

    使用\def\includegraphics{},您可以重新定义命令以不执行任何操作。如果您希望它包含您的图像,请不要进行这样的重新定义。

    \documentclass{bmcart}
    
    %%% Load packages
    \usepackage{amsthm,amsmath}
    
    \usepackage[utf8]{inputenc} %unicode support
    \usepackage{mathtools}
    \usepackage{amsmath}
    \usepackage{graphicx}
    
    
    %\def\includegraphic{}
    %\def\includegraphics{}
    
    \startlocaldefs
    \endlocaldefs
    
    \begin{document}
        
    \begin{figure}[h!]
        \includegraphics{example-image-duck}
        \caption{show the results of the different settings for the parameters of the penalty model for solving the problem \ref{q11}.}
        
    \end{figure}
    
    \end{document}
    

    【讨论】:

    • 效果很好,非常感谢
    • @Sajjad 不客气!
    猜你喜欢
    • 1970-01-01
    • 2016-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-10
    • 2011-11-21
    相关资源
    最近更新 更多