这是我的最小工作示例mwe.tex
:
\documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{4}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage[english]{babel}
\usepackage{titlesec}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}{\parindent}{3.25ex plus 1ex minus .2ex}{.75ex plus .1ex}
\titleformat{\subparagraph}
{\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}
\titlespacing*{\subparagraph}{\parindent}{3.25ex plus 1ex minus .2ex}{.75ex plus .1ex}
\usepackage{tabularx,booktabs}
% for better rules in the table
% prints author names as small caps
\usepackage{algorithm}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{longtable}
\newcolumntype{R}{>{\RaggedRight\let\newline\\\arraybackslash\hspace{0pt}}X}
\usepackage{pdflscape}
\usepackage{ltablex}
\usepackage{algpseudocode,caption}
\newcolumntype{C}{>{\centering\arraybackslash}X} % centered version of "X" type
\setlength{\extrarowheight}{1pt}
%\usepackage{subcaption} %incompatible with subfig
\graphicspath{{Pictures/}} % Specifies the directory where pictures are stored
\usepackage[numbers,sort&compress]{natbib} % Use the natbib reference package - read up on this to edit the reference style; if you want text (e.g. Smith et al., 2012) for the in-text references (instead of numbers), remove 'numbers' v
\hypersetup{urlcolor=black, colorlinks=true} % Colors hyperlinks in blue - change to black if annoyingv`
\title{\ttitle} % Defines the thesis title - don't touch this
\begin{document}
This mode is defined as IEEE 802.11 networking framework where different wireless nodes communicate with each other through a centralized controlling point, known as Access Point (AP). This AP acts as a bridge between the existing infrastructure (i.e. wired network) and the various wireless nodes wishing to communicate \cite{I6,I7}. There is no direct communication between wireless nodes as shown in \ref{f2}. The network services are delivered to the wireless nodes by the access point which is further connected to the predefined infrastructure consisting of wired nodes and gateways. Most of the corporate wireless LAN’s are connected in infrastructure mode because they need to get access to the wired LAN to use the printers and file servers. Cellular networks and satellite networks are typical examples of this wireless mode.
\label{Bibliography}
\lhead{\emph{Bibliography}} % Change the page header to say "Bibliography"
\bibliographystyle{unsrtnat} % Use the "custom" BibTeX style for formatting the Bibliography
\bibliography{Bibliography} % The references (bibliography) information are stored in the file named "Bibliography.bib"
\end{document}
我的 bib 文件的两个条目Bibliography.bib
:
@book{I6,
title={Wireless communications},
author={Goldsmith, Andrea},
year={2005},
publisher={Cambridge university press},
}
@book{I7,
title={Wireless and mobile network architectures},
author={Lin, Yi-Bang and Chlamtac, Imrich},
year={2008},
publisher={John Wiley \& Sons}
}
这是我的Thesis.cls
课程
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Thesis LaTeX Template - THESIS CLASS FILE
%
% This template has been downloaded from:
% http://www.latextemplates.com
%
% This class file defines the structure and design of the template.
%
% There is one part of this file that needs to be filled out - the variables
% dictating the document particulars such as the author name, university
% name, etc. You will find these in the commented "DOCUMENT VARIABLES"
% section below.
%
% The other two easily-editable sections are the margin sizes and abstract.
% These have both been commented for easy editing. Advanced LaTeX
% users will have no trouble editing the rest of the document to their liking.
%
% Original header:
%% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn
%% generated with the docstrip utility.
%%
%% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk
%% Further modified by www.latextemplates.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{Thesis}
[2007/22/02 v1.0
LaTeX document class]
\def\baseclass{book}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\def\@checkoptions#1#2{
\edef\@curroptions{\@ptionlist{\@currname.\@currext}}
\@tempswafalse
\@tfor\@this:=#2\do{
\@expandtwoargs\in@{,\@this,}{,\@curroptions,}
\ifin@ \@tempswatrue \@break@tfor \fi}
\let\@this\@empty
\if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
}
\@checkoptions{11pt}{{10pt}{11pt}{12pt}}
\PassOptionsToClass{a4paper}{\baseclass}
\ProcessOptions\relax
\LoadClass{\baseclass}
\newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}
\newcommand\Declaration[1]{
\btypeout{Certificate}
\addtotoc{Certificate}
\thispagestyle{plain}
%\null\vfil
%\vskip 60\p@
\begin{center}{\huge\bf Certificate\par}\end{center}
%\vskip 60\p@
{\normalsize #1}
\vfil\vfil\null
%\cleardoublepage
}
\newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
\def\today{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space \number\year}
\usepackage{setspace}
\onehalfspacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
\usepackage{vmargin}
\RequirePackage[utf8]{inputenc} % Allows the use of international characters (e.g. Umlauts)
%----------------------------------------------------------------------------------------
% MARGINS
%----------------------------------------------------------------------------------------
\setmarginsrb { 3.5cm} % left margin
{ 2.5cm} % top margin
{ 2.5cm} % right margin
{ 2.5cm} % bottom margin
{ 20pt} % head height
{0.25in} % head sep
{ 9pt} % foot height
{ 0.3in} % foot sep
%----------------------------------------------------------------------------------------
\raggedbottom
\setlength{\topskip}{1\topskip \@plus 5\p@}
\doublehyphendemerits=10000 % No consecutive line hyphens.
\brokenpenalty=10000 % No broken words across columns/pages.
\widowpenalty=9999 % Almost no widows at bottom of page.
\clubpenalty=9999 % Almost no orphans at top of page.
\interfootnotelinepenalty=9999 % Almost never break footnotes.
\usepackage{fancyhdr}
\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
\theoremstyle{plain}
\newtheorem{example}{Example}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{axiom}[theorem]{Axiom}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\usepackage[centerlast,small,sc]{caption}
\setlength{\captionmargin}{20pt}
\newcommand{\fref}[1]{Figure~\ref{#1}}
\newcommand{\tref}[1]{Table~\ref{#1}}
\newcommand{\eref}[1]{Equation~\ref{#1}}
\newcommand{\cref}[1]{Chapter~\ref{#1}}
\newcommand{\sref}[1]{Section~\ref{#1}}
\newcommand{\aref}[1]{Appendix~\ref{#1}}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\dbltopfraction}{.85}
\renewcommand{\floatpagefraction}{0.75}
\renewcommand{\dblfloatpagefraction}{.75}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[scriptsize]{subfigure}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{listings}
\usepackage{lstpatch}
\lstset{captionpos=b,
frame=tb,
basicstyle=\scriptsize\ttfamily,
showstringspaces=false,
keepspaces=true}
\lstdefinestyle{matlab} {
language=Matlab,
keywordstyle=\color{blue},
commentstyle=\color[rgb]{0.13,0.55,0.13}\em,
stringstyle=\color[rgb]{0.7,0,0} }
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,
colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red},
pdfstartview={FitV},unicode,breaklinks=true]{hyperref}
\pdfstringdefDisableCommands{
\let\\\space
}
\newcommand*{\supervisor}[1]{\def\supname{#1}}
\newcommand*{\thesistitle}[1]{\def\ttitle{#1}}
\newcommand*{\examiner}[1]{\def\examname{#1}}
\newcommand*{\degree}[1]{\def\degreename{#1}}
\newcommand*{\authors}[1]{\def\authornames{#1}}
\newcommand*{\addresses}[1]{\def\addressnames{#1}}
\newcommand*{\university}[1]{\def\univname{#1}}
\newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}}
\newcommand*{\department}[1]{\def\deptname{#1}}
\newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}}
\newcommand*{\group}[1]{\def\groupname{#1}}
\newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}}
\newcommand*{\faculty}[1]{\def\facname{#1}}
\newcommand*{\FACULTY}[1]{\def\FACNAME{#1}}
\newcommand*{\subject}[1]{\def\subjectname{#1}}
\newcommand*{\keywords}[1]{\def\keywordnames{#1}}
%----------------------------------------------------------------------------------------
% DOCUMENT VARIABLES
% Fill in the lines below to update the thesis template
% If you wish to cite each of the variables defined below, look at the
% section above for the citation command e.g. \examiner{} below is
% defined as \examname above so you cite it as \examname
%----------------------------------------------------------------------------------------
\thesistitle{Thesis Title} % Your thesis title - this is used in the title and abstract
%-------------------------------------------------
\supervisor{Thesis Supervisor} % You supervisor's name - this is used in the title page
%-------------------------------------------------
\examiner{} % Your examiner's name - this is not currently used anywhere in the template, cite it with \examname if you want it
%-------------------------------------------------
\degree{Master of Technology/PhD} % Your degree name - this is currently used in the title page and abstract
%-------------------------------------------------
\authors{authorname} % Your name - this is used in the title page and abstract
%-------------------------------------------------
\addresses{} % Your address - this is not currently used anywhere in the template, cite it with \addressnames if you want it
%-------------------------------------------------
\subject{} % Your subject area - this is not currently used anywhere in the template, cite it with \subjectname if you want it
%-------------------------------------------------
\keywords{} % Keywords for your thesis - this is not currently used anywhere in the template, cite it with \keywordnames if you want it
%-------------------------------------------------
\university{\texorpdfstring{\href{http://www.iitk.ac.in} % Your university's URL
{Indian Institute of Technology Kanpur}} % Your university's name - this is currently used in the title page
{Indian Institute of Technology Kanpur}}
%-------------------------------------------------
\UNIVERSITY{\texorpdfstring{\href{University Web Site URL Here (include http://www.iitk.ac.in)} % Your university's URL
{INDIAN INSTITUTE OF TECHNOLOGY KANPUR}} % Your university's name in capitals - this is currently used in the abstract page
{INDIAN INSTITUTE OF TECHNOLOGY KANPUR}}
%-------------------------------------------------
\department{\texorpdfstring{\href{Department or School Web Site URL Here (include http://www.iitk.ac.in/ce)} % Your department's URL
{Department of Civil Engineering}} % Your department's name - used in the title page and abstract
{Department of Civil Engineering}}
%-------------------------------------------------
\DEPARTMENT{\texorpdfstring{\href{Department or School Web Site URL Here (include http://www.iitk.ac.in/ce)} % Your department's URL
{DEPARTMENT OF CIVIL ENGINEERING}} % Your department's name in capitals - this is not currently used anywhere in the template, cite it with \DEPTNAME if you want it
{DEPARTMENT OF CIVIL ENGINEERING}}
%-------------------------------------------------
%\group{\texorpdfstring{\href{Research Group Web Site URL Here (include http://)} % Your research group's URL
% {Research Group Name}} % Your research group's name - this is currently used in the title page
% {Research Group Name}}
%-------------------------------------------------
%\GROUP{\texorpdfstring{\href{Research Group Web Site URL Here (include http://)} % Your research group's URL
% {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}} % Your research group's name in capitals - this is not currently used anywhere in the template, cite it with \GROUPNAME if you want it
% {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}}
%-------------------------------------------------
%\faculty{\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} % Your faculty's URL
% {Faculty Name}} % Your faculty's name - this is currently used in the abstract page
% {Faculty Name}}
%-------------------------------------------------
%\FACULTY{\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} % Your faculty's URL
% {FACULTY NAME (IN BLOCK CAPITALS)}} % Your faculty's name in capitals - this is not currently used anywhere in the template, cite it with \FACNAME if you want it
% {FACULTY NAME (IN BLOCK CAPITALS)}}
%----------------------------------------------------------------------------------------
% The default title page, this is not used in this www.latextemplates.com version
\renewcommand\maketitle{
\btypeout{Title Page}
\hypersetup{pdftitle={\@title}}
\hypersetup{pdfsubject=\subjectname}
\hypersetup{pdfauthor=\authornames}
\hypersetup{pdfkeywords=\keywordnames}
\thispagestyle{empty}
\begin{titlepage}
\let\footnotesize\small
\let\footnoterule\relax
\let \footnote \thanks
\setcounter{footnote}{0}
\null\vfil
\vskip 60\p@
\begin{center}
\setlength{\parskip}{0pt}
{\large\textbf{\UNIVNAME}\par}
\vfill
{\huge \bf \@title \par}
\vfill
{\LARGE by \par}
\smallskip
{\LARGE \authornames \par}
\vfill
{\large A thesis submitted in partial fulfillment for the \par}
{\large degree of \degreename \par}
\bigskip
\bigskip
{\large in the \par}
{\large \facname \par}
{\large \deptname \par}
\bigskip
\bigskip
\bigskip
{\Large \@date \par}
\bigskip
\end{center}
\par
\@thanks
\vfil\null
\end{titlepage}
\setcounter{footnote}{0}%
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
\cleardoublepage
}
%----------------------------------------------------------------------------------------
% ABSTRACT PAGE DESIGN
%----------------------------------------------------------------------------------------
\newenvironment{abstract}
{
\btypeout{Abstract Page}
\thispagestyle{empty}
%\null\vfil
\begin{flushleft}
\setlength{\parskip}{0pt}
%{\normalsize \UNIVNAME \par} % University name in capitals
%\bigskip
{\centering{\huge{\textit{Abstract}}} \par}
\bigskip
\HRule \\[0.4cm] % Horizontal line
Name of the student: \textbf{\authornames} \hfill Roll No: \textbf{Roll No.} \\
Degree for which submitted: \textbf{M.Tech.} \hfill Department: \textbf{Civil Engineering} \\
Thesis title: \textbf{\@title}\\
Thesis supervisor: \textbf{\supname}\\
Month and year of thesis submission: \textbf{{\large \today}\\[0.4cm] }
\HRule \\[1.5cm] % Horizontal line
\end{flushleft}
}
%----------------------------------------------------------------------------------------
{
\vfil\vfil\vfil\null
\cleardoublepage
}
\addtocounter{secnumdepth}{1}
\setcounter{tocdepth}{6}
\newcounter{dummy}
\newcommand\addtotoc[1]{
\refstepcounter{dummy}
\addcontentsline{toc}{chapter}{#1}}
\renewcommand\tableofcontents{
\btypeout{Table of Contents}
\addtotoc{Contents}
\begin{spacing}{1}{
\setlength{\parskip}{1pt}
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
\@starttoc{toc}
\if@restonecol\twocolumn\fi
\cleardoublepage
}\end{spacing}
}
\renewcommand\listoffigures{
\btypeout{List of Figures}
\addtotoc{List of Figures}
\begin{spacing}{1}{
\setlength{\parskip}{1pt}
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listfigurename
\@mkboth{\MakeUppercase\listfigurename}
{\MakeUppercase\listfigurename}}
\@starttoc{lof}
\if@restonecol\twocolumn\fi
\cleardoublepage
}\end{spacing}
}
\renewcommand\listoftables{
\btypeout{List of Tables}
\addtotoc{List of Tables}
\begin{spacing}{1}{
\setlength{\parskip}{1pt}
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listtablename
\@mkboth{
\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
\@starttoc{lot}
\if@restonecol\twocolumn\fi
\cleardoublepage
}\end{spacing}
}
\newcommand\listsymbolname{Abbreviations}
\usepackage{longtable}
\newcommand\listofsymbols[2]{
\btypeout{\listsymbolname}
\addtotoc{\listsymbolname}
\chapter*{\listsymbolname
\@mkboth{
\MakeUppercase\listsymbolname}{\MakeUppercase\listsymbolname}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
\cleardoublepage
}
\newcommand\listconstants{Physical Constants}
\usepackage{longtable}
\newcommand\listofconstants[2]{
\btypeout{\listconstants}
\addtotoc{\listconstants}
\chapter*{\listconstants
\@mkboth{
\MakeUppercase\listconstants}{\MakeUppercase\listconstants}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
\cleardoublepage
}
\newcommand\listnomenclature{Symbols}
\usepackage{longtable}
\newcommand\listofnomenclature[2]{
\btypeout{\listnomenclature}
\addtotoc{\listnomenclature}
\chapter*{\listnomenclature
\@mkboth{
\MakeUppercase\listnomenclature}{\MakeUppercase\listnomenclature}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
\cleardoublepage
}
\newcommand\acknowledgements[1]{
\btypeout{Acknowledgements}
\addtotoc{Acknowledgements}
\thispagestyle{plain}
\begin{center}{\huge{\textit{Acknowledgements}} \par}\end{center}
{\normalsize #1}
\vfil\vfil\null
}
\newcommand\dedicatory[1]{
\btypeout{Dedicatory}
\thispagestyle{plain}
\null\vfil
\vskip 60\p@
\begin{center}{\Large \sl #1}\end{center}
\vfil\null
\cleardoublepage
}
\renewcommand\backmatter{
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\addtotoc{\bibname}
\btypeout{\bibname}
\@mainmatterfalse}
\endinput
答案1
使用book
你的类Thesis
我可以定义一个新命令,\mycite
例如:
\newcommand{\mycite}[1]{\textbf{\cite{#1}}}
然后我可以使用命令\mycite{test}
以粗体形式打印对 bib 条目的引用test
。
查看代码
\documentclass[11pt, a4paper, oneside]{book} % Thesis Paper size, default font size and one-sided paper
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{4}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage[english]{babel}
\usepackage{titlesec}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}{\parindent}{3.25ex plus 1ex minus .2ex}{.75ex plus .1ex}
\titleformat{\subparagraph}
{\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}
\titlespacing*{\subparagraph}{\parindent}{3.25ex plus 1ex minus .2ex}{.75ex plus .1ex}
\usepackage{tabularx,booktabs}
% for better rules in the table
% prints author names as small caps
\usepackage{algorithm}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{longtable}
\newcolumntype{R}{>{\RaggedRight\let\newline\\\arraybackslash\hspace{0pt}}X}
\usepackage{pdflscape}
\usepackage{ltablex}
\usepackage{algpseudocode,caption}
\newcolumntype{C}{>{\centering\arraybackslash}X} % centered version of "X" type
\setlength{\extrarowheight}{1pt}
%\usepackage{subcaption} %incompatible with subfig
\graphicspath{{Pictures/}} % Specifies the directory where pictures are stored
\usepackage[numbers,sort&compress]{natbib} % Use the natbib reference package - read up on this to edit the reference style; if you want text (e.g. Smith et al., 2012) for the in-text references (instead of numbers), remove 'numbers' v
\usepackage{hyperref} % <===============================================
\hypersetup{urlcolor=black, colorlinks=true} % Colors hyperlinks in blue - change to black if annoyingv`
\title{\ttitle} % Defines the thesis title - don't touch this
\newcommand{\mycite}[1]{\textbf{\cite{#1}}} % <=========================
\begin{document}
This mode is defined as IEEE 802.11 networking framework where different
wireless nodes communicate with each other through a centralized
controlling point, known as Access Point (AP). This AP acts as a bridge
between the existing infrastructure (i.e. wired network) and the various
wireless nodes wishing to communicate \textbf{\cite{I6,I7}}. There is no direct % <=============
wireless nodes wishing to communicate \mycite{I6,I7}. There is no direct % <====================
communication between wireless nodes as shown in \ref{f2}. The network
services are delivered to the wireless nodes by the access point which
is further connected to the predefined infrastructure consisting of
wired nodes and gateways. Most of the corporate wireless LAN’s are
connected in infrastructure mode because they need to get access to the
wired LAN to use the printers and file servers. Cellular networks and
satellite networks are typical examples of this wireless mode.
\bibliographystyle{unsrtnat} % Use the "custom" BibTeX style for formatting the Bibliography
\bibliography{Bibliography} % The references (bibliography) information are stored in the file named "Bibliography.bib"
\end{document}
结果: