画像クレジットページのカスタムエンドノートが空の場合、「メモ」フィールドを非表示にする

画像クレジットページのカスタムエンドノートが空の場合、「メモ」フィールドを非表示にする

私は画像クレジットページを持っていて、bibファイル内の標準的な引用を使用して画像を引用しています。ライセンス情報を報告するために「注記」フィールドを使用しています。このフィールドが空の場合、「注記' は私の参考文献の最後に印刷されています。

このフィールドが空であることを捕捉し、何も印刷しない方法はありますか?

私は様々なバリエーションを試してきました

\if\relax\citefield{sibswissinstituteofbioinformaticsQ8WZ42TITIN_HUMANHomo}{note}\relax
\else
\citefield{sibswissinstituteofbioinformaticsQ8WZ42TITIN_HUMANHomo}{note}
\fi

\empty、{note} をさまざまな順列の 2 番目のパラメーターとして含めるなどしましたが、まったくうまくいかず、次に何をすればよいかわかりません。

MWE:

\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}

ところで、私はenotezを含む他のEndNoteパッケージを試しましたが、これらは私が使用している他のパッケージとうまく連携しません。違いがあるかどうかはわかりません。

関連情報