newfloat 环境的目录自定义名称

newfloat 环境的目录自定义名称

大家下午好。

我经常使用“newfloat”包,但我无法更改某个特定的东西。这些天我搜索了很多,但找不到任何相关的东西。我遇到了以下问题,即更改目录中显示的新浮动环境的名称。我想将“FIGURA”名称更改为我想要的任何名称,例如,在此示例中为“ILUSTRAÇÃO”。有什么想法吗?

谢谢!

\documentclass[a4paper, 12pt]{article}

\usepackage
[showframe, lmargin=3cm,tmargin=3cm,rmargin=2cm,bmargin=2cm]
{geometry} 
\usepackage[brazil]{babel}
\usepackage{polyglossia}
\setmainlanguage{brazil}
\usepackage{caption}
\usepackage{enumitem}
\usepackage{float}
\usepackage{setspace}
\usepackage[titletoc]{appendix}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{ragged2e}
\usepackage{booktabs}
\usepackage{fancyhdr}
\usepackage{scrextend}
\usepackage{array} 
\usepackage{afterpage}

\usepackage{tocloft}
\renewcommand{\cftfigpresnum}{\bfseries FIGURA } % put Figure before the number
\renewcommand{\cftfigaftersnum}{\textbf{:} }     % add colon after the number
\addtolength{\cftfignumwidth}{1,5cm}  

\renewcommand{\cfttabpresnum}{\bfseries TABELA } % put Figure before the number
\renewcommand{\cfttabaftersnum}{\textbf{:} }     % add colon after the number
\addtolength{\cfttabnumwidth}{1,5cm}  


\usepackage{setspace}
            \newcommand\myemptypage{
                \null
                \thispagestyle{empty}
                \addtocounter{page}{-1}
                \newpage
            }
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{fontspec}
\usepackage{tocbasic}
\usepackage{titlesec}
\usepackage{indentfirst}
% Indentação na primeira linha dos parágrafos
 \setlength{\parindent}{1.5cm}
% Fazer isso também nos parágrafos que iniciam capítulos
\usepackage{indentfirst}
\onehalfspacing
 \setmainfont{Arial}
\usepackage{lipsum}
\usepackage{import}
\pagestyle{fancy}
\fancyhead[R]{\thepage}
\fancyhead[L]{}
\fancyfoot[C]{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{14.49998pt}
\setlength{\headheight}{15.07855pt}

\titleformat*{\section}{\normalsize\bfseries}
\titleformat*{\subsection}{\normalsize}
\titleformat*{\subsubsection}{\normalsize}

\usepackage{hyperref}
\hypersetup{colorlinks = ,
linkcolor = ,
anchorcolor =,
citecolor = ,
filecolor = ,
urlcolor = ,
pdfauthor=}

\usepackage[nottoc]{tocbibind}
\usepackage[
alf,abnt-full-initials=no,   % Colocar nome completo;
abnt-etal-list=0,            % Listar todos os autores;
abnt-etal-cite=3,            % Mais de 2 nomes não são citados;
abnt-emphasize=bf,           % Ênfase nas revisas com negrito;
abnt-etal-text = it,         % "et al" em itálico. 
]{abntex2cite}

\DeclareFloatingEnvironment[
listname= \hspace*{\fill}\bfseries\normalsize LISTA DE ILUSTRAÇÕES\hspace*{\fill} ,
name= \bfseries {ILUSTRAÇÃO}
]{ilus}


\begin{document}

\listofilus

\begin{ilus}[htbp!]
\centering
\caption{A tree draw example.}
\includegraphics[scale=1]{treedraw.jpg}
\end{ilus}

\begin{ilus}[htbp!]
\centering
\caption{A apple draw example.}
\includegraphics[scale=1]{appledraw.png}
\end{ilus}

\end{document}

在此处输入图片描述

答案1

手册第 5 页的顶部newfloat有答案。

这是您的文档的新版本,序言中有一些更改,我将包加载与设置分开。

一些包被注释掉了:babelpolyglossia不要跟着去,tocloft和 也是一样tocbasic

寻找其他差异。关键是

% newfloat
\DeclareFloatingEnvironment[
  listname=\hspace*{\fill}\bfseries\normalsize LISTA DE ILUSTRAÇÕES\hspace*{\fill},
  name=ILUSTRAÇÃO,
]{ilus}
\captionsetup[ilus]{labelfont=bf}
\PrepareListOf{ilus}{%
  \renewcommand{\cftfigpresnum}{ILUSTRAÇÃO }%
  \addtolength{\cftfignumwidth}{1.5cm}%
}

完整代码。

\documentclass[a4paper, 12pt]{article}

\usepackage[
  showframe,
  lmargin=3cm,
  tmargin=3cm,
  rmargin=2cm,
  bmargin=2cm,
  headheight=15.1pt,
  heightrounded,
]{geometry} 
%\usepackage[brazil]{babel} % either babel or polyglossia
\usepackage{polyglossia}
\usepackage{caption}
\usepackage{enumitem}
\usepackage{float}
\usepackage{setspace}
\usepackage[titletoc]{appendix}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{booktabs}
\usepackage{fancyhdr}
\usepackage{scrextend}
\usepackage{array} 
\usepackage{afterpage}
\usepackage[titles]{tocloft}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{fontspec}
\usepackage{newfloat}
%\usepackage{tocbasic} % either tocbasic or tocloft
\usepackage{titlesec}
% Fazer isso também nos parágrafos que iniciam capítulos
\usepackage{indentfirst}
\usepackage{lipsum}
\usepackage{import}

\usepackage[nottoc]{tocbibind}
\usepackage[
alf,abnt-full-initials=no,   % Colocar nome completo;
abnt-etal-list=0,            % Listar todos os autores;
abnt-etal-cite=3,            % Mais de 2 nomes não são citados;
abnt-emphasize=bf,           % Ênfase nas revisas com negrito;
abnt-etal-text = it,         % "et al" em itálico. 
]{abntex2cite}

\usepackage{hyperref}

% tocloft
\renewcommand{\cftfigpresnum}{\bfseries FIGURA } % put Figure before the number
\renewcommand{\cftfigaftersnum}{\textbf{:} }     % add colon after the number
\addtolength{\cftfignumwidth}{1,5cm}  

\renewcommand{\cfttabpresnum}{\bfseries TABELA } % put Figure before the number
\renewcommand{\cfttabaftersnum}{\textbf{:} }     % add colon after the number
\addtolength{\cfttabnumwidth}{1,5cm}  

% fontspec
\setmainfont{Arial}

% polyglossia
\setmainlanguage{brazil}

% newfloat
\DeclareFloatingEnvironment[
  listname=\hspace*{\fill}\bfseries\normalsize LISTA DE ILUSTRAÇÕES\hspace*{\fill},
  name=ILUSTRAÇÃO,
]{ilus}
\captionsetup[ilus]{labelfont=bf}
\PrepareListOf{ilus}{%
  \renewcommand{\cftfigpresnum}{ILUSTRAÇÃO }%
  \addtolength{\cftfignumwidth}{1.5cm}%
}

% titlesec
\titleformat*{\section}{\normalsize\bfseries}
\titleformat*{\subsection}{\normalsize}
\titleformat*{\subsubsection}{\normalsize}

% hyperref
\hypersetup{
%  colorlinks,
%  linkcolor = ,
%  anchorcolor =,
%  citecolor = ,
%  filecolor = ,
%  urlcolor = ,
%  pdfauthor=
}

% fancyhdr
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{0pt}

% final settings
% Indentação na primeira linha dos parágrafos
\setlength{\parindent}{1.5cm}

\onehalfspacing

\begin{document}

\listofilus

\begin{ilus}[htbp!]
\centering
\caption{A tree draw example.}
\includegraphics[width=0.3\textwidth]{example-image}
\end{ilus}

\begin{ilus}[htbp!]
\centering
\caption{A apple draw example.}
\includegraphics[width=0.3\textwidth]{example-image}
\end{ilus}

\end{document}

在此处输入图片描述

一些包被加载了两次。也hyperref应该放在最后。还请注意,最好使用toclofttitles选项进行加载。

我不确定其中的明确格式listname:您应该为未编号的部分定义一种样式。

相关内容