For the problem with 'Diplomarbeit' as a BibTex-Item I use the solution if the babelbib
-Package.
Insert
\useopackage{babelbib}
\usepackage[english,german]{babel}
\bibliographystyle{babalpha}
where the 'babalpha' is just an example, but here the 'bab...'-Styles have to be used.
Now you have to add a field 'language' to every (!) item in your bib-File, for example:
@mastersthesis{bib:dipme,
author = {Someone},
title= {something},
school = {somewhere},
year = {2012},
language = {german},
}
Now, it will not say, 'masters thesis' but 'Diplomarbeit'. With the field set to 'language= {english}' you keep 'masters thesis' (for this item).
As for the Eprints: I have no good idea. Whenever I am in a similar situation I just use the miscelaneous-type
The solution in this answer already shows how to fine tune the line breaking of URL's by specifying \UrlBreaks
, \UrlBigBreaks
, and \UrlNoBreaks
.
To get a carriage return symbol at breaking points, we specify the breaking points as \UrlSpecials
, that include the symbol when a line break occurs there.
\usepackage{dingbat} % for \carriagereturn symbol
\newcommand{\urllb}{\discretionary{\carriagereturn}{}{}}
\renewcommand{\UrlBreaks}{} % no standard breaking points
\renewcommand{\UrlBigBreaks}{}
\renewcommand{\UrlSpecials}{\do\.{\mathchar`\.\urllb}%
\do\/{\mathchar`\/\urllb}%
\do\@{\mathchar`\@\urllb}%
\do\\{\mathchar`\\\urllb}%
\do\-{\mathchar`\-\urllb}%
\do\#{\mathchar`\#\urllb}}% and so on
To specify breaking points by hand we use a symbol that hopefully won't occur in any URL like a star *
, and make it a break URL's like the above symbols, but vanishing from the string:
\renewcommand{\UrlSpecials}{\do\*{\urllb}}
In order to have correct links with this solution the star needs to be filtered out from the link, too. We use the gorgeous solution of Qrrbrbirlbel:
\makeatletter
\def\strip@star#1*#2\@strip@star{%
\expandafter\def\expandafter\strip@star@result\expandafter{\strip@star@result#1}%
\if\relax\detokenize{#2}\relax\else
\def\strip@star@temp{#2}%
\expandafter\expandafter\expandafter\strip@star\expandafter\strip@star@temp
\expandafter\@strip@star
\fi
}
\patchcmd{\hyper@linkurl}{\Hy@pstringdef\Hy@pstringURI{#2}}{%
\def\strip@star@result{}%
\expandafter\strip@star#2*\@strip@star
\Hy@pstringdef\Hy@pstringURI{\strip@star@result}%
}{}{}
\makeatother
Of course, both solutions can be mixed, i.e., we can specify the normal breaking points as \UrlSpecials
, as well as the star for additional hand made breaking points.
Complete code:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{reference,
title = {{Some dummy title in bib.}},
howpublished = {\url{http://docs.*oracle.com/*javase/*1.5.0/*docs/*rel*notes/*fea*tures.html#*concur*rency}},
note = {Last access: 12.03.2013},
}
\end{filecontents*}
\documentclass[10pt,a4paper]{article}
\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}
\usepackage[margin=2.5cm]{geometry}
\usepackage{etoolbox}
\usepackage{dingbat} % for \carriagereturn symbol
\newcommand{\urllb}{\discretionary{\carriagereturn}{}{}}
%% original breaking points of url package
% \def\UrlBreaks{\do\.\do\@\do\\\do\/\do\!\do\_\do\|\do\;\do\>\do\]%
% \do\)\do\,\do\?\do\'\do+\do\=\do\#}%
% \def\UrlBigBreaks{\do\:\do@url@hyp}%
\makeatletter
\g@addto@macro{\UrlNoBreaks}{\do\.} % do not break after dot '.'
\makeatother
\renewcommand{\UrlBreaks}{} % no standard breaking points
\renewcommand{\UrlBigBreaks}{}
\renewcommand{\UrlSpecials}{\do\_{\mathchar`\_\urllb}%
\do\/{\mathchar`\/\urllb}%
\do\@{\mathchar`\@\urllb}%
\do\\{\mathchar`\\\urllb}%
\do\-{\mathchar`\-\urllb}%
\do\#{\mathchar`\#\urllb}}% and so on
% \renewcommand{\UrlSpecials}{\do\*{\urllb}}
%% solution of Qrrbrbirlbel, see https://tex.stackexchange.com/q/103870/21591
\makeatletter
\def\strip@star#1*#2\@strip@star{%
\expandafter\def\expandafter\strip@star@result\expandafter{\strip@star@result#1}%
\if\relax\detokenize{#2}\relax\else
\def\strip@star@temp{#2}%
\expandafter\expandafter\expandafter\strip@star\expandafter\strip@star@temp
\expandafter\@strip@star
\fi
}
\patchcmd{\hyper@linkurl}{\Hy@pstringdef\Hy@pstringURI{#2}}{%
\def\strip@star@result{}%
\expandafter\strip@star#2*\@strip@star
\Hy@pstringdef\Hy@pstringURI{\strip@star@result}%
}{}{}
\makeatother
\parindent0pt
\begin{document}
This is text with \cite{reference}.
Automatic breaking with carriage return symbol:
Text text text text text text text
\url{http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#concurrency}
Text text text text text text text text
\url{http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#concurrency}
Text text text text text text text text text
\url{http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#concurrency}
Text text text text text text text text text text
\url{http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#concurrency}
Text text text text text text text text text text text
\url{http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#concurrency}
Text text text text text text text text text text text text
\url{http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#concurrency}
\bigskip
\renewcommand{\UrlSpecials}{\do\*{\urllb}}
Hand tuned URL breaking:
Text text text text text text text text
\url{http://docs.*oracle.com/*javase/*1.5.0/*docs/*rel*notes/*fea*tures.html#concur*rency}
Text text text text text text text text text
\url{http://docs.*oracle.com/*javase/*1.5.0/*docs/*rel*notes/*fea*tures.html#concur*rency}
Text text text text text text text text text text
\url{http://docs.*oracle.com/*javase/*1.5.0/*docs/*rel*notes/*fea*tures.html#concur*rency}
Text text text text text text text text text text text
\url{http://docs.*oracle.com/*javase/*1.5.0/*docs/*rel*notes/*fea*tures.html#concur*rency}
Text text text text text text text text text text text text
\url{http://docs.*oracle.com/*javase/*1.5.0/*docs/*rel*notes/*fea*tures.html#concur*rency}
\bibliographystyle{unsrt}
\bibliography{faramir2}
\end{document}
yields
All hail to Qrrbrbirlbel for the hard part.
Best Answer
Following egreg's advice I looked at
kp.bst
(linked to from the arXiv page). This works, in that the arxiv references are now clickable; the.bst
file automatically generates the correct\href
commands forhyperref
from thebibtex
fields specified by the arXiv.As I prefer the
plain.bst
style (numbers instead of names, etc) I pulled the relevant functions out ofkp.bst
, dropped them intohplain.bst
, fiddled a bit, and renamed the mash-up,hyperplain.bst
. If there is any interest I can email the file to the arXiv admins.