![如果图片来源页面中的自定义尾注为空,则隐藏“注释”字段](https://linux22.com/image/473567/%E5%A6%82%E6%9E%9C%E5%9B%BE%E7%89%87%E6%9D%A5%E6%BA%90%E9%A1%B5%E9%9D%A2%E4%B8%AD%E7%9A%84%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B0%BE%E6%B3%A8%E4%B8%BA%E7%A9%BA%EF%BC%8C%E5%88%99%E9%9A%90%E8%97%8F%E2%80%9C%E6%B3%A8%E9%87%8A%E2%80%9D%E5%AD%97%E6%AE%B5.png)
我有一个图片来源页面,我使用 bib 文件中的标准引用来引用图片。我使用“注释”字段来报告许可信息。有时此字段为空,然后出现单词“笔记' 印在我的参考书目的末尾。
有什么方法可以捕获该字段为空并且不打印任何内容?
我已经尝试了多种变化
\if\relax\citefield{sibswissinstituteofbioinformaticsQ8WZ42TITIN_HUMANHomo}{note}\relax
\else
\citefield{sibswissinstituteofbioinformaticsQ8WZ42TITIN_HUMANHomo}{note}
\fi
包括 \empty、{note} 作为不同排列中的第二个参数等等,但完全没有运气,也不知道下一步该去哪里。
梅威瑟:
\begin{filecontents*}[overwrite]{\jobname.bib}
@artwork{galbraithStandardModelPhysics,
title = {Standard model of physics},
url = {https://texample.net/tikz/examples/model-physics/},
author = {Galbraith, David and Burgard, Carsten},
note = {Adapted slightly from original. Used under the terms of the Creative Commons {CC} {BY} Deed 2.5 License},
}
@artwork{sibswissinstituteofbioinformaticsQ8WZ42TITIN_HUMANHomo,
title = {Q8WZ42 ({TITIN}\_HUMAN) Homo sapiens (Human)},
url = {https://swissmodel.expasy.org/repository/uniprot/Q8WZ42},
abstract = {note: added a period in "Extra" because something is needed here for {\textbackslash}citeimage to work properly, and this lines up with the ... dots following},
author = {{SIB Swiss Institute of Bioinformatics}},
urldate = {2024-01-04},
}
\end{filecontents*}
\documentclass[11pt,letterpaper,oneside,table]{memoir}
\usepackage[backend=biber]{biblatex-chicago}
\usepackage{endnotes}
\addbibresource{\jobname.bib}
% custom image credits list; file extension .imc
\newlistof{imagecredits}{imc}{Image Credits}
\newcommand{\addtoimagecredits}{\thechapter.\arabic{figure}}
\DeclareDocumentCommand \citeimage {o m} {%
\IfNoValueTF{#1}{%
\addcontentsline{imc}{figure}{\protect\numberline{\addtoimagecredits}\citetitle{#2} by \citename{#2}{author}, retrieved from \citeurl{#2}. \citefield{#2}{note}}
}{%
\addcontentsline{imc}{figure}{\protect\numberline{\addtoimagecredits}[#1] \citetitle{#2} by \citename{#2}{author}, retrieved from \citeurl{#2}. \citefield{#2}{note}}
}%
}
\begin{document}
\citeimage{sibswissinstituteofbioinformaticsQ8WZ42TITIN_HUMANHomo}
\citeimage{galbraithStandardModelPhysics}
\citefield{sibswissinstituteofbioinformaticsQ8WZ42TITIN_HUMANHomo}{note}
\citefield{galbraithStandardModelPhysics}{note}
\imagecredits
\end{document}
顺便说一句 - 我尝试过其他 endnote 软件包,包括 enotez,但它们与我使用的一些其他软件包配合得不好 - 而且我不知道这是否会有所不同