0

I am new to LaTeX and have some questions regarding biblatex.

For my thesis, there will be "Primary Sources" and "Secondary Sources" in the Bibliography section. The abbreviations are for these primary sources only. When I first cite them, I only need the short titles, but I need to let the shorthand start to work when I cite a text for the second time.

Therefore, I would like to know how to use \citetitle to enjoy the function of shorthandintro? I have learnt from here (Custom abbreviation for citation in bibtex) that the second solution only works for \cite. However, what I want to have is to cite a book title (the short one) with "hereafter xxx", and cite only the acronym next time.

For instance:

  • in a paragraph: Manusmṛti (hereafter MS)... From the MS we know ...
  • in the bibliography: Primary sources: [MS] Manusmṛti with Manubhāṣya. Edited by ... Secondary sources: Karl, M. (1987). How to cite something. Oxford.
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{filecontents}

\usepackage[backend=biber,
citestyle=authoryear,
bibstyle=alphabetic,
sorting=nty, 
citetracker=true]{biblatex}

\begin{filecontents*}{\jobname.bib} 

@book{ms32,
  editor  = {XXX},
  title   = {MS in wonderland with others and so on},
  shorttitle = MS in wonderland
  year = {1932},
  publisher    = {YYY},
  shorthand = {MS},
  keywords = {Primary},
}

@book{Karl87,
  author  = {Mark Karl},
  title   = {How to cite something},
  year = {1987},
  publisher    = {Oxford},
  keywords = {Secondary},
}

\end{filecontents*}


\addbibresource{\jobname.bib}

\newbibmacro*{longcite}{%
  \ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
    {\usebibmacro{cite:lable}%
     \setunit{\addspace}}
    {\printnames{labelname}%
     \setunit{\nameyeardelim}}%
  \usebibmacro{cite:labelyear+extrayear}}
%Can I make some changes here, so \citetitle also works?

\renewbibmacro*{cite:title}{%
  \ifciteseen
    {\iffieldundef{shorthand}
      {\usebibmacro{longcite}}
      {\usebibmacro{cite:shorthand}}}
    {\usebibmacro{longcite}
     \usebibmacro{shorthandintro}}}

\begin{document}

This is found in \citetitle{ms32} (the short title "MS in wonderland" is shown here). Something else... and cite again but use the acronym MS, \cite{ms32} works perfectly as showing only the MS.

To cite a secondary source, \textcite[36]{Karl87}.


\printbibliography[keyword={Primary},title={Primary Sources}] 
\printbibliography[keyword={Secondary},title={Secondary Sources}]


\end{document}
9
  • Unrelated to the actual question, but shorttitle = MS in wonderland in the .bib entry will error. Also \begin{filecontents*}{\Bibliography.bib} and then \addbibresource{Bibliography.bib} is a bit risky. I suggest you use the placeholder \jobname.bib in each case: \begin{filecontents*}{\jobname.bib} & \addbibresource{\jobname.bib}.
    – moewe
    May 18, 2022 at 16:01
  • I must say I'm a bit confused by the style setup: style=alphabetic, citestyle=authoryear,. This makes the bibliography use alphabetic labels, but the citations will not use them. If all your works have shorthands you might not notice something weird, but if you have works without shorthands this will look odd.
    – moewe
    May 18, 2022 at 16:07
  • Maybe it would help me understand what is going on here, if you could describe the citation setup you plan to use in more detail.
    – moewe
    May 18, 2022 at 16:07
  • Hi moewe, thank you very much for the comments! I have just revised my question and I hope it is clear now. As for the bibliography style, yes, it's indeed wrong in my local file as well, so I made some corrections there. Many thanks for your helpful suggestions!
    – Mijon
    May 19, 2022 at 8:30
  • Thank you very much for editing your question to focus on one issue only. Did you run your edited example code in a new, empty folder? I always encourage people to do that to make sure that the code actually shows what they think it does. (In your case there should be an error - the only I mentioned in the first comment).
    – moewe
    May 19, 2022 at 15:07

1 Answer 1

0

If we can assume that an entry has a shorthand field if and only if it is a primary source, I would suggest the following approach.

We no longer filter by keyword, but instead use the bibcheck suggested in biblatex: excluding shorthand entries from the main bibliography to filter entries with shorthands. To print the shorthands we can use \printshorthands.

Note that you get better results with options = {useeditor=false}, if you don't want the editor to be displayed before the title in the list of shorthands for the relevant work.

\documentclass[12pt]{article}
\usepackage[
  backend=biber,
  style=authoryear,
  citetracker=true,
]{biblatex}

\defbibcheck{noshorthand}{%
  \iffieldundef{shorthand}{}{\skipentry}%
}

\newbibmacro*{normalcite}{%
  \ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
    {\usebibmacro{cite:label}%
     \setunit{\printdelim{nonameyeardelim}}}
    {\printnames{labelname}%
     \setunit{\printdelim{nameyeardelim}}}%
  \usebibmacro{cite:labeldate+extradate}}

\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\usebibmacro{normalcite}}
    {\ifciteseen
       {\usebibmacro{cite:shorthand}}
       {\usebibmacro{cite:label}%
        \usebibmacro{shorthandintro}}}}

\begin{filecontents*}{\jobname.bib} 
@book{ms32,
  editor     = {XXX},
  title      = {MS in wonderland with others and so on},
  shorttitle = {MS in wonderland},
  year       = {1932},
  publisher  = {YYY},
  shorthand  = {MS},
  keywords   = {Primary},
  options    = {useeditor=false},
}
@book{Karl87,
  author    = {Mark Karl},
  title     = {How to cite something},
  year      = {1987},
  publisher = {Oxford},
  keywords  = {Secondary},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
Lorem \cite{ms32}
ipsum \cite{ms32}
dolor \textcite[36]{Karl87}.

\printshorthands[title={Primary Sources}] 
\printbibliography[check=noshorthand, title={Secondary Sources}]
\end{document}

Lorem MS in wonderland (henceforth cited as MS) ipsum MS dolor Karl (1987, p. 36).
MS MS in wonderland (1932). MS in wonderland with others and so on. Ed. by XXX. YYY.
Karl, Mark (1987). How to cite something. Oxford.

1
  • This is very helpful! Many thanks!!!
    – Mijon
    Jun 1, 2022 at 12:51

You must log in to answer this question.

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