0

What I want to achieve is showing only the title, and it would still behave as a normal cite, meaning that after clicking it, I should be referencing to the bibliography page.

What I tried

I have this cite:

@software{Mahfouz_Survive_Line_2023,
    author = {Mahfouz, Ahmed},
    month = {2},
    title = {Survive Line},
    url = {https://github.com/Ahelsamahy/Survive-Line},
    version = {1},
    year = {2023}
}
  1. with showing style being alphabetic. when I try to site it in the file using \cite{Mahfouz_Survive_Line_2023} it shows me [Mah23].

  2. with showing style being authortitle and added \DeclareFieldFormat[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1} to show only title in different data entry, I get this result:

desired output without the author last name

This is the closest I could get to what I want, but I want it without the author last name, only the clickable title.

3
  • Welcome to tex.se.
    – Cicada
    Mar 21, 2023 at 3:33
  • 1
    What happens when you use \citetitle? Please add to your question a small compileable code that illustrates the issue so users can test solutions with and they don't have to guess what code you used.
    – Cicada
    Mar 21, 2023 at 3:36
  • @Cicada I mentioned in one of the steps i tried that i used \cite. I used \citetitle but it only shows the title, I want it also to be clickable to the bibliography page
    – Mahfouz
    Mar 23, 2023 at 21:53

1 Answer 1

2

If this is just for a one-off in a document that otherwise uses alphabetic citations, you can use \citetitle as already suggested by Cicada in the comments.

By default, however, \citetitle does not produce a link to the bibliography entry. If you want that, you need to redefine the command a little (the default definition can be found in biblatex.def, ll. 2211-2220 in v3.19).

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=alphabetic]{biblatex}
\usepackage[colorlinks]{hyperref}

\DeclareCiteCommand{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson,worman,geer}

Here we want just the title \citetitle{sigfridsson}

ipsum \autocite{sigfridsson}

\printbibliography
\end{document}

Linked title.

4
  • Thanks a lot, that is what I was looking for. If it wouldn't be a lot, can you explain the part of \DeclareCiteCommand{, specially the part of \ifciteindex.
    – Mahfouz
    Mar 23, 2023 at 21:56
  • @Mahfouz \DeclareCiteCommand defines a new citation command. In the first chunk of code we disable some trackers to avoid messing with "ibid." and the like (this is not necessary for all styles, but the definition is style-agnostic). The second chunk actually prints the title. Here the \ifciteindex{...}{...} bit creates an entry in the index for the title if indexing is enabled on the biblatex side. The \multicitedelim defines the separator between multiple title cites. The last chunk typesets a postnote if present. ....
    – moewe
    Mar 24, 2023 at 6:50
  • ... Hope that clears things up. If you follow the link to the original definition you can see that the only change we had to introduce was the addition of \printtext[bibhyperref]{...} around the \printfield[citetitle]{labeltitle}. You may want to look up these commands in the biblatex documentation for more details. If you have any more specific questions, don't hesitate to comment again.
    – moewe
    Mar 24, 2023 at 6:52
  • that is more than enough. thanks again and have a good day :)
    – Mahfouz
    Mar 27, 2023 at 12:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .