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}

Mijon
  • 3
  • 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 '22 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 '22 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 '22 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 '22 at 08: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 '22 at 15:07
  • I still don't quite understand your style setup. Do you cite works without shorthands at all? What should they look like (in citations and especially in the bibliography)? Do you actually use the bibmacro longcite you define in code not shown in the question or is this a straight copy from the linked answer to show what you have tried? – moewe May 19 '22 at 15:09
  • Sorry for the late reply! Yes, I just copied the bibmacro from the linked answer. It's not what I am looking for, but I don't know how to correct it to fit my needs. I cite other works (secondary ones) without acronyms, since the acronyms are only for the primary sources. In citations, the primary sources should first show a short title and its acronym in the brackets. In the bibliography, the primary sources should be "[acronym] + short title + full reference." While the secondary sources are not required to be so, full references are enough. Thank you very much! – Mijon May 28 '22 at 11:04
  • How do you want to cite secondary sources? Can you please add an example of a secondary source to your MWE and explain for both primary and secondary sources the desired citation and bibliography output. – moewe May 28 '22 at 11:34
  • Yes, I have edited the MWE again. For the output of the secondary sources, a usual APA style is fine. The only problem is the primary sources, since I don't know how to generate the acronyms in square brackets in the list of bibliography. Many thanks! – Mijon May 30 '22 at 07:12

1 Answers1

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.

moewe
  • 175,683