### NJU Thesis Personal Information Setup (LaTeX) Source: https://context7.com/nju-lug/njuthesis/llms.txt Demonstrates how to configure personal and thesis-specific information using the \njusetup command with the 'info' option. Covers details like title, author, keywords, department, supervisor, and submission dates. Includes examples for undergraduate and graduate students, and for the National Library cover. ```latex % 本科生个人信息设置示例 \njusetup[info]{ % 论文标题(使用 \ 手动换行) title = {基于深度学习的图像识别研究\\——以卷积神经网络为例}, title* = {Research on Image Recognition Based on Deep Learning}, % 关键词(使用半角逗号分隔) keywords = {深度学习, 卷积神经网络, 图像识别, 迁移学习}, keywords* = {Deep Learning, CNN, Image Recognition, Transfer Learning}, % 作者信息 author = {张三}, author* = {Zhang San}, grade = {2020}, student-id = {201012345}, % 院系专业 department = {计算机科学与技术系}, department* = {Department of Computer Science and Technology}, major = {计算机科学与技术}, major* = {Computer Science and Technology}, % 导师信息(姓名与职称用逗号分隔) supervisor = {李四,教授}, supervisor* = {Professor Li Si}, % 第二导师(可选) % supervisor-ii = {王五,副教授}, % supervisor-ii* = {Associate Professor Wang Wu}, % 提交日期(格式:yyyy-mm-dd,留空则使用编译当天日期) submit-date = {2024-05-20} } % 研究生额外信息 \njusetup[info]{ field = {人工智能}, % 研究领域 field* = {Artificial Intelligence}, defend-date = {2024-05-25}, % 答辩日期 chairman = {赵六~教授}, % 答辩委员会主席 reviewer = {钱七~教授, 孙八~副教授}, % 答辩评委 clc = {TP391.4}, % 中国图书分类号 udc = {004.8}, % 国际图书分类号 secret-level = {公开}, % 密级 email = {zhangsan@smail.nju.edu.cn} % 电子邮箱 } % 国家图书馆封面额外信息(研究生) \njusetup[info]{ confer-date = {2024-06-20}, % 学位授予日期 bottom-date = {2024-06-25}, % 封面底部日期 supervisor-contact = {南京大学计算机科学与技术系 江苏省南京市栖霞区仙林大道163号} } ``` -------------------------------- ### Minimal NJUThesis Document Example (LaTeX) Source: https://github.com/nju-lug/njuthesis/blob/master/README-CTAN.md This code snippet demonstrates a minimal LaTeX document structure using the njuthesis class. It includes basic setup, document content, and bibliography printing. Requires XeLaTeX or LuaLaTeX for compilation. ```LaTeX \documentclass{njuthesis} \njusetup{} \begin{document} \maketitle \tableofcontents \mainmatter \chapter{Welcome} Hello \LaTeX{}! \printbibliography \end{document} ``` -------------------------------- ### Create Notation Tables with \begin{notation} Source: https://context7.com/nju-lug/njuthesis/llms.txt Creates a notation table within the thesis to list and explain professional terms and symbols used. It supports optional arguments for specifying the width of the description area and provides examples for both standard and non-displayed notation tables. ```latex % 符号表环境(可选参数为说明区域宽度) \begin{notation}[10cm] \item[DFT] 密度泛函理论 (Density Functional Theory) \item[DMRG] 密度矩阵重正化群 (Density-Matrix Renormalization Group) \item[CNN] 卷积神经网络 (Convolutional Neural Network) \item[RNN] 循环神经网络 (Recurrent Neural Network) \item[$k_B$] 玻尔兹曼常数 \item[$\hbar$] 约化普朗克常数 \item[$c$] 真空中的光速 \item[$\\mu$] 约化质量 \end{notation} % 不显示在目录中的符号表(使用星号版本) \begin{notation*}[8cm] \item[API] 应用程序接口 \item[SDK] 软件开发工具包 \end{notation*} ``` -------------------------------- ### Configure Image Paths and Titles with \njusetup[image] Source: https://context7.com/nju-lug/njuthesis/llms.txt Configures image search paths, specifies paths for university emblem and name images, and sets the style for figure and table captions. Includes examples for inserting images and tables, and cross-referencing them. ```latex % 图片设置 \njusetup[image]{ path = {{./figures/}, {./images/}}, % 图片搜索路径 nju-emblem = {nju-emblem}, % 校徽图片路径 nju-name = {nju-name}, % 校名图片路径 % nju-emblem = {nju-emblem-purple}, % 紫色版本校徽 % nju-name = {nju-name-purple}, % 紫色版本校名 } % 插入图片示例 \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{network-architecture} \caption{卷积神经网络结构示意图} \label{fig:cnn} \end{figure} % 插入表格示例 \begin{table}[htbp] \centering \caption{实验结果对比} \label{tab:results} \begin{tabular}{lccc} \toprule 方法 & 准确率 & 召回率 & F1值 \\ \midrule 基线方法 & 85.2\% & 82.1\% & 83.6\% \\ 本文方法 & \textbf{95.6\%} & \textbf{93.2\%} & \textbf{94.4\%} \bottomrule \end{tabular} \end{table} % 交叉引用 如图 \ref{fig:cnn} 所示,网络由三个卷积层组成... 表 \ref{tab:results} 展示了实验结果对比... ``` -------------------------------- ### Minimal TeX Live Package Installation Source: https://github.com/nju-lug/njuthesis/wiki/安装 Installs the essential LaTeX packages required for the NJUThesis template via tlmgr. This approach is intended for users performing a minimal installation to save disk space. ```bash tlmgr update --self tlmgr install algorithms alphalph auxhook background biber biblatex biblatex-gb7714-2015 bibtex blindtext booktabs caption chemfig cleveref cm-unicode colortbl csquotes ctex dashundergaps diagbox emptypage enumitem everypage fancyhdr fancyvrb fandol float footmisc gbt7714 hologo hycolor hypdoc hyperref l3build latexmk libertinus-fonts listings lua-ul lualatex-math luatex85 makecell makeindex mathtools mhchem microtype multirow natbib newcomputermodern ninecolors njuvisual ntheorem pict2e physics preview psnfss setspace simplekv siunitx standalone symbol tabularray tex-gyre tex-gyre-math threeparttable translator underscore unicode-math url wrapfig xits xstring zhlipsum zref ``` -------------------------------- ### Basic NJU Thesis Document Structure in LaTeX Source: https://github.com/nju-lug/njuthesis/blob/master/README.md This snippet demonstrates the fundamental structure of a document using the NJUThesis LaTeX class. It includes setting up the document class, configuring thesis options, and the basic document environment with essential commands like \maketitle, \tableofcontents, \mainmatter, chapter creation, and bibliography printing. This serves as a starting point for creating a thesis document. ```LaTeX \documentclass{njuthesis} \njusetup{} \begin{document} \maketitle \tableofcontents \mainmatter \chapter{欢迎} 使用 \LaTeX{}! \printbibliography \end{document} ``` -------------------------------- ### Install Microsoft Core Fonts on Ubuntu Source: https://github.com/nju-lug/njuthesis/wiki/字体配置 Installs the ttf-mscorefonts-installer package to provide standard fonts like Times New Roman. This is required for LaTeX templates that rely on these specific font families. ```bash sudo apt install ttf-mscorefonts-installer ``` -------------------------------- ### Configure Footnote Styles with \njusetup[footnote] Source: https://context7.com/nju-lug/njuthesis/llms.txt Configures footnote numbering styles and indentation methods. It supports various styles like 'plain', 'pifont', 'circled', and 'circled*', and demonstrates how to use them with examples. ```latex % 脚注样式设置 \njusetup[footnote]{ style = plain, % 编号样式:plain|pifont|circled|circled* hang = true, % 是否悬挂缩进(默认 true) } % 使用带圈数字编号 \njusetup[footnote]{ style = circled, % circled(白底黑字)或 circled*(黑底白字) circledtext-option = { resize = none, % 大小调整 boxcolor = black % 圆圈颜色 } } % 使用 pifont 圈码(单页不超过10条脚注) \njusetup[footnote]{ style = pifont } % 脚注使用示例 这是一段正文内容\footnote{这是第一条脚注说明。} , 继续正文\footnote{这是第二条脚注,可以包含较长的解释性内容}。 ``` -------------------------------- ### Configure Math Symbol Styles with \njusetup[math] Source: https://context7.com/nju-lug/njuthesis/llms.txt Sets the style for mathematical symbols, defaulting to GB/T 3102-93. Allows switching to ISO or traditional TeX styles, and customizes individual symbol appearances like integrals, limits, and vectors. It also shows examples of using these settings in equations. ```latex % 数学符号整体风格设置 \njusetup[math]{ style = GB, % 整体风格:TeX|ISO|GB(默认为国标) } % 或逐项自定义设置 \njusetup[math]{ integral = upright, % 积分号正体/斜体:upright|slanted integral-limits = false, % 积分号上下限位置:true(上下)|false(右侧) less-than-or-equal = slanted, % 小于等于号样式:slanted(≤)|horizontal(≦) math-ellipsis = centered, % 省略号位置:centered(居中)|lower(底部) partial = upright, % 偏微分符号:upright|italic real-part = roman, % 实部虚部:roman|fraktur vector = boldfont, % 向量表示:boldfont(粗体)|arrow(箭头) uppercase-greek = italic % 大写希腊字母:upright|italic } % 数学公式示例 \begin{equation} \int_0^\infty \symup{e}^{-x^2} \mathrm{d}x = \frac{\sqrt{\uppi}}{2} \end{equation} % 向量和矩阵(使用粗体) \begin{equation} \symbf{F} = m\symbf{a}, \quad \symbf{A}\symbf{x} = \symbf{b} \end{equation} % 常数使用正体 \begin{equation} E = mc^2, \quad z = x + \symup{i}y, \quad f(x) = \symup{e}^{x} \end{equation} ``` -------------------------------- ### NJU Thesis Bibliography Setup (LaTeX) Source: https://context7.com/nju-lug/njuthesis/llms.txt Configures bibliography settings using biblatex within the NJU Thesis template. It allows selection of citation style (numeric or author-year), specification of bib resource files, and customization of displayed biblatex options like DOI, ISBN, and URL. Includes examples of citation commands. ```latex % 参考文献设置 \njusetup[bib]{ % 参考文献样式 style = numeric, % numeric(顺序编码制,默认)或 author-year(著者-出版年制) % 参考文献数据源(支持多个文件,用逗号分隔) resource = {references.bib, additional.bib}, % 额外的 biblatex 选项 option = { doi = false, % 不显示 DOI isbn = false, % 不显示 ISBN url = false, % 不显示 URL eprint = false, % 不显示 eprint % refsection = chapter, % 将参考文献表置于每章后 } } % 在正文中引用文献 % 引用格式会根据 style 设置自动调整 \cite{einstein1905} % 普通引用 \parencite{turing1950} % 带括号引用 \textcite{knuth1984} % 作者名在正文中 % 生成参考文献列表 \printbibliography ``` -------------------------------- ### Compiling NJU Thesis Documents Source: https://context7.com/nju-lug/njuthesis/llms.txt Instructions for compiling the thesis using XeLaTeX or LuaLaTeX. It includes automated workflows using latexmk and manual compilation sequences, as well as commands for cleaning temporary files and installing necessary packages. ```bash # 方法一:使用 latexmk 自动编译(推荐) latexmk -xelatex mythesis.tex # 方法二:手动四步编译(XeLaTeX) xelatex mythesis biber mythesis xelatex mythesis xelatex mythesis # 方法三:使用 LuaLaTeX latexmk -lualatex mythesis.tex # 或手动编译 lualatex mythesis biber mythesis lualatex mythesis lualatex mythesis # 清理临时文件 latexmk -c # 安装模板(通过包管理器) tlmgr install njuthesis njuvisual ``` -------------------------------- ### Configure Theorem Environments with \njusetup[theorem] Source: https://context7.com/nju-lug/njuthesis/llms.txt Customizes and creates mathematical theorem-like environments such as theorems, lemmas, definitions, and proofs. It supports custom styles and numbering schemes, and demonstrates how to define new theorem types and use the predefined ones. ```latex % 定理环境样式设置 \njusetup[theorem]{ style = plain, % 基本样式:plain|break|margin|empty header-font = \normalfont\bfseries, % 头部字体格式 body-font = \itshape, % 内容字体格式 qed-symbol = \ensuremath{\square}, % 证毕符号 counter = chapter, % 计数器范围:chapter|section share-counter = false, % 是否共享计数器 define, % 创建预置的定理环境 } % 预置环境包括:theorem(定理)、lemma(引理)、corollary(推论) % definition(定义)、axiom(公理)、example(例)、proof(证明) % 自定义定理类型 \njusetup[theorem]{ type = { {proposition,*}{命题}, % 带编号的命题环境 {remark}{注记}, % 不带编号的注记环境 {solution,+}{解} % 带证毕符号的解答环境 }, define, % 必须调用 define 才会创建环境 } % 使用定理环境 \begin{theorem}[费马大定理] 当整数 $n > 2$ 时,关于 $x$、$y$、$z$ 的方程 $x^n + y^n = z^n$ 没有正整数解。 \end{theorem} \begin{proof} 此处省略证明过程... \end{proof} \begin{definition} 设 $V$ 是数域 $\mathbb{F}$ 上的线性空间,若映射 $T: V \to V$ 满足... \end{definition} \begin{lemma}\label{lem:key} 对于任意 $\epsilon > 0$,存在 $\delta > 0$... \end{lemma} \begin{corollary} 由引理 \ref{lem:key} 可得... \end{corollary} ``` -------------------------------- ### Add Bibliography Data Sources Source: https://github.com/nju-lug/njuthesis/wiki/参考文献 Demonstrates how to add .bib files as data sources using either the native biblatex command or the template-specific njusetup configuration. ```TeX \addbibresource{source1.bib} \addbibresource{source2.bib} \njusetup { bib = { resource = {source1.bib, source2.bib} } } ``` -------------------------------- ### Implement Chapter-Specific Bibliographies Source: https://github.com/nju-lug/njuthesis/wiki/参考文献 Shows how to use the refsection environment or template settings to print bibliographies at the end of each chapter. ```TeX \begin{refsection} 文字内容 \printbibliography[heading=subbibintoc] \end{refsection} \njusetup { bib = { resection = chapter } } ``` -------------------------------- ### Customize Headers and Footers with \njusetup[header] Source: https://context7.com/nju-lug/njuthesis/llms.txt Allows customization of header and footer content and formatting to meet specific departmental requirements. It covers settings for double-sided and single-sided modes, and how to format the text within headers and footers. ```latex % 页眉内容设置(双面模式) \njusetup[header/content]{ {OR}{\thepage}, % 奇数页右侧:页码 {OL}{\rightmark}, % 奇数页左侧:节名 {EL}{\thepage}, % 偶数页左侧:页码 {ER}{\leftmark} % 偶数页右侧:章名 } % 页脚内容设置 \njusetup[footer/content]{ {C}{\thepage} % 居中显示页码 } % 单面模式页眉设置 \njusetup[header/content*]{ {L}{\leftmark}, % 左侧:章名 {R}{\thepage} % 右侧:页码 } % 设置页眉页脚字体格式 \njusetformat{header}{\small\kaishu} % 页眉使用小号楷体 \njusetformat{footer}{\small} % 页脚使用小号字体 % 清空页脚 \njusetup[footer/content]{} ``` -------------------------------- ### Manual Compilation Sequence Source: https://github.com/nju-lug/njuthesis/wiki/编辑器与编译 The required sequence of commands when compiling manually without latexmk to ensure correct generation of page numbers, table of contents, and bibliography. ```shell xelatex njuthesis-sample.tex biber njuthesis-sample xelatex njuthesis-sample.tex xelatex njuthesis-sample.tex ``` -------------------------------- ### Compile NJUThesis Locally Source: https://github.com/nju-lug/njuthesis/wiki/编辑器与编译 The standard command to compile the thesis template locally using latexmk with the XeLaTeX engine. This ensures all dependencies and cross-references are processed correctly. ```shell latexmk -xelatex ``` -------------------------------- ### NJU Thesis Abstract and TOC Settings (LaTeX) Source: https://context7.com/nju-lug/njuthesis/llms.txt Customizes the appearance of the abstract pages and table of contents (TOC) using the \njusetup command. Options include controlling TOC entries for abstracts, figures, and tables, and styling abstract titles. Demonstrates usage of the abstract environment. ```latex % 摘要设置 \njusetup[abstract]{ toc-entry = false, % 摘要是否显示在目录中(默认 false) underline = true, % 研究生英文摘要条目内容是否添加下划线 title-style = centered, % 研究生摘要标题样式:strict|centered|natural } % 目录设置 \njusetup{ tableofcontents/toc-entry = true, % 目录自身是否在目录中显示 listoffigures/toc-entry = false, % 插图清单是否在目录中显示 listoftables/toc-entry = false % 表格清单是否在目录中显示 } % 为目录中的章标题添加引导线 \njusetup[tableofcontents/dotline]{chapter} % 摘要环境使用示例 \begin{abstract} 本文研究了基于深度学习的图像识别技术,提出了一种改进的卷积神经网络结构... 实验结果表明,所提方法在标准数据集上取得了 95.6% 的准确率... \end{abstract} \begin{abstract*} This paper investigates image recognition technology based on deep learning and proposes an improved convolutional neural network architecture... Experimental results demonstrate that the proposed method achieves 95.6% accuracy on standard benchmarks... \end{abstract*} ``` -------------------------------- ### Customize Page Headers with fancyhdr Source: https://github.com/nju-lug/njuthesis/wiki/页面布局 Demonstrates how to clear existing headers and set a custom centered header using the fancyhdr package. This approach is compatible with the njuthesis document class. ```TeX \documentclass[degree=mg]{njuthesis} \usepackage{zhlipsum} \begin{document} \mainmatter \fancyhead{} % 清空已有页眉 \fancyhead[C]{\small\kaishu 哈哈} \chapter{占位} \zhlipsum[1-10] \end{document} ``` -------------------------------- ### Configure Bibliography Style Source: https://github.com/nju-lug/njuthesis/wiki/参考文献 Sets the bibliography style to author-year format using the njusetup command. This configuration supports standard biblatex style names. ```TeX \njusetup { bib = { style = author-year } } ``` -------------------------------- ### Override Plain Style for Chapter Pages Source: https://github.com/nju-lug/njuthesis/wiki/页面布局 Explains how to remove the default plain style applied to chapter pages by redefining the plain page style after calling mainmatter. ```TeX \fancypagestyle{plain}{} ``` -------------------------------- ### Basic NJU Thesis Document Structure (LaTeX) Source: https://context7.com/nju-lug/njuthesis/llms.txt Defines the fundamental structure of a Nanjing University thesis document using the njuthesis class. It includes essential sections like cover page, abstract, table of contents, main content, bibliography, and acknowledgements. Requires XeLaTeX or LuaLaTeX for compilation. ```latex %!TEX program = xelatex or lualatex \documentclass[ type = bachelor, % 文档类型:bachelor|master|doctor|postdoc degree = academic, % 学位类型:academic|professional % decl-page, % 生成诚信承诺书/原创性声明 % nl-cover, % 使用国家图书馆封面(仅研究生) % oneside, % 单面模式(默认为双面) % draft, % 草稿模式,加快编译速度 % anonymous, % 盲审模式,隐藏个人信息 ]{njuthesis} % 载入个人信息设置文件 \input{njuthesis-setup.def} % 可选:载入额外宏包 % \usepackage{subcaption} % 子图支持 % \usepackage{siunitx} % 标准单位符号 % \usepackage{listings} % 代码展示 \begin{document} % 生成封面页 \maketitle % 中文摘要 \begin{abstract} 这里是中文摘要内容... \end{abstract} % 英文摘要 \begin{abstract*} This is the English abstract... \end{abstract*} % 生成目录 \tableofcontents % \listoffigures % 可选:插图清单 % \listoftables % 可选:表格清单 % 正文开始 \mainmatter \chapter{引言} \section{研究背景} 正文内容... % 生成参考文献 \printbibliography % 致谢 \begin{acknowledgement} 感谢所有帮助过我的人... \end{acknowledgement} % 附录(可选) \appendix \chapter{补充材料} 附录内容... \end{document} ``` -------------------------------- ### Customizing NJU Thesis Document Elements Source: https://context7.com/nju-lug/njuthesis/llms.txt Use these commands to modify fixed text labels, document lengths, and formatting styles within the NJU Thesis template. These commands allow for granular control over chapter headings, table fonts, and cover layout instances. ```latex % 修改固定文本名称 \njusetname{type}{本科毕业设计} % 修改文档类型名称 \njusetname{notation}{术语表} % 修改符号表标题 \njusetname{tableofcontents}{目\qquad{}次} % 修改目录标题 \njusetname{listoffigures}{插图清单} % 修改图片清单标题 \njusetname{listoftables}{表格清单} % 修改表格清单标题 % 修改摘要标题(带语言参数) \njusetname{abstract}[b]{摘\qquad{}要} % 修改中文摘要标题 \njusetname*{abstract}[b]{ABSTRACT} % 修改英文摘要标题 % 修改长度值 \njusetlength{crulewd}{330pt} % 封面页下划线宽度 % 修改格式样式 \njusetformat{chapter}{\raggedleft\kaishu\zihao{-1}} % 章标题右对齐楷体 \njusetformat{section}{\bfseries\zihao{4}} % 节标题四号加粗 \njusetformat{subsection}{\normalfont\bfseries} % 小节标题 \njusetformat{tabular}{\zihao{-4}} % 表格内容字号 % 修改封面布局(使用 xtemplate) \EditInstance{nju}{u/cover/emblem-img}{align=l} % 本科生封面校徽左对齐 ``` -------------------------------- ### Hide Bibliography Metadata Source: https://github.com/nju-lug/njuthesis/wiki/参考文献 Configures the bibliography options to exclude specific metadata fields such as DOI, ISBN, URL, and eprint from the rendered document. ```TeX \njusetup { bib = { option = { doi = false, isbn = false, url = false, eprint = false } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.