Overleaf 无法识别 [b] 图形位置

Overleaf 无法识别 [b] 图形位置

我想将图形放置在页面底部,但 Overleaf 无法识别任何图形的 [b]。以下是图形的代码:


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[b]  % order of priority: h here, t top, b bottom, p page
  \centering
  \includegraphics[width=\textwidth]{Images/Image.png}
  \caption{CaptionText}
  \label{fig:label}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

使用上述命令,图形将不会显示,直到下一个\cleardoublepage命令。如果没有\cleardoublepage命令,则它根本不会显示在 pdf 中。如果后面跟着另一个放置命令,例如,[bthp]它会遵循下一个命令。因此[bthp]图形将转到页面顶部。

我正在使用此处找到的模板:链接似乎不起作用...详情如下但我已经添加了几个包,包括wrapfig。

这可能相关也可能不相关,但还有其他随机命令未执行,例如\newpage不会创建新页面,我必须用空行分隔段落。我以前不需要这样做。我认为样式中可能存在某些问题,但我不知道是什么。所有包和样式都在 packages.sty 文件中。

该文档设置为将项目中保存的 .tex 文件(使用 import 包)导入到 main.tex 文件中。这也可能是问题所在,也许吧,我不知道。

我希望有人能帮助我找出这些事情发生的原因,更重要的是,告诉我如何解决这个问题,这样我就可以使用 [b] 放置命令将图形放在页面底部。[bh] 很棘手,将是最后手段。

我看过:https://www.overleaf.com/learn/how-to/Include_images_on_Overleafhttps://www.overleaf.com/learn/latex/Positioning_of_Figures 提前致谢!

有关设置的信息 来自 main.tex

% Author - Jon Arnt Kårstad, NTNU IMT
\documentclass{article} %Change to report?

% Importing document settings from our file "packages.sty"
\usepackage{packages}

% Beginning of document
\begin{document}

% Inserting title page
\import{./}{title}

% Defining front matter settings (Norsk: innstillinger for forord m.m.)
\frontmatter

\import{./Sections}{0-Proposal}
\newpage

\import{./Sections/}{0a-abstract}

\newpage

% Inserting table of contents
\tableofcontents

% Inserting list of figures & list of tables
\newpage 
\listoffigures
\listoftables

% Defining main matter settings (Norsk: innstillinger for hoveddelen av teksten)
\mainmatter

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%Paper%%%%%

\import{./Sections/}{1-Introduction}

\cleardoublepage

\import{./Sections/}{2a-AquacultureInNorway}

\cleardoublepage

\import{./Sections/}{2b-HydrodynamicTheory}

\cleardoublepage

\import{./Sections/}{3-Methodology}
\newpage

\import{./Sections/}{4-Model}
\newpage

\import{./Sections/}{5-Results}
\newpage

\import{./Sections/}{6-Analysis}
\newpage

\import{./Sections/}{7-Conclusion}
\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%
%%TemplateHelp%%%%%%%%%%%

% Example section added from an external tex-file, here located in ./Sections/
\import{./Sections/}{Example_section}


% Printing bibliography
\newpage
\printbibliography[heading = bibintoc, title = Bibliography]  
%'bibintoc' inserts our bibliography into the table of contents

% Inserting appendix with separate settings
\addappendix

\import{./Sections}{Example_section}
\import{./Appendices}{example_appendix}


% End of document
\end{document}

来自 packages.sty

% Author - Jon Arnt Kårstad, NTNU IV-IMT

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{packages}[2021/04/20 Packages]
\usepackage[utf8]{inputenc} % Character encoding

% ------ Contents -------
% Appendices
% Bibliography & References
% Code input
% Flow charts
% Front matter
% General
% Image
% Language
% Main matter
% Mathematics
% Page setup
% -----------------------

% --- Appendices ---
\usepackage{appendix}
\newcommand{\addappendix}{   % Self-created command to insert appendix with predefined settings
    \newpage
    \appendix
    \section*{Appendix}   % Name of appendix
    \addcontentsline{toc}{section}{Appendix}  % Add appendix name to table of contents
    \renewcommand{\thesubsection}{\Alph{subsection}}    % Change numbering of section to upper-case letters.
}

% --- Bibliography & References---  
\usepackage[backend = biber,    % Recommended backend for sorting bibliography
            %style = authoryear-comp,    % Close to the 'Harvard' referencing style
            style = ieee,    % Close to the 'Harvard' referencing style
            urldate = long,     % Long: 24th Mar. 1997 | Short: 24/03/1997
           %maxcitenames = 2,   % Number of authors in cite before replaced with 'Author#1 et al.'
            ]{biblatex}
\addbibresource{references.bib}     % Adding our file containing the references
% \addbibresource{zotero.bib} %zotero index

\usepackage[labelfont={it, bf},textfont={it}]{caption}        % Enables controlling the look and feel of captions, see package documentation
\usepackage[labelfont={bf, it},textfont={it}]{subcaption}     % Recommended when making sub-figures
\usepackage[nottoc]{tocbibind}  % Includes Bibliography, Index, list of Listing etc. to table of contents
\newcommand{\source}[1]{\vspace{-4pt} \caption*{\hfill \footnotesize{Source: {#1}} } }   % Easily insert sources in images

% --- Code ---
\usepackage{minted} % Includes several programming languages and styles, visit --https://www.ntnu.no/wiki/display/imtsoftware/Code+in+LaTeX-- for more information and examples

% --- Flow Charts ---
% Keep in mind that you may customize these flow chart settings to fit your own preferences.
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,mindmap, trees, arrows.meta, decorations.pathmorphing, backgrounds, positioning, fit, petri}
\tikzstyle{decision} = [diamond, draw, fill=blue!20, 
    text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20, 
    text width=5em, text centered, rounded corners, minimum height=4em, anchor=north]
\tikzstyle{block2} = [rectangle, draw, fill=blue!20, 
    text width=15em, text centered, rounded corners, minimum height=4em, inner sep=0pt]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
    minimum height=2em,]

%--- Tables ---
% Example in example_appendix:
% https://www.overleaf.com/learn/latex/Tables

\usepackage{array}
\usepackage{multirow}
\usepackage{multicol}


% --- Front matter ---
% Front matter is located before the table of contents, e.g. preface (Norsk: forord) and often has separate settings
\newcommand{\frontmatter}{
    \pagenumbering{roman}   % Setting page numbering to lower-case roman
}

% --- General ---
\usepackage{import}     % Enable importing of sections
\usepackage{csquotes}   % Provides international handling of quote marks. Especially useful for bibliography management using BibLaTeX
\usepackage{hyperref}   % Hyper-references, possible to change color
\hypersetup{    % Color of hyper-references
    colorlinks,
    citecolor = black,
    filecolor = black,
    linkcolor = black,
    urlcolor = black
}
\usepackage{comment}    % Comment blocks of text using \begin{comment} ... \end{comment}
\usepackage{pdfpages}   % Enables import of pdf-pages using e.g. \includepdf[pages=-]{./my_pdf.pdf}

% --- Image ---
\usepackage{graphicx}   % Handle images
\usepackage{wrapfig}    % Wrap text around images
\usepackage{float}      % Force image location using "H"
\usepackage{url}        % Insert urls
\urlstyle{sf}           % Set url-style as "sans-serif". Other options are e.g. "same" or "rm"
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}   % Ruler


% --- Language ---
\usepackage{siunitx}    % Enable SI units
\usepackage[british]{babel}     % Defining UK English as language. This will among other things ensure that dates are displayed as 24/03/1997 rather than 03/24/1997 in the bibliography.
\addto\extrasbritish{   % Change naming of different functions, e.g. figure references.
    \renewcommand*\contentsname{Table of Contents}  % Rename table of contents
    \renewcommand{\listfigurename}{List of Figures} % Rename list of figures
    \renewcommand{\listtablename}{List of Tables}   % Rename list of tables
    \def\equationautorefname{Equation}              % Autoref-name for equations
    \def\figureautorefname{Figure}                  % Autoref-name for figures
    \def\tableautorefname{Table}                    % Autoref-name for tables
    \def\sectionautorefname{Section}                % Autoref-name for sections
    \def\subsectionautorefname{\sectionautorefname} % Autoref-name for subsections
    \def\subsubsectionautorefname{\sectionautorefname} % Autoref-name for subsubsections
}

% --- Main matter ---
% This is the main part of the paper.
\newcommand{\mainmatter}{
    \newpage
    \pagenumbering{arabic}  % Setting page numbering to normal integers
}

% --- Mathematics ---
\usepackage{bm}         % Bold text in math mode
\usepackage{amsmath}    % Math formulas and improved typographical quality of their output
\usepackage{amssymb}    % Extended symbol collection
\usepackage{amsthm}     % Helps define theorem-like structures
\usepackage{textcomp}   % Used in the package "gensymb" (below), which will give warnings if "textcomp" is not imported in advance
\usepackage{gensymb}    % Adds extra generic symbols for math and text mode, e.g. \degree

% --- Page setup ---
\usepackage[a4paper, total={150mm, 245mm,footskip = 14mm}]{geometry}
\setlength{\parindent}{0em}
\setlength{\parskip}{0.8em}

% Customized header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0.1ex}
\renewcommand{\footrulewidth}{0.1ex}
\fancyfoot[C]{\thepage}

@DavidCarlisle:这是文献综述部分的开头:

\section{Literature Review}
\label{Litrev}
This section describes the current state of  art solutions relevant to this project. 

\subsection{Aquaculture in Norway}
\subsubsection{Governmental perspective}

In December 2020, The Ocean Panel, a group of 14 heads of state from countries representing 40\% of the world's coastlines and of which Norway's Erna Solberg was a member, launched the “New Ocean Action Agenda”. This was a call to action for all coastlines to be sustainably managed by 2030. This was a two-year effort that resulted in a comprehensive report detailing how to support a growing human population while protecting the oceans from increased impact of said growth. Aquaculture features predominantly in both solutions. In it, they commit to increasing the “productivity of fisheries and aquaculture production” in order to “enhance food security, improve nutrition, human health and well-being, create sustainable economic growth and jobs and prevent the widening
of current inequities” \cite{Transformations_2020}.  

This was followed by the July 2021 release of the Norwegian government's strategy for utilization of ocean resources, with a picture of an aquaculture site in the cover. It reiterated the Panel's commitment to sustainable, but increased, production of farmed fish \cite{havbruksstrategien_2021}. 

One initiative is a call for simplifying the new-site licensing review of the current  process through various oversight divisions, illustrated in Figure \ref{fig:applications}. The desire is to make the application process streamlined by digitalizing publicizing data. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[!bht]  % order of priority: h here, t top, b bottom, p page
  \centering
  \includegraphics[width=\textwidth]{Images/applications.png}
  \caption{Approval process for new aquaculture licenses.  \citefield [Translated from][]{havbruksstrategien_2021}{title} \cite{havbruksstrategien_2021}.}
  \label{fig:applications}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It also calls for the aquaculture law, or NYTEK, to be updated to reflect the twin goals of a more transparent application process that uniformly ensures stricter control over negative environmental effects. Another objective is to ensure innovation by making the law as technology neutral as possible. The paper outlines the directives for NYTEK22, which was in hearing when the government published the strategy plan, increasing the probability for the law passing next year \cite{havbruksstrategien_2021}.  

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[bht]  % order of priority: h here, t top, b bottom, p page
  \centering
  \includegraphics[width=\textwidth]{Images/costs.png}
  \caption{Cost layout in aquaculture by research areas from 2009-2019 \cite{havbruksstrategien_2021}}
  \label{fig:costs}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\lipsum[1-10]

如果需要的话继续文字。

答案1

来自评论:

图表的放置取决于整个文档,因此你没有提供足够的信息,尽管文章类 a 底部图片不得超过页面的 30%,并使用 [b]您正在阻止其他所有位置,因此超过该尺寸的图形将不允许出现在任何地方,因此将转到文档的末尾。

@DavidCarlisle:我认为这可能是原因;页面的 30% 大小。我正在使用文章文档类。这可以在模板链接中看到。大多数文本宽度的图像将使用超过 30% 的页面。我可以更改规则的这一方面而不更改文档类吗?我甚至不知道什么搜索字符串可以查找该问题。

! 将导致 30% 规则被忽略

[!b]

相关内容