This is possible by modifying the bst-file.
Copy the file unsrtnat.bst
in your working folder. I recommand to rename the file maybe something like MYunsrtnat.bst
. At line 285 of MYunsrtnat.bst
you find the definition of the url output.
FUNCTION {format.url}
{ url empty$
{ "" }
{ new.block "URL \url{" url * "}" * }
if$
}
Change this definition as follow:
FUNCTION {format.url}
{ url empty$
{ "" }
{ new.block "\urlname{URL} \url{" url * "}" * }
if$
}
After this changing you can use the following example. There commands \urlname
and \url
gobble their argument. Before the bibliography is printed to commands are set to
\renewcommand*{\urlname}[1]{#1}
\renewcommand*{\url}[1]{\texttt{#1}}
Here the example:
\documentclass[]{tufte-handout}
\usepackage{filecontents}
\begin{filecontents}{References.bib}
@article{Sarukkai:2005,
author = {Sarukkai, S},
title = {{Revisiting the 'unreasonable effectiveness' of mathematics}},
journal = {Current science},
year = {2005},
url = {http://www.ias.ac.in/currsci/feb102005/415.pdf},
}
\end{filecontents}
\providecommand*{\urlname}[1]{}
\renewcommand*{\url}[1]{}
\begin{document}
This,\cite{Sarukkai:2005} includes the URL for the citation, which I don't want; thought I do want it in the bibliography.
\renewcommand*{\urlname}[1]{#1}
\renewcommand*{\url}[1]{\texttt{#1}}
\bibliographystyle{unsrtnat}
\bibliography{References}
\end{document}
The url
package provides an interesting extra piece of flexibility, via the construct \Urlmuskip
. This specifies the spacing around the breakable characters. By default it is 0mu
however you can set it some glue specification:
\Urlmuskip=0mu plus 1mu
(Unfortunately the example in the url
manual is wrong. It says \Urlmuskip=0pt plus 1mu
. Being a mathematical skip expression the only units allowed are mu
.)
Anyway in your example this gives:
\documentclass[paper]{ieice}
\usepackage[hyphens]{url}
\usepackage[hidelinks]{hyperref}
\hypersetup{breaklinks=true}
\urlstyle{same}
\usepackage{cite}
\title{Test document}
\begin{document}
this\cite{upnp_spec} is a test\cite{android_javascriptinterface} \cite{Author:Title}
\Urlmuskip=0mu plus 1mu\relax
\bibliographystyle{plain}
\bibliography{refs_min}
\end{document}
with an extra entry in your bib
file.
Other things one might try to help in general include making the bibliography ragged right. The easiest way to this is just to write \raggedright
before your \bibliography
command.
Better ragged right formatting is provided by the ragged2e
package. Unfortunately your class defines the Center
environment that clashes with the ragged2e
, so in this case you would have to load it as follows:
\let\clsCenter\Center\let\clsendCenter\endCenter
\let\Center\undefined\let\endCenter\undefined
\usepackage{ragged2e}
\let\Center\clsCenter
\let\endCenter\clsendCenter
You could then issue \RaggedRight
just before your \bibliography
command. If there is text after the bibliography, you can turn on normal formatting again with the \justifying
command.
Best Answer
With
biblatex
, you could use the package optionurl=false
to disable URLs generally and then set the internalbbx:url
toggle to true for entries belonging to a certain bibliography category. Note that for the entry type@online
the URL will be displayed even if you seturl=false
.