使用 hvfloat 包时图形列表中缺少图形

使用 hvfloat 包时图形列表中缺少图形

我正在使用 hvfloat-Package 来包含图形。不幸的是,其中一些图形在图形列表中缺失。一旦我将 nonFloat 选项设置为 true,它们就会重新出现。由于这看起来很丑陋,所以对我来说没有解决办法。我看过 hvfloat 手册,但想不出解决办法。你能帮助我吗?谢谢。Texworks 0.4.5 r1280,Miktex 2.9 64 位。

梅威瑟:

\documentclass[a4paper, 11pt]{scrartcl}
\usepackage{scrhack}
\usepackage{a4wide}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{marvosym}
\DeclareUnicodeCharacter{20AC}{\EUR{}}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage[square,sort,comma,numbers]{natbib}
\usepackage{booktabs}
\usepackage{multirow}
\bibliographystyle{alphadin}
\usepackage[notlof,notlot,nottoc,numbib]{tocbibind}
\pagestyle{myheadings}
\markright{author\hfill title\hfill}
\usepackage{pifont}
\usepackage[section]{placeins}
\usepackage{pdflscape}
\usepackage{hvfloat}
\usepackage{pdfpages}
\usepackage{listings}
\usepackage{color}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{myred} {rgb}{0.6,0,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\lstset{ %
  backgroundcolor=\color{white},   % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
  basicstyle=\footnotesize,        % the size of the fonts that are used for the code
  breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace
  breaklines=true,                 % sets automatic line breaking
  captionpos=b,                    % sets the caption-position to bottom
  commentstyle=\color{mygreen},    % comment style
  deletekeywords={...},            % if you want to delete keywords from the given language
  escapeinside={\%*}{*)},          % if you want to add LaTeX within your code
  % extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
  frame=single,                    % adds a frame around the code
  keepspaces=true,                 % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
  keywordstyle=\color{mymauve},       % keyword style
  language=Java,                 % the language of the code
  morekeywords={*,...},            % if you want to add more keywords to the set
  numbers=left,                    % where to put the line-numbers; possible values are (none, left, right)
  numbersep=5pt,                   % how far the line-numbers are from the code
  numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
  rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
  showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  showstringspaces=false,          % underline spaces within strings only
  showtabs=false,                  % show tabs within strings adding particular underscores
  stepnumber=2,                    % the step between two line-numbers. If it's 1, each line will be numbered
  stringstyle=\color{blue},     % string literal style
  tabsize=1,                       % sets default tabsize to 2 spaces
  caption=\lstname                   % show the filename of files included with \lstinputlisting; also try caption instead of title
}

% set colors for links and URLs and meta data
\usepackage[
    colorlinks=true,
    urlcolor=black,
    linkcolor=black,
    pdftitle={foo},
    pdfsubject={bar},
    pdfauthor={author},
    pdfkeywords={key}
]{hyperref}
\begin{document}
\newpage
\tableofcontents
\listoffigures
\listoftables
\lstlistoflistings

\newpage
\section{Testdokumentation}
\label{sec:testdokumentation}
\hvFloat[
    nonFloat=false,%
    capWidth=w,%
    capPos=b,%
    rotAngle=0,%
    objectPos=c%
    ]{figure}{%
        \setlength\fboxsep{0pt}
        \setlength\fboxrule{0.5pt}
        \fbox{\includegraphics[scale=0.9,trim=0 0 0 0, clip=false]{image.png}} % trim: from left, bottom, right, top
    }{imagecaption}{img:imagelabel}
\end{document}

顺便说一下,lof 文件是空的:\select@language {ngerman}

答案1

看来你必须如果希望图形出现在图形列表中,则可以使用可选的标题参数。

\documentclass[a4paper, 11pt]{scrartcl}
\usepackage{graphicx}
\usepackage{hvfloat}

\begin{document}

\listoffigures

\section{Testdokumentation}
\label{sec:testdokumentation}

\hvFloat[
    nonFloat=false,
    capWidth=w,
    capPos=b,
    rotAngle=0,
    objectPos=c,
    ]{figure}{%
        \setlength\fboxsep{0pt}%
        \setlength\fboxrule{0.5pt}%
        \fbox{\includegraphics[scale=0.3]{example-image.png}}%
    }[imagecaption]{imagecaption}{img:imagelabel}
\end{document}

我已删除了 MWE 的所有不必要软件包。请注意a4wide已弃用,应该绝不使用。

我还删除了一些不必要的内容%并添加了一些必需的内容。

在此处输入图片描述

相关内容