LaTeX forum ⇒ BibTeX, biblatex and biberHow to remove the page number from the end of a reference Topic is solved

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
User avatar
Johannes_B
Site Moderator
Posts: 3905
Joined: Thu Nov 01, 2012 4:08 pm

Re: How to remove the page number from the end of a referenc

Postby Johannes_B » Thu Aug 13, 2015 9:39 pm

Just a short info: That template in particular is one of three that get helpers all around the world a constant flow of annoyance.

It is purely incredible how many people are attracted to those. I know, a starter cannot judge the quality of a template, which is one of the very most important dangers in using them.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Tags:

daiyue
Posts: 17
Joined: Mon May 21, 2012 5:58 pm

Postby daiyue » Thu Aug 13, 2015 9:48 pm

Stefan_K wrote:So look where you are loading hyperref and where you set options (\hypersetup). There's the backref option.


Here is the style class file.

  1. %---------------------------------------------------------------
  2. % PhDthesis version 2 style file by Jakob Suckale, 2007
  3. % based on CUEDthesis version 1 by Harish Bhanderi 2002
  4. %---------------------------------------------------------------
  5.  
  6.  
  7.  
  8. %-------------------------- identification ---------------------
  9. %\NeedsTeXFormat{LaTeX2e}
  10. \ProvidesClass{Latex/Classes/PhDthesisPSnPDF}[2007/09/06 v2 PhD thesis class]
  11.  
  12.  
  13. %:-------------------------- report or book -----------------------
  14.  
  15. %If you want to use a Report style document then uncomment the following 3 lines and comment the below 8 book style lines:
  16. %\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
  17. %\ProcessOptions\relax
  18. %%\LoadClass[a4paper]{report}
  19. %\ifx\pdfoutput\undefined
  20. % \LoadClass[dvips, a4paper]{report}
  21. %\else
  22. % \LoadClass[pdftex, a4paper]{report}
  23. %\fi
  24.  
  25. %%Bibliography
  26. %%uncomment next line to change bibliography name to references for Report document class
  27. %\renewcommand{\refname}{References}
  28.  
  29. %If you want to use a Book style document then uncomment the following 3 lines and comment the above 8 report style lines:
  30. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
  31. \ProcessOptions\relax
  32. \ifx\pdfoutput\undefined
  33. \LoadClass[dvips, a4paper]{book}
  34. \else
  35. \LoadClass[pdftex, a4paper]{book}
  36. \fi
  37.  
  38.  
  39. %:-------------------------- packages for fancy things -----------------------
  40.  
  41. \usepackage{amssymb}
  42. \usepackage{graphics} % for improved inclusion of graphics
  43. %\usepackage{wrapfig} % to include figure with text wrapping around it
  44. \usepackage[margin=10pt,font=small,labelfont=bf]{caption} % for improved layout of figure captions with extra margin, smaller font than text
  45. \usepackage{fancyhdr} % for better header layout
  46. \usepackage{eucal}
  47. \usepackage[english]{babel}
  48. \usepackage[usenames, dvipsnames]{color}
  49. \usepackage[perpage]{footmisc}
  50. %\usepackage[round, sort, numbers, authoryear]{natbib}
  51. \usepackage{ifthen}
  52. \usepackage{multicol} % for pages with multiple text columns, e.g. References
  53. \setlength{\columnsep}{20pt} % space between columns; default 10pt quite narrow
  54. \usepackage[nottoc]{tocbibind} % correct page numbers for bib in TOC, nottoc suppresses an entry for TOC itself
  55. %\usepackage{nextpage}
  56.  
  57. %:-------------------------- Glossary/Abbrev./Symbols -----------------------
  58.  
  59. \usepackage[intoc]{nomencl} % load nomencl extension; include in TOC
  60. %\nomrefpage % to include page numbers after abbrevations
  61. \renewcommand{\nomname}{Glossary} % rename nomenclature
  62. \renewcommand{\nomlabel}[1]{\textbf{#1}} % make abbreviations bold
  63. \makenomenclature % used to be \makeglossary
  64. \newcommand{\g}{\footnote{For all abbreviations see the glossary on page \pageref{nom}.}} % type "\g" to refer to glossary
  65.  
  66. % used to be for sorting into categories:
  67. %\renewcommand\nomgroup[1]{%
  68. % \ifthenelse{\equal{#1}{A}}{%
  69. % \item[\textbf{Roman Symbols}] }{% A - Roman
  70. % \ifthenelse{\equal{#1}{G}}{%
  71. % \item[\textbf{Greek Symbols}]}{% G - Greek
  72. % \ifthenelse{\equal{#1}{R}}{%
  73. % \item[\textbf{Superscripts}]}{% R - Superscripts
  74. % \ifthenelse{\equal{#1}{S}}{%
  75. % \item[\textbf{Subscripts}]}{{% S - Subscripts
  76. % \ifthenelse{\equal{#1}{X}}{%
  77. % \item[\textbf{Other Symbols}]}{{% X - Other Symbols
  78. % \ifthenelse{\equal{#1}{Z}}{%
  79. % \item[\textbf{Acronyms}]}% Z - Acronyms
  80. % {{}}}}}}}}}}
  81.  
  82.  
  83. %:-------------------------- PDF/PS setup -----------------------
  84.  
  85. %\newif \ifpdf
  86. % \ifx \pdfoutput \undefined
  87. % % for running latex
  88. % \pdffalse
  89. % \else
  90. % % for running pdflatex
  91. % \pdfoutput = 1 % positive value for a PDF output
  92. % % otherwise a DVI
  93. % \pdftrue
  94. %\fi
  95. \usepackage{ifpdf}
  96.  
  97. \ifpdf
  98. %-->
  99. %--> Google.com search "hyperref options"
  100. %-->
  101. %--> http://www.ai.mit.edu/lab/sysadmin/latex/documentation/latex/hyperref/manual.pdf
  102. %--> http://www.chemie.unibas.ch/~vogtp/LaTeX2PDFLaTeX.pdf
  103. %--> http://www.uni-giessen.de/partosch/eurotex99/ oberdiek/print/sli4a4col.pdf
  104. %--> http://me.in-berlin.de/~miwie/tex-refs/html/latex-packages.html
  105. %-->
  106. \usepackage[ pdftex, plainpages = false, pdfpagelabels,
  107. pdfpagelayout = useoutlines,
  108. bookmarks,
  109. bookmarksopen = true,
  110. bookmarksnumbered = true,
  111. breaklinks = true,
  112. linktocpage,
  113. pagebackref,
  114. colorlinks = false, % was true
  115. % linkcolor = blue,
  116. % urlcolor = blue,
  117. %citecolor = red,
  118. % anchorcolor = green,
  119. hyperindex = true,
  120. hyperfigures
  121. ]{hyperref}
  122.  
  123. \DeclareGraphicsExtensions{.png, .jpg, .jpeg, .pdf, .gif} %GIF doesn't work??
  124. \usepackage[pdftex]{graphicx}
  125. \pdfcompresslevel=9
  126. \graphicspath{{0_frontmatter/figures/PNG/}{0_frontmatter/figures/PDF/}{0_frontmatter/figures/}}
  127. \else
  128. \usepackage[ dvips,
  129. bookmarks,
  130. bookmarksopen = true,
  131. bookmarksnumbered = true,
  132. breaklinks = true,
  133. linktocpage,
  134. pagebackref,
  135. % colorlinks = true,
  136. % linkcolor = blue,
  137. % urlcolor = blue,
  138. %citecolor = red,
  139. % anchorcolor = green,
  140. hyperindex = true,
  141. hyperfigures
  142. ]{hyperref}
  143.  
  144. \DeclareGraphicsExtensions{.eps, .ps}
  145. \usepackage{epsfig}
  146. \usepackage{graphicx}
  147. \graphicspath{{0_frontmatter/figures/EPS/}{0_frontmatter/figures/}}
  148. \fi
  149.  
  150.  
  151. %:-------------------------- page layout -----------------------
  152.  
  153. %A4 settings
  154. \ifpdf
  155. \pdfpageheight=297mm
  156. \pdfpagewidth=210mm
  157. \else
  158. \setlength{\paperheight}{297mm}
  159. \setlength{\paperwidth}{210mm}
  160. \fi
  161.  
  162. \setlength{\hoffset}{0.00cm}
  163. \setlength{\voffset}{0.00cm}
  164.  
  165. %: Uncomment this secion for two-sided printing
  166. % ------------------------------
  167. \setlength{\oddsidemargin}{1.5cm} %left space from text to border: odd page
  168. \setlength{\evensidemargin}{1.5cm} %left space from text to border: even page
  169. \setlength{\topmargin}{-1cm} %top space from top to text
  170. \setlength{\headheight}{1.36cm}
  171. \setlength{\headsep}{1.00cm}
  172. \setlength{\textheight}{20.84cm}
  173. \setlength{\textwidth}{14.5cm}
  174. \setlength{\marginparsep}{1mm}
  175. \setlength{\marginparwidth}{3cm}
  176. \setlength{\footskip}{2.36cm}
  177.  
  178.  
  179. %: Uncomment this secion for one-sided printing
  180. % taken from the original file, but with the first two lanes modified
  181. % ------------------------------
  182. %\setlength{\evensidemargin}{1.9cm} % was 1.96cm in original
  183. %\setlength{\oddsidemargin}{-0.001cm} % was -0.54cm in original file
  184. %\setlength{\topmargin}{1mm}
  185. %\setlength{\headheight}{1.36cm}
  186. %\setlength{\headsep}{1.00cm}
  187. %\setlength{\textheight}{20.84cm}
  188. %\setlength{\textwidth}{14.5cm}
  189. %\setlength{\marginparsep}{1mm}
  190. %\setlength{\marginparwidth}{3cm}
  191. %\setlength{\footskip}{2.36cm}
  192.  
  193.  
  194. %: section below defines fancy page layout options
  195. % ------------------------------
  196. \pagestyle{fancy}
  197. \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\thechapter. #1 }}{}}
  198. \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
  199. \fancyhf{}
  200. \fancyhead[RO]{\bfseries\rightmark}
  201. \fancyhead[LE]{\bfseries\leftmark}
  202. \fancyfoot[C]{\thepage}
  203. \renewcommand{\headrulewidth}{0.5pt}
  204. \renewcommand{\footrulewidth}{0pt}
  205. \addtolength{\headheight}{0.5pt}
  206. \fancypagestyle{plain}{
  207. \fancyhead{}
  208. \renewcommand{\headrulewidth}{0pt}
  209. }
  210.  
  211.  
  212.  
  213.  
  214.  
  215. %:-------------------------- title page layout -----------------------
  216.  
  217. % starts roman page numbering until chapter 1
  218. % important to avoid two pages numbered 1 and 2 which may cause bad links
  219. % bug: cover i + back side ii and then numbering restarts with i; should be iii
  220. \renewcommand{\thepage}{\roman{page}}
  221.  
  222. \newcommand{\submittedtext}{{A thesis submitted for the degree of}}
  223.  
  224. % DECLARATIONS
  225. % These macros are used to declare arguments needed for the
  226. % construction of the title page and other preamble.
  227.  
  228. % The year and term the degree will be officially conferred
  229. \def\degreedate#1{\gdef\@degreedate{#1}}
  230. % phd is for IN PARTIAL FULFILLMENT OF .........
  231. \def\phd#1{\gdef\@phd{#1}}
  232. % The name of your college or department(eg. Trinity, Pembroke, Maths, Physics)
  233. \def\collegeordept#1{\gdef\@collegeordept{#1}}
  234. % dissertation
  235. \def\dissert#1{\gdef\@dissert{#1}}
  236. % The name of your commitee
  237. \def\commitee#1{\gdef\@commitee{#1}}
  238. % Defining the crest
  239. \def\crest#1{\gdef\@crest{#1}}
  240. % Stating the city of birth for title page where needed; uncommented for use
  241. %\def\cityofbirth#1{\gdef\@cityofbirth{#1}}
  242.  
  243. % These macros define an environment for front matter that is always
  244. % single column even in a double-column document.
  245.  
  246. \newenvironment{alwayssingle}{%
  247. \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  248. \else\newpage\fi}
  249. {\if@restonecol\twocolumn\else\newpage\fi}
  250.  
  251. %define title page layout
  252. \renewcommand{\maketitle}{%
  253. \begin{alwayssingle}
  254. \renewcommand{\footnotesize}{\small}
  255. \renewcommand{\footnoterule}{\relax}
  256. \thispagestyle{empty}
  257. % \null\vfill
  258. \begin{center}
  259. {\large {{\@crest} \par} \vspace*{12mm}}
  260. { \Large {\bfseries {\@title}} \par\vspace*{12mm}}
  261. {
  262. \vspace*{1ex}
  263. {{\@dissert} \par}
  264. \vspace*{1ex}
  265. {{\@collegeordept} \par}
  266. \vspace*{1ex}
  267. {{\@commitee} \par}
  268. \vspace*{15mm}
  269. {{\@phd} \par}
  270. \vspace*{25mm}
  271. {{\@author} \par}
  272. \vspace*{1ex}
  273. {\@degreedate}
  274. }
  275. \end{center}
  276. \null\vfill
  277. \end{alwayssingle}}
  278.  
  279. % page number for cover back side should have page number blanked
  280.  
  281.  
  282. %:-------------------------- front matter layout -----------------------
  283.  
  284. % ACKNOWLEDGEMENTS
  285. %
  286. % The acknowledgements environment puts a large, bold, centered
  287. % "Acknowledgements" label at the top of the page. The acknowledgements
  288. % themselves appear in a quote environment, i.e. tabbed in at both sides, and
  289. % on its own page.
  290.  
  291. \newenvironment{acknowledgements}
  292. {\pagestyle{empty}
  293. \begin{alwayssingle}
  294. \begin{center}
  295. \vspace*{1.5cm}
  296. {\Large \bfseries Acknowledgements}
  297. \end{center}
  298. \vspace{0.5cm}
  299. \begin{quote}}
  300. {\end{quote}\end{alwayssingle}}
  301.  
  302. % The acknowledgementslong environment puts a large, bold, centered
  303. % "Acknowledgements" label at the top of the page. The acknowledgement itself
  304. % does not appears in a quote environment so you can get more in.
  305.  
  306. \newenvironment{acknowledgementslong}
  307. {\pagestyle{empty}
  308. \begin{alwayssingle}
  309. \begin{center}
  310. \vspace*{1.5cm}
  311. {\Large \bfseries Acknowledgements}
  312. \end{center}
  313. \vspace{0.1cm}\begin{quote}}
  314. {\end{quote}\end{alwayssingle}}
  315.  
  316. % PUBLICATION
  317. \newenvironment{publications}
  318. {\pagestyle{empty}
  319. \begin{alwayssingle}
  320. \begin{center}
  321. \vspace*{1.5cm}
  322. {\Large \bfseries Publications}
  323. \end{center}
  324. \vspace{0.5cm}
  325. \begin{quote}}
  326. {\end{quote}\end{alwayssingle}}
  327.  
  328. % DEDICATION
  329. %
  330. % The dedication environment makes sure the dedication gets its
  331. % own page and is set out in verse format.
  332.  
  333. \newenvironment{dedication}
  334. {\begin{alwayssingle}
  335. \pagestyle{empty}
  336. \begin{center}
  337. \vspace*{1.5cm}
  338. {\Large \bfseries DECLARATION}
  339. \end{center}
  340. \vspace{0.1cm}
  341. \begin{quote} }
  342. {\end{quote} \end{alwayssingle}}
  343.  
  344.  
  345. %ABSTRACT
  346. %
  347. %The abstract environment puts a large, bold, centered "Abstract" label at
  348. %the top of the page. The abstract itself appears in a quote environment,
  349. %i.e. tabbed in at both sides, and on its own page.
  350.  
  351. \newenvironment{abstracts} {\begin{alwayssingle} \pagestyle{empty}
  352. \begin{center}
  353. \vspace*{1.5cm}
  354. {\Large \bfseries Abstract}
  355. \end{center}
  356. \vspace{0.5cm}
  357. \begin{quote}}
  358. {\end{quote}\end{alwayssingle}}
  359.  
  360. %The abstractlong environment puts a large, bold, centered "Abstract" label at
  361. %the top of the page. The abstract itself does not appears in a quote
  362. %environment so you can get more in.
  363.  
  364. \newenvironment{abstractslong} {\begin{alwayssingle} \pagestyle{empty}
  365. \begin{center}
  366. \vspace*{1.5cm}
  367. {\Large \bfseries Abstract}
  368. \end{center}
  369. \vspace{0.5cm} \begin{quote}}
  370. {\end{quote}\end{alwayssingle}}
  371.  
  372. %The abstractseparate environment is for running of a page with the abstract
  373. %on including title and author etc as required to be handed in separately
  374.  
  375. \newenvironment{abstractseparate} {\begin{alwayssingle} \pagestyle{empty}
  376. \vspace*{-1in}
  377. \begin{center}
  378. { \Large {\bfseries {\@title}} \par}
  379. {{\large \vspace*{1ex} \@author} \par}
  380. {\large \vspace*{1ex}
  381. {{\@collegeordept} \par}
  382. {{\@university} \par}
  383. \vspace*{1ex}
  384. {{\it \submittedtext} \par}
  385. {\it {\@degree} \par}
  386. \vspace*{2ex}
  387. {\@degreedate}}
  388. \end{center}}
  389. {\end{alwayssingle}}
  390.  
  391. %Statement of originality if required
  392.  
  393. \newenvironment{declaration} {\begin{alwayssingle} \pagestyle{empty}
  394. \begin{center}
  395. \vspace*{1.5cm}
  396. {\Large \bfseries Declaration}
  397. \end{center}
  398. \vspace{0.5cm}
  399. \begin{quote}}
  400. {\end{quote}\end{alwayssingle}}
  401.  
  402.  
  403. %:-------------------------- page numbers: roman+arabic -----------------------
  404.  
  405. % ROMANPAGES
  406. %
  407. % The romanpages environment set the page numbering to lowercase roman one
  408. % for the contents and figures lists. It also resets
  409. % page-numbering for the remainder of the dissertation (arabic, starting at 1).
  410.  
  411. %\newenvironment{romanpages}
  412. %{
  413. % \setcounter{page}{1}
  414. % \renewcommand{\thepage}{\roman{page}}
  415. %} % close romanpage env't
  416.  
  417. {\newpage\renewcommand{\thepage}{\arabic{page}}\setcounter{page}{1}}
  418. \def\leftcite{(}\def\rightcite{)}
  419. \def\cite{\def\citeauthoryear##1##2{\def\@thisauthor{##1}%
  420. \ifx \@lastauthor \@thisauthor \relax \else##1 \fi ##2}\@icite}
  421. \def\shortcite{\def\citeauthoryear##1##2{##2}\@icite}
  422. \def\citeauthor{\def\citeauthoryear##1##2{##1}\@nbcite}
  423. \def\citeyear{\def\citeauthoryear##1##2{##2}\@nbcite}
  424. % internal macro for citations with () and with breaks between citations
  425. % used in \cite and \shortcite
  426. \def\@icite{\leavevmode\def\@citeseppen{-1000}%
  427. \def\@cite##1##2{\leftcite\nobreak\hskip 0in{##1\if@tempswa , ##2\fi}\rightcite}%
  428. \@ifnextchar [{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}
  429. % internal macro for citations without [] and with no breaks
  430. % used in \citeauthor and \citeyear
  431. \def\@nbcite{\leavevmode\def\@citeseppen{1000}%
  432. \def\@cite##1##2{{##1\if@tempswa , ##2\fi}}%
  433. \@ifnextchar [{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}}
  434. % don't box citations, separate with ; and a space
  435. % also, make the penalty between citations a parameter,
  436. % it may be a good place to break
  437. \def\@citex[#1]#2{%
  438. \def\@lastauthor{}\def\@citea{}%
  439. \@cite{\@for\@citeb:=#2\do
  440. {\@citea\def\@citea{;\penalty\@citeseppen\ }%
  441. \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
  442. \@ifundefined{b@\@citeb}{\def\@thisauthor{}{\bf ?}\@warning
  443. {Citation `\@citeb' on page \thepage \space undefined}}%
  444. {\csname b@\@citeb\endcsname}\let\@lastauthor\@thisauthor}}{#1}}
  445. %Ignore the key when generating the Reference section.
  446. \def\@lbibitem[#1]#2{\item\if@filesw
  447. { \def\protect##1{\string ##1\space}\immediate
  448. \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
  449. \def\thebibliography#1{\section*{References\@mkboth
  450. {REFERENCES}{REFERENCES}}\list
  451. {}{\labelwidth 0in\leftmargin\labelwidth
  452. \advance\leftmargin\labelsep \itemsep .01in}
  453. \def\newblock{\hskip .11em plus .33em minus .07em}
  454. \sloppy\clubpenalty4000\widowpenalty4000
  455. \sfcode`\.=1000\relax}
  456. \let\endthebibliography=\endlist


Comment out all the pagebackref in hyperref. The problem is solved.

many thanks


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 6 guests