LaTeX-Package-Repositories / LaTeX-Package-Repositories/doi
Formatting prefix and hyperlink
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 10
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
I'm struggling to make two changes to how the DOI is formatted by this package: 1) change the format of the prefix to use small caps; and 2) change the colour of the hyperlink.
- I tried to edit the
\doitextcommand in doi.sty to:
\newcommand{\doitext}{\textsc{doi: }}
but when I compile my document I get an error associated with the .bbl file:
Missing control sequence inserted. \newblock \doi{10.1002/andp.19053221004} - I have set the options for the hyperref package to colour both links and citations blue but these options seem to be ignored by the doi package.
Does anyone have any suggestions? I've included my MWE file contents below. The doi.sty file is unchanged except for when I tried that one change described above.
Cheers!
\documentclass[a4paper]{article}
\usepackage{natbib}
\usepackage{hyperref}
\usepackage{doi}
\hypersetup{colorlinks=true, citecolor=blue, linkcolor=blue}
\begin{document}
This is a test \citep{einstein}.
\bibliographystyle{plainnat}
\bibliography{mwe.bib}
\end{document}
Contents of my mwe.bib file:
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "10.1002/andp.19053221004"
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with doi.sty and reproduce the included mwe.tex and mwe.bib example. Inspect how \doitext and DOI hyperlinks are defined, then verify that small-caps prefix formatting and hyperref link colors both work without the .bbl error.】【。
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100