作者和隸屬關係僅出現在報告類的章節中

作者和隸屬關係僅出現在報告類的章節中

編輯我正在報告課上寫一篇論文,應該為每一章顯示單獨的作者。雖然作者出現,但他們沒有格式化為 authblk 格式。有誰知道我可能做錯了什麼?我的主要 tex 的程式碼是

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage[a4paper,width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm]{geometry}
\usepackage{fancyhdr} 
\pagestyle{fancy}
\usepackage{babel}
\usepackage[style=english]{csquotes}
\usepackage[style=authoryear]{biblatex} 
\addbibresource{library.bib}
\usepackage{fixltx2e} 
\usepackage{titlesec}
  \titleformat{\chapter}[hang]
    {\normalfont\huge\bfseries}
    {\thechapter}{20pt}{\huge}
\usepackage{authblk}
\title{Something clever}
\author{Name}
\date{}

\begin{document}
\maketitle

\chapter*{Abstract}

\chapter*{Dedication}

\chapter*{Declaration}

\chapter*{Acknowledgment}

\tableofcontents 

\chapter{Introduction}
\input{Chapters/introduction} 

\chapter{Title of Chapter}
\input{Chapters/chap2}

\chapter{Title of Chapter}
\input{Chapters/chap3}

\chapter{Title of Chapter}
\input{Chapters/chap4}

\printbibliography

\end{document}``` 

While in the chapters the code is:
\title{something clever}
\author[1]{Name1}
\author[2]{Name2}
\author[1]{Name3}
\author[1]{Name4}
\affil[1]{af1}
\affil[2]{af2}
\date{}                     
\begin{abstract} 
\end{abstract}


答案1

我認為問題在於該\maketitle命令只能在文件中使用一次。如果我沒記錯的話,在第一次使用後,它會重新定義自己不執行任何操作。也許您可以定義自己的版本\maketitle,例如\mymaketitle,它不會執行此操作(在我的系統上,程式碼report.cls位於 中/usr/local/texlive/2019/texmf-dist/tex/latex/base),只需挑選相關位元(您真的需要在章節標題後面加上標題嗎?)。

相關內容