-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hyperref links broken #2
Comments
I haven't used |
Yes sorry I did mean |
Hmmm, I can't reproduce this. If you get the chance, can you send me the .log file? I'm wondering if it might be a difference between our versions. |
I still haven't managed to reproduce this with a small variety of LaTeX installations on various systems. If you let me know what kind of platform (OS, how you installed LaTeX on it) I might have better luck, but until then I'm not sure whether I should throw in |
Sorry for the late reply... I'm currently running Linux Mint 13 and I installed LaTeX from the repo. I don't know what the cause of this bug is, but I know it must occur in other instances as I got the idea to try natbib off stackexchange (I think). Perhaps the best thing would be just to include a comment in the source code that says if you're experiencing these problems, try including natbib...? |
That's quite an old Linux Mint although it is an LTS - possibly this is a problem resolved in later distro LaTeX packages? |
Have added as a known issue in the README and the MainPackages as suggested, but I'll try and throw those up in a VM and see what happens. |
Hi - I'm trying to use this template for my thesis (UCL PhD student). I'm using Miktex under Winows 7 - I cant get the bibliography to link - even in your example main.tex file. I added the natbib package as suggested...here are the log warnings... and it doesn't insert the bibliography ...any ideas of how to fix this would be really appreciated. |
(@vixg 's issue was taken care of via email) |
@ikirker I'm seeing the same kind of problem, what was the solution? I get it regardless of whether natbib is used. Log: LaTeX Warning: Citation `example-citation' undefined on input line 6." |
@TWAnthony I think I didn't put vixg's problem+solution in here because it was unrelated to the issue above: I can't find the email now (that's not "I'm in a hurry", it's "it's not where I think it should be") but I think it may have simply been that they weren't running pdflatex the multiple times it needs to build the list of references and then insert the references into the document correctly on the subsequent runs. |
Okay- no worries. I've done a little more digging, and it seems like the problem is on my end (I've not yet worked out what). It's definitely not that I haven't multiple times, though. |
Hi! |
@da5nsy I can't reproduce the error compiling the template on Overleaf, unfortunately. If you can send me your source -- or share it with me on Overleaf, if you prefer, I guess -- I'll see if I can work something out. (Email address in the README but remove the +GH.) |
Thank you! Have given Overleaf access. |
@da5nsy I don't see the error at the top of this thread anywhere in your log output: could you clarify what the problem you're seeing is? |
@ikirker - thanks for taking a look. |
@ikirker - I've created a clone on Overleaf and invited you to that one so that I can keep working on the main doc and so that you can more agressively fiddle with the other one should that be useful. |
@da5nsy Thanks, that's a good idea. |
Okay, note to self: the Bibliography link is broken because of the manual toc entry addition: at the moment, it happens before the bibliography section is generated, including the clear page and the rest. If you remove it from Unfortunately this doesn't fix the other problem. |
Okay, I have a fix -- it's not ideally neat, but it does the job.
%%
%% This file uses the hyperref package to make your thesis have metadata embedded in the PDF,
%% and also adds links to be able to click on references and contents page entries to go to
%% the pages.
%%
% Some hacks are necessary to make bibentry and hyperref play nicely.
% See: http://tex.stackexchange.com/questions/65348/clash-between-bibentry-and-hyperref-with-bibstyle-elsart-harv
% See also: hyperref documentation section on bibentry, 9.1.7, p39
% This is the first half of the bibentry/hyperref hack
% The second half is just after begin{document} in Main.tex
\makeatletter
\let\saved@bibitem\@bibitem
\makeatother
\usepackage{bibentry}
% v-- this setup can be useful for checking links
%\usepackage[bookmarks,colorlinks=true,backref,hyperindex,debug,pdftex]{hyperref}
% v-- and this is the serious setup
\usepackage[bookmarks,pdftex,hidelinks]{hyperref}
\AtBeginDocument{
\hypersetup{
anchorcolor=purple,
citecolor=green,
pdfsubject={A thesis upon the subject of Museum Lighting, Colour Constancy and Melanopsin.},
pdfkeywords={Museum Lighting, Colour Constancy, Chromatic Adaptation, Melanopsin},
pdfauthor={Daniel Garside},
pdftitle={Museum Lighting, Colour Constancy and Melanopsin},
}
}
% Creates hyperlinks automatically from DOIs, and allows for use of \doi{} rather than \url{} which means it can handle non-allowed characters in DOIs.
\usepackage{doi} And in \begingroup
% This is the second half of the hack in LinksAndMetadata.tex
% See hyperref documentation section on bibentry, 9.1.7, p39
% I tried to move this to AtBeginDocument or AfterEndPreamble (requires etoolbox package)
% but there were errors I didn't understand.
\makeatletter
\let\@bibitem\saved@bibitem
\nobibliography*
% ^-- This is a trick that works with the bibentry package to let
% you put bibliography entries whereever you like.
% I used this to put references to papers a chapter's work was
% published in at the end of that chapter.
\makeatother
\endgroup Ideally I'd like to move that section out of the way and into the |
Thanks @ikirker. I've implemented all that on my live version and it seems to be working. However, for a future hypothetical person, I note that re-enabling natbib now removes the contents page entry. |
As a more general thing - I don't need full reference lines inline. Thus, as I understand it, I could live without the bibentry package, which seems to be the source of considerable difficulties in this template (which you have valiantly spent a great deal of time and energy on fixing). With this in mind, I'm going to fiddle around and make a fork which doesn't use bibentry. I'll let you know how I get along. Let me know if this exists already. |
If anyone wants the nuclear option (getting rid of bibentry): da5nsy@ee9c840 |
It's there right now because the template originates from an abstraction of my own thesis, which used it (as the comment implies). You're right that it might be better to remove it for simplicity and save some information somewhere about fixing it if you need it. I'll try to make a decision and fold the result in when I'm not spinning as many plates. |
When compiling I was getting errors such as:
pdfTeX warning (dest): name{cite.whatever} has been referenced but does not exist, replaced by a fixed one
meaning that the links in the PDF just went to the first page.
To fix this, I found that adding:
\usepackage{natbib}
before the line \usepackage{bibitem} did the trick.
I haven't found that this causes any other issues, so you might want to make this change on the repo.
The text was updated successfully, but these errors were encountered: