Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NJUThesis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NJU LUG
NJU LaTeX Templates
NJUThesis
Commits
d565f0fe
Commit
d565f0fe
authored
3 years ago
by
Yu Xiong
Browse files
Options
Downloads
Patches
Plain Diff
feature: 改用cleverref进行图片等内容的引用
parent
fd887a5b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
njuthesis.tex
+36
-6
36 additions, 6 deletions
njuthesis.tex
profile/packages.sty
+4
-1
4 additions, 1 deletion
profile/packages.sty
profile/reference.sty
+7
-90
7 additions, 90 deletions
profile/reference.sty
with
47 additions
and
97 deletions
njuthesis.tex
+
36
−
6
View file @
d565f0fe
...
...
@@ -33,7 +33,7 @@
\section
{
表格示例
}
\begin{table}
[htbp]
\caption
{
经过测试的环境
}
\labtab
{
mytab
}
\lab
el
{
tab
:
mytab
}
\begin{tabular}
{
ccc
}
\toprule
OS
&
Tex
&
测试情况
\\
...
...
@@ -46,7 +46,7 @@
\bottomrule
\end{tabular}
\end{table}
你可以使用
\lstinline
|table|环境插入标准三线表,如
\reftab
{
mytab
}
所示,代码如下:
你可以使用
\lstinline
|table|环境插入标准三线表,如
\
c
ref
{
tab
:
mytab
}
所示,代码如下:
\begin{lstlisting}
[language=TeX]
\begin{table}
[htbp]
\caption
{
经过测试的环境
}
...
...
@@ -68,9 +68,9 @@
\begin{figure}
[htbp]
\includegraphics
[width=0.5\textwidth]
{
njuname
}
\caption
{
南京大学名称
}
\labfig
{
njuname
}
\lab
el
{
fig
:
njuname
}
\end{figure}
你可以使用
\lstinline
|figure|环境插入图片,如
\reffig
{
njuname
}
,代码如下:
你可以使用
\lstinline
|figure|环境插入图片,如
\
c
ref
{
fig
:
njuname
}
,代码如下:
\begin{lstlisting}
[language=TeX]
\begin{figure}
\includegraphics
[width=0.5\textwidth]
{
njuname
}
...
...
@@ -87,10 +87,40 @@
\end{wrapfigure}
\zhlipsum
[3][name=xiangyu]
\section
{
公式示例
}
\begin{equation}
\label
{
eq:dewitt
}
\int
e
^{
ax
}
\tanh
bx
\
dx =
\begin{cases}
\displaystyle
{
\frac
{
e
^{
(a+2b)x
}}{
(a+2b)
}
{_
2F
_
1
}
\left
[ 1+\frac{a}{2b},1,2+\frac{a}{2b}, -e^{2bx}\right]
}&
\\
\displaystyle
{
\hspace
{
1cm
}
-
\frac
{
1
}{
a
}
e
^{
ax
}{_
2F
_
1
}
\left
[ 1, \frac{a}{2b},1+\frac{a}{2b}, -e^{2bx}\right]
}
&
a
\ne
b
\\
\displaystyle
{
\frac
{
e
^{
ax
}
-2
\tan
^{
-1
}
[e
^{
ax
}
]
}{
a
}
}
&
a = b
\end{cases}
\end{equation}
你可以使用
\lstinline
|equation|环境插入公式,如
\cref
{
eq:dewitt
}
,代码如下:
\begin{lstlisting}
[language=TeX]
\begin{equation}
\label
{
eq:dewitt
}
\int
e
^{
ax
}
\tanh
bx
\
dx =
\begin{cases}
\displaystyle
{
\frac
{
e
^{
(a+2b)x
}}{
(a+2b)
}
{_
2F
_
1
}
\left
[ 1+\frac{a}{2b},1,2+\frac{a}{2b}, -e^{2bx}\right]
}&
\\
\displaystyle
{
\hspace
{
1cm
}
-
\frac
{
1
}{
a
}
e
^{
ax
}{_
2F
_
1
}
\left
[ 1, \frac{a}{2b},1+\frac{a}{2b}, -e^{2bx}\right]
}
&
a
\ne
b
\\
\displaystyle
{
\frac
{
e
^{
ax
}
-2
\tan
^{
-1
}
[e
^{
ax
}
]
}{
a
}
}
&
a = b
\end{cases}
\end{equation}
\end{lstlisting}
\backmatter
\chapter*
{
致谢
}
感谢
\href
{
https://git.nju.edu.cn/nju-lug/lug-introduction
}{
NJU LUG
}
。
%
\chapter*{致谢}
%
感谢\href{https://git.nju.edu.cn/nju-lug/lug-introduction}{NJU LUG}。
\printbibliography
[heading=bibintoc, title=参考文献]
% 方括号内的命令可以将参考文献列表加入目录
% \printindex
...
...
This diff is collapsed.
Click to expand it.
profile/packages.sty
+
4
−
1
View file @
d565f0fe
...
...
@@ -43,4 +43,7 @@
\graphicspath
{{
figure/
}}
\RequirePackage
{
wrapfig
}
% Wrap text around figures
\RequirePackage
[hidelinks,bookmarksnumbered=true]
{
hyperref
}
\ No newline at end of file
% 必须以该顺序加载以下三个包
\RequirePackage
{
varioref
}
\RequirePackage
[hidelinks,bookmarksnumbered=true]
{
hyperref
}
\RequirePackage
[capitalise,nameinlink,noabbrev]
{
cleveref
}
This diff is collapsed.
Click to expand it.
profile/reference.sty
+
7
−
90
View file @
d565f0fe
...
...
@@ -36,93 +36,10 @@
% \ifentrytype{book}{\clearfield{doi}}{}
}
% From https://github.com/fmarotta/kaobook/blob/master/kaorefs.sty
% Labelling commands
\newcommand
{
\labpage
}
[1]
{
\label
{
page:#1
}}
\newcommand
{
\labpart
}
[1]
{
\label
{
part:#1
}}
\newcommand
{
\labch
}
[1]
{
\label
{
ch:#1
}}
\newcommand
{
\labsec
}
[1]
{
\label
{
sec:#1
}}
\newcommand
{
\labsubsec
}
[1]
{
\label
{
subsec:#1
}}
\newcommand
{
\labfig
}
[1]
{
\label
{
fig:#1
}}
\newcommand
{
\labtab
}
[1]
{
\label
{
tab:#1
}}
\newcommand
{
\labeq
}
[1]
{
\label
{
eq:#1
}}
\newcommand
{
\labdef
}
[1]
{
\label
{
def:#1
}}
\newcommand
{
\labthm
}
[1]
{
\label
{
thm:#1
}}
\newcommand
{
\labassum
}
[1]
{
\label
{
assum:#1
}}
\newcommand
{
\labprop
}
[1]
{
\label
{
prop:#1
}}
\newcommand
{
\lablemma
}
[1]
{
\label
{
lemma:#1
}}
\newcommand
{
\labremark
}
[1]
{
\label
{
remark:#1
}}
\newcommand
{
\labexample
}
[1]
{
\label
{
example:#1
}}
\newcommand
{
\labexercise
}
[1]
{
\label
{
exercise:#1
}}
% Referencing commands
\newcommand
{
\refpage
}
[1]
{
\hyperref
[#1]
{
\pagename
}
\xspace\pageref
{
page:#1
}}
% Page 84
\newcommand
{
\vrefpage
}
[1]
{
\vpageref*
{
page:#1
}}
% on the following page, on page 84
% For unnumbered parts
\newcommand
{
\arefpart
}
[1]
{
\hyperref
[part:#1]
{
\partname
}
\xspace
`
\nameref
{
part:#1
}
'
}
% Part `Name of the Part'
\newcommand
{
\avrefpart
}
[1]
{
\hyperref
[part:#1]
{
\partname
}
\xspace
`
\nameref
{
part:#1
}
'
\vpageref
{
part:#1
}}
% Part `Name of the Part' on page 84
% For numbered parts
\newcommand
{
\refpart
}
[1]
{
\hyperref
[part:#1]
{
\partname
}
\xspace\ref
{
part:#1
}}
% Part IV
\newcommand
{
\vrefpart
}
[1]
{
\hyperref
[part:#1]
{
\partname
}
\xspace\vref
{
part:#1
}}
% Part IV, Part IV on the following page, Part IV on page 84
\newcommand
{
\nrefpart
}
[1]
{
\hyperref
[part:#1]
{
\partname
}
\xspace\ref
{
part:#1
}
(
\nameref
{
part:#1
}
)
}
\newcommand
{
\frefpart
}
[1]
{
\hyperref
[part:#1]
{
\partname\xspace\ref
{
part:#1
}
(
\nameref
{
part:#1
}
)
\vpageref
{
part:#1
}}}
% Part IV (Name of the Part), Part IV (Name of the Part) on the following page, Part IV (Name of the Part) on page 84)
%\newcommand{\refch}[1]{\hyperref[#1]{\chaptername\xspace\usekomafont{chapter}\normalsize\nameref{ch:#1}}\xspace\vpageref{ch:#1}\,}
\newcommand
{
\refchshort
}
[1]
{
\hyperref
[ch:#1]
{
\chapternameshort\xspace\ref
{
ch:#1
}}}
\newcommand
{
\refch
}
[1]
{
\hyperref
[ch:#1]
{
\chaptername\xspace\ref
{
ch:#1
}}}
\newcommand
{
\vrefch
}
[1]
{
\hyperref
[ch:#1]
{
\chaptername\xspace\ref
{
ch:#1
}
\vpageref
{
ch:#1
}}}
\newcommand
{
\nrefch
}
[1]
{
\hyperref
[ch:#1]
{
\chaptername\xspace\ref
{
ch:#1
}
(
\nameref
{
ch:#1
}
)
}}
\newcommand
{
\frefch
}
[1]
{
\hyperref
[ch:#1]
{
\chaptername\xspace\ref
{
ch:#1
}
(
\nameref
{
ch:#1
}
)
\vpageref
{
ch:#1
}}}
%\newcommand{\refsec}[1]{Section~{\usekomafont{section}\normalsize\nameref{sec:#1}}\xspace\vpageref{sec:#1}\,}
\newcommand
{
\refsecshort
}
[1]
{
\hyperref
[sec:#1]
{
\sectionnameshort\xspace\ref
{
sec:#1
}}}
\newcommand
{
\refsec
}
[1]
{
\hyperref
[sec:#1]
{
\sectionname\xspace\ref
{
sec:#1
}}}
\newcommand
{
\vrefsec
}
[1]
{
\hyperref
[sec:#1]
{
\sectionname\xspace\vref
{
sec:#1
}}}
\newcommand
{
\nrefsec
}
[1]
{
\hyperref
[sec:#1]
{
\sectionname\xspace\ref
{
sec:#1
}
(
\nameref
{
sec:#1
}
)
}}
\newcommand
{
\frefsec
}
[1]
{
\hyperref
[sec:#1]
{
\sectionname\xspace\ref
{
sec:#1
}
(
\nameref
{
sec:#1
}
)
\vpageref
{
sec:#1
}}}
\newcommand
{
\refsubsecshort
}
[1]
{
\hyperref
[subsec:#1]
{
\sectionnameshort\xspace\ref
{
subsec:#1
}}}
\newcommand
{
\refsubsec
}
[1]
{
\hyperref
[subsec:#1]
{
\subsectionname\xspace\ref
{
subsec:#1
}}}
\newcommand
{
\vrefsubsec
}
[1]
{
\hyperref
[subsec:#1]
{
\subsectionname\xspace\vref
{
subsec:#1
}}}
\newcommand
{
\nrefsubsec
}
[1]
{
\hyperref
[subsec:#1]
{
\subsectionname\xspace\ref
{
subsec:#1
}
(
\nameref
{
subsec:#1
}
)
}}
\newcommand
{
\frefsubsec
}
[1]
{
\hyperref
[subsec:#1]
{
\subsectionname\xspace\ref
{
subsec:#1
}
(
\nameref
{
subsec:#1
}
)
\vpageref
{
subsec:#1
}}}
%\newcommand{\reffig}[1]{{\hypersetup{colorlinks=false}\usekomafont{captionlabel}\hyperref[fig:#1]{Figure}\xspace\ref{fig:#1}}}
\newcommand
{
\reffigshort
}
[1]
{
\hyperref
[fig:#1]
{
\figurenameshort\xspace\ref
{
fig:#1
}}}
\newcommand
{
\reffig
}
[1]
{
\hyperref
[fig:#1]
{
\figurename
}
\xspace\ref
{
fig:#1
}}
\newcommand
{
\vreffig
}
[1]
{
\hyperref
[fig:#1]
{
\figurename\xspace\vref
{
fig:#1
}}}
%\newcommand{\reftab}[1]{{\hypersetup{colorlinks=false}\usekomafont{captionlabel}\hyperref[tab:#1]{Table}\xspace\ref{tab:#1}}}
\newcommand
{
\reftab
}
[1]
{
\hyperref
[tab:#1]
{
\tablename
}
\xspace\ref
{
tab:#1
}}
\newcommand
{
\vreftab
}
[1]
{
\hyperref
[tab:#1]
{
\tablename\xspace\vref
{
tab:#1
}}}
\newcommand
{
\refeqshort
}
[1]
{
\hyperref
[eq:#1]
\eqnameshort\xspace
(
\ref
{
eq:#1
}
)
}
\newcommand
{
\refeq
}
[1]
{
\hyperref
[eq:#1]
\eqname\xspace\ref
{
eq:#1
}}
\newcommand
{
\vrefeq
}
[1]
{
\hyperref
[eq:#1]
\eqname\xspace\vref
{
eq:#1
}}
\newcommand
{
\refdef
}
[1]
{
\hyperref
[def:#1]
\defname\xspace\ref
{
def:#1
}}
\newcommand
{
\vrefdef
}
[1]
{
\hyperref
[def:#1]
\defname\xspace\vref
{
def:#1
}}
\newcommand
{
\refassum
}
[1]
{
\hyperref
[assum:#1]
\assumname\xspace\ref
{
assum:#1
}}
\newcommand
{
\vrefassum
}
[1]
{
\hyperref
[assum:#1]
\assumname\xspace\vref
{
assum:#1
}}
\newcommand
{
\refthm
}
[1]
{
\hyperref
[thm:#1]
\thmname\xspace\ref
{
thm:#1
}}
\newcommand
{
\vrefthm
}
[1]
{
\hyperref
[thm:#1]
\thmname\xspace\vref
{
thm:#1
}}
\newcommand
{
\refprop
}
[1]
{
\hyperref
[prop:#1]
\propname\xspace\ref
{
prop:#1
}}
\newcommand
{
\vrefprop
}
[1]
{
\hyperref
[prop:#1]
\propname\xspace\vref
{
prop:#1
}}
\newcommand
{
\reflemma
}
[1]
{
\hyperref
[lemma:#1]
\lemmaname\xspace\ref
{
lemma:#1
}}
\newcommand
{
\vreflemma
}
[1]
{
\hyperref
[lemma:#1]
\lemmaname\xspace\vref
{
lemma:#1
}}
\newcommand
{
\refremark
}
[1]
{
\hyperref
[remark:#1]
\remarkname\xspace\ref
{
remark:#1
}}
\newcommand
{
\vrefremark
}
[1]
{
\hyperref
[remark:#1]
\remarkname\xspace\vref
{
remark:#1
}}
\newcommand
{
\refexample
}
[1]
{
\hyperref
[example:#1]
\examplename\xspace\ref
{
example:#1
}}
\newcommand
{
\vrefexample
}
[1]
{
\hyperref
[example:#1]
\examplename\xspace\vref
{
example:#1
}}
\newcommand
{
\refexercise
}
[1]
{
\hyperref
[exercise:#1]
\exercisename\xspace\ref
{
exercise:#1
}}
\newcommand
{
\vrefexercise
}
[1]
{
\hyperref
[exercise:#1]
\exercisename\xspace\vref
{
exercise:#1
}}
% 修改标签名称
\crefname
{
theorem
}{
定理
}{
定理
}
\crefname
{
lemma
}{
引理
}{
引理
}
\crefname
{
definition
}{
定义
}{
定义
}
\crefname
{
figure
}{
图
}{
图
}
\crefname
{
table
}{
表
}{
表
}
\crefname
{
equation
}{
公式
}{
公式
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment