I have created a custom \citedoi{} command based off biblatex's \citeurl{} command that is working fine. I can then put the \citedoi{} within a box near images or other things that need citations that are not in-text. I have tried to create a parbox to contain the doi in-text so it consumes the least amount of space (the font size is \tiny and it takes too much space within a line as can be seen in the images). I want to wrap the doi within a box over two \tiny lines so that it reduces the space between the prior and after words.
The motivation for this is that my PhD supervisor likes to have the doi's at the immediate location in addition to a bibliography at the end of presentation slides. I created a command to use for annotating purposes \scitedoi{} and the failed \itcitedoi{} for use within text:
\newcommand\scitedoi[1]{{\color{blue}\tiny\citedoi{#1}}}
\newcommand\itcitedoi[1]{\parbox{1.5cm}{\color{blue}\tiny\citedoi{#1}}}
When using just \scitedoi{} the beamer frame looks like this:
When also using the \itcitedoi{} command it goes off into the margin:
Ideally, I would like for the \itcitedoi{} command to be treated as text (if that makes sense?) and for text to go around it as it normally would for a word. I know that the text, even being \tiny, will increase the gap between lines where used but this is fine.
Does anyone know how I can achieve putting the \citedoi{} within a box that spans and wraps the doi over two \tiny lines using parbox or anything similar please?
MWE:
\begin{filecontents}[overwrite]{ref.bib}
@Article{M2020,
author = {Mehandia, Seema and Sharma, S. C. and Arya, Shailendra Kumar},
journal = {Biotechnol. Rep. (Amst)},
title = {Isolation and characterization of an alkali and thermostable laccase},
doi = {10.1016/j.btre.2019.e00413},
}
@Article{Mn2009,
author = {Murugesan, Kumarasamy and Kim, Young-Mo and Jeon, Jong-Rok and Chang, Yoon-Seok},
journal = {J Hazard Mater.},
title = {Effect of metal ions on reactive dye decolorization by laccase from Ganoderma lucidum.},
doi = {10.1016/j.jhazmat.2009.02.075},
}
\end{filecontents}
\documentclass[hyperref={colorlinks=false}]{beamer}
\usepackage[backend=biber, style=numeric]{biblatex}
\usepackage{xurl}
\addbibresource{ref.bib}
% Custom \citedoi command adapted from \citeurl
\DeclareFieldFormat{citedoi}{\href{https://doi.org/#1}{#1}}
\DeclareCiteCommand{\citedoi}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printfield[citedoi]{doi}}
{\multicitedelim}
{\usebibmacro{postnote}}
\newcommand\scitedoi[1]{{\color{blue}\tiny\citedoi{#1}}}
\newcommand\itcitedoi[1]{\parbox{1.5cm}{\color{blue}\tiny\citedoi{#1}}}
\begin{document}
\begin{frame}
\frametitle{Unreproducible}
This text is just text and nothing more as I just need filler text \scitedoi{M2020} that spans a few lines on
this beamer presentation. This text is just text and nothing more \itcitedoi{Mn2009} as I just need filler text
that spans a few lines on this beamer presentation. This text is just text and nothing more as I just need filler
text that spans a few lines on this beamer presentation.
\end{frame}
\begin{frame}
\printbibliography
\end{frame}
\end{document}
I am compiling with:
% arara: pdflatex: {options: [-halt-on-error]}
% arara: biber
% arara: pdflatex: {options: [-halt-on-error]}



