Text FormattingHyperref does not compile links, no errors/warnings

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
tobiasStet
Posts: 4
Joined: Sat Jan 17, 2015 5:09 pm

Hyperref does not compile links, no errors/warnings

Post by tobiasStet »

Hi,

after I resolved my earlier issue with the apa-style formatting of my bibliography, I ran into a problem regarding the DOIs. However, I think the problem rather concerns the package hyperref:

When I compile my tex-file, the references look like that:
Trevino, L. K., Brown, M., & Hartman, L. P. (2003). A qualitative investigation of per-
ceived executive ethical leadership: perceptions from inside and outside the execu-
tive suite. Human Relations, 56 (1), 5{37. doi:\url{10.1177/0018726703056001448}
However, in my preambel I load hyperref. I would have expected that the \url{...} that origins in my biblatex file would be compiled as a link. If I include links in my text, the output of the command

Code: Select all

\url{www.latex-community.org}
just produces
www.latex-community.org
but without the hyperlink.

Do I use the wrong packages or are they conflicting? I don't get any errors regarding when compiling the file. And apart from the ugly \url{...} in the references everything looks fine.

Here is my preamble:

Code: Select all

    \documentclass[a4paper,12pt]{article}
    \usepackage[ansinew]{inputenc}
    \usepackage[american]{babel}


    % Verschiedene Pakete ----------------------------------------------
    \usepackage{rotating}     % Umdrehen von Objekten (Tabellen, etc.)
    \usepackage{array}             % Gleichungen untereinander ordnen und nummerieren
    \usepackage{graphicx}     % Grafiken einbinden
    \usepackage{url}                % Urls ohne Probleme einbinden
    \usepackage{multirow}        % Tabellenzeilen zusammenfassen

    % Seitenformat-Pakete ---------------------------------------------------

    \usepackage{geometry} %Ränder einstellen
    \geometry{a4paper, top=25.4mm, left=25.4mm, right=25.4mm, bottom=25.4mm, % APA Format Style
    headsep=10mm, footskip=7mm}

    % Paket zum Einstellen des fancy-Designs

    \usepackage{fancyhdr}    
    \pagestyle{fancy}
    \lhead{} % Kopfzeile links
    \chead{} % Kopfzeile mitte
    \rhead{} % Kopfzeile rechts
    \cfoot{\thepage} % Fußzeile mitte
    \rfoot{} % Fußzeile rechts    
    \lfoot{} % Fußzeile links
    % Einstellen, dass im Rechten header das Kapitel gezeigt wird
    \renewcommand{\sectionmark}[1]{%
    \markboth{\thesection.\ #1}{}}
    \rhead{\nouppercase{\leftmark}}
    \renewcommand{\headwidth}{\textwidth}
    \renewcommand{\headrulewidth}{0.4pt}

    % Zeilenabstände ---------------------------------------------
    %\linespread{1.2}
    \usepackage{setspace}
    %\onehalfspacing
    \renewcommand{\baselinestretch}{1.5}

    % Literaturverwaltung------------------------------------------

    \usepackage{csquotes}
    \usepackage[backend=biber, style=apa]{biblatex}
    \DeclareLanguageMapping{american}{american-apa}
    \usepackage{hyperref}

    \bibliography{Mastersample}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \begin{document}
    \pagenumbering{roman}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \newpage
    %%%
    \tableofcontents
    \newpage
    %Inhalte

    \pagenumbering{arabic}


    %\appendix
    %\chapter{}
    %\input{Tables}
    \newpage
    \printbibliography
    \end{document}
Thanks a lot
Tobi

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Hyperref does not compile links, no errors/warnings

Post by Johannes_B »

You haven't shown us the bib-entry, so there is no way to test.

One hint though:

Code: Select all

@article{key,
url={latex-community.org}
}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
tobiasStet
Posts: 4
Joined: Sat Jan 17, 2015 5:09 pm

Hyperref does not compile links, no errors/warnings

Post by tobiasStet »

Hi Johannes,

right, sorry about that.

The Biblatex entry for an article looks like that:

Code: Select all

@article{Trevino.2003,
 author = {Trevino, L. K. and Brown, M. and Hartman, L. P.},
 year = {2003},
 title = {A Qualitative Investigation of Perceived Executive Ethical Leadership: Perceptions from Inside and Outside the Executive Suite},
 pages = {5--37},
 pagination = {page},
 volume = {56},
 journaltitle = {Human Relations},
 doi = {\url{10.1177/0018726703056001448}},
 number = {1},
 file = {10.1177/0018726703056001448}
}
This file is automaticall generated by the literature management software Citavi

citation would then be

Code: Select all

\parencite{Trevino.2003}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Hyperref does not compile links, no errors/warnings

Post by Johannes_B »

It is absolutly the same for doi: There should be no \url. Citavi shouldn't do it, it is bad.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply