BibTeX, biblatex and bibercitation format for bib entries with URLs

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
karlisrepsons
Posts: 50
Joined: Sat May 23, 2009 10:13 pm

citation format for bib entries with URLs

Post by karlisrepsons »

Hopefully I don't anger anyone by asking multiple questions this day (well, will have to pay more attention to others problems later...).
In this case the problem is as follows:

in my bib file there is:

Code: Select all

@misc{microsoft:opentype,
 author = "Microsoft Typography",
 title = "OpenType specification",
 howpublished = "\url{http://www.microsoft.com/typography/otspec}"
}
in tex script I have:

Code: Select all

\href{http://www.microsoft.com/typography/otspec/otff.htm}{Microsoft Typography}
\cite{microsoft:opentype}
It is necessary, because in that way work will be easy to use both online and in printed form.

But how to make this automated, so there is no need to write \href... all of the time? For example: \urlcite{microsoft:opentype}{Microsoft Typography} or even just \urlcite{microsoft:opentype}, implying the author field of bib entry for the caption of \href?
Help appreciated...

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

citation format for bib entries with URLs

Post by localghost »

Get used to posting full and compilable examples. Otherwise it is nearly impossible to give specific help. And we certainly don't want to become this a quiz.


Best regards
Thorsten¹
karlisrepsons
Posts: 50
Joined: Sat May 23, 2009 10:13 pm

citation format for bib entries with URLs

Post by karlisrepsons »

Ok, will remember this.
Wasn't that hard either:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage
[
   colorlinks=true,
   breaklinks=true,
   pagebackref=true
]
{hyperref}


\begin{document}

\href{http://www.microsoft.com/typography/otspec/otff.htm}{Microsoft Typography}
\cite{microsoft:opentype}

\begin{thebibliography}{1}
   \bibitem{microsoft:opentype}
   Microsoft Typography.
   \newblock Opentype specification.
   \newblock \url{http://www.microsoft.com/typography/otspec}.
\end{thebibliography}

\end{document}
(thebibliography environment, however, was generated from a .bib file)

So the idea is to write such a \newcommand, which would allow substitution as I described in the first post. But how can \url content be extracted from a bibitem?
Post Reply