如何制作带注释的参考书目

如何制作带注释的参考书目

我必须制作一个带注释的参考书目,但坦率地说,这是我第一次做这样的事情,而网上的解决方案要么 a)不起作用,要么 b)根本无法理解,因此带注释的参考书目需要如下所示:

在此处输入图片描述

请帮帮忙!!我该如何实现这个?这是我当前的 bib 文件:

@inproceedings{marolt2002neural,
  title={Neural networks for note onset detection in piano music},
  author={Marolt, Matija and Kavcic, Alenka and Privosnik, Marko},
  booktitle={Proceedings of the International Computer Music Conference},
  year={2002}
}

@inproceedings{marolt2000transcription,
  title={Transcription of polyphonic piano music with neural networks},
  author={Marolt, Matija},
  booktitle={Electrotechnical Conference, 2000. MELECON 2000. 10th Mediterranean},
  volume={2},
  pages={512--515},
  year={2000},
  organization={IEEE}
}

@inproceedings{bock2012polyphonic,
  title={Polyphonic piano note transcription with recurrent neural networks},
  author={Bock, S and Schedl, Markus},
  booktitle={Acoustics, Speech and Signal Processing (ICASSP), 2012 IEEE International Conference on},
  pages={121--124},
  year={2012},
  organization={IEEE}
}

@inproceedings{costantini2010svm,
  title={SVM based transcription system with short-term memory oriented to polyphonic piano music},
  author={Costantini, Giovanni and Todisco, Massimiliano and Perfetti, Renzo and Basili, Roberto and Casali, Daniele},
  booktitle={MELECON 2010-2010 15th IEEE Mediterranean Electrotechnical Conference},
  pages={196--201},
  year={2010},
  organization={IEEE}
}

@inproceedings{nava2004convolutional,
  title={A convolutional-kernel based approach for note onset detection in piano-solo audio signals},
  author={Nava, Gabriel Pablo and Tanaka, Hidehiko and Ide, Ichiro},
  booktitle={Int. Symp. Musical Acoust. ISMA},
  pages={289--292},
  year={2004}
}

@inproceedings{dixon2001learning,
  title={Learning to detect onsets of acoustic piano tones},
  author={Dixon, Simon},
  booktitle={Proceedings of the Workshop on Current Directions in Computer Music Research},
  pages={147--151},
  year={2001}
}

@article{poliner2006discriminative,
  title={A discriminative model for polyphonic piano transcription},
  author={Poliner, Graham E and Ellis, Daniel PW},
  journal={EURASIP Journal on Advances in Signal Processing},
  volume={2007},
  year={2006},
  publisher={Hindawi Publishing Corporation}
}

这是我的 .tex 文件:

\documentclass{article}

\begin{document}
\maketitle
\newpage
\bibliographystyle{plain-annote}
\bibliography{sample}

\cite{marolt2002neural}

\end{document}

答案1

由于您似乎想要特定的格式,我倾向于不将所有内容都保留在文件中.bib。如果您的示例显示的字段将毫无疑问地用于每个条目,那么就像(假设使用biblatex)这样简单的事情

\newcommand{\annote}[5]{%
  \begingroup
  \parindent 0pt%
  \hangafter 1%
  \hangindent 1em%
  \cite{#1}\space \fullcite{#1}\par
  \begin{quote}
  \textbf{Aim:}\quad #2\par%
  \textbf{Style/Type:}\quad #3\par%
  \textbf{Cross References:}\quad #4\par%
  \textbf{Summary:}\quad #5\par%
\end{quote}%
\endgroup
}

就可以了。然后你只需要使用类似下面的命令:

\annote{marolt2002neural}
{To demonstrate the merit of inverse reinforcement learning techniques in deriving a probability distribution over a space of reward functions, given expert training data.}
{Conference Paper/Theoretical.}
{Algorithms and techiniques from this paper are employed by \cite{bock2012polyphonic}}
{In this paper \ldots}

但也许字段不是静态的,而且这种方式可能很难记住哪个参数用于“样式”,哪个参数用于“交叉引用”。也许并非所有字段都会用于每个条目。如果您需要灵活性,则“键值”方法更好。这里您有很多选择。以下是其中一种方法:

\usepackage{xparse}
\ExplSyntaxOn
% set up the keys 'aim', 'style', 'xref', and 'summary'
\keys_define:nn { annotation }
 {
  % setup
  aim     .tl_set:N = \l_ann_aim_tl,
  style   .tl_set:N = \l_ann_style_tl,
  xref    .tl_set:N = \l_ann_xref_tl,
  summary .tl_set:N = \l_ann_summary_tl,
  % default values:
  aim     .initial:n = TODO!,
  style   .initial:n = TODO!,
  xref    .initial:n = [none],
  summary .initial:n = TODO!,
 }

% set the keys
\NewDocumentCommand{\annoteinfo}{ m }
 {
  \keys_set:nn { annotation } { #1 }
 }

% print and format the keys
\NewDocumentCommand{\printentry} {mm}
{
  \begingroup
  % how things should look:
  \parindent0pt \hangafter 1 \hangindent 1em%
  % provide the citation:
  \cite{#2}\space \fullcite{#2}\par
  % the keys will be used inside the quote environment
  \begin{quote}
  \annoteinfo{#1}
    \textbf{Aim:}\quad              \l_ann_aim_tl\par
    \textbf{Style:}\quad            \l_ann_style_tl\par
    \textbf{Cross-references:}\quad \l_ann_xref_tl\par
    \textbf{Summary:}\quad          \l_ann_summary_tl\par
  \end{quote}
  \endgroup
}

\ExplSyntaxOff

综上所述:

\documentclass{article}
% the following is used to make the example self-contained:
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@inproceedings{marolt2002neural,
  title={Neural networks for note onset detection in piano music},
  author={Marolt, Matija and Kavcic, Alenka and Privosnik, Marko},
  booktitle={Proceedings of the International Computer Music Conference},
  year={2002}
}

@inproceedings{marolt2000transcription,
  title={Transcription of polyphonic piano music with neural networks},
  author={Marolt, Matija},
  booktitle={Electrotechnical Conference, 2000. MELECON 2000. 10th Mediterranean},
  volume={2},
  pages={512--515},
  year={2000},
  organization={IEEE}
}

@inproceedings{bock2012polyphonic,
  title={Polyphonic piano note transcription with recurrent neural networks},
  author={Bock, S and Schedl, Markus},
  booktitle={Acoustics, Speech and Signal Processing (ICASSP), 2012 IEEE International Conference on},
  pages={121--124},
  year={2012},
  organization={IEEE}
}

@inproceedings{costantini2010svm,
  title={SVM based transcription system with short-term memory oriented to polyphonic piano music},
  author={Costantini, Giovanni and Todisco, Massimiliano and Perfetti, Renzo and Basili, Roberto and Casali, Daniele},
  booktitle={MELECON 2010-2010 15th IEEE Mediterranean Electrotechnical Conference},
  pages={196--201},
  year={2010},
  organization={IEEE}
}

@inproceedings{nava2004convolutional,
  title={A convolutional-kernel based approach for note onset detection in piano-solo audio signals},
  author={Nava, Gabriel Pablo and Tanaka, Hidehiko and Ide, Ichiro},
  booktitle={Int. Symp. Musical Acoust. ISMA},
  pages={289--292},
  year={2004}
}

@inproceedings{dixon2001learning,
  title={Learning to detect onsets of acoustic piano tones},
  author={Dixon, Simon},
  booktitle={Proceedings of the Workshop on Current Directions in Computer Music Research},
  pages={147--151},
  year={2001}
}

@article{poliner2006discriminative,
  title={A discriminative model for polyphonic piano transcription},
  author={Poliner, Graham E and Ellis, Daniel PW},
  journal={EURASIP Journal on Advances in Signal Processing},
  volume={2007},
  year={2006},
  publisher={Hindawi Publishing Corporation}
}
\end{filecontents*}

\usepackage[T1]{fontenc}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{xparse}

% If the fields are all required and are always the same
\newcommand{\annote}[5]{%
  \begingroup
  \parindent 0pt%
  \hangafter 1%
  \hangindent 1em%
  \cite{#1}\space \fullcite{#1}\par
  \begin{quote}
  \textbf{Aim:}\quad #2\par%
  \textbf{Style/Type:}\quad #3\par%
  \textbf{Cross References:}\quad #4\par%
  \textbf{Summary:}\quad #5\par%
\end{quote}%
\endgroup
}

% If the fields are not all required...
\ExplSyntaxOn
\keys_define:nn { annotation }
 {
  % setup
  aim     .tl_set:N = \l_ann_aim_tl,
  style   .tl_set:N = \l_ann_style_tl,
  xref    .tl_set:N = \l_ann_xref_tl,
  summary .tl_set:N = \l_ann_summary_tl,
  % defaults (change as needed)
  aim     .initial:n = TODO!,
  style   .initial:n = TODO!,
  xref    .initial:n = [none],
  summary .initial:n = TODO!,
 }


\NewDocumentCommand{\annoteinfo}{ m }
 {
  \keys_set:nn { annotation } { #1 }
 }

\NewDocumentCommand{\printentry} {mm}
{
  \begingroup
  % the next line does most of the visual formatting...
  \parindent0pt \hangafter 1 \hangindent 1em%
  \cite{#2}\space \fullcite{#2}\par
  % annotations are in the following environment...
  \begin{quote}
  \annoteinfo{#1}
    \textbf{Aim:}\quad              \l_ann_aim_tl     \par
    \textbf{Style:}\quad            \l_ann_style_tl   \par
    \textbf{Cross-references:}\quad \l_ann_xref_tl    \par
    \textbf{Summary:}\quad          \l_ann_summary_tl \par
  \end{quote}
  \endgroup
}

\ExplSyntaxOff

\begin{document}% ---------------------------------------------------

% These two entries are done the 'easy' way
\annote{marolt2002neural}
{To demonstrate the merit of inverse
  reinforcement learning techniques in deriving a probability
  distribution over a space of reward functions, given expert training
  data.}
{Conference Paper/Theoretical.}
{Algorithms and techiniques from
this paper are employed by \cite{bock2012polyphonic}}
{In this paper \ldots}

\annote{marolt2000transcription}
{Aim}
{Style}
{Cross-reference}
{Summary}

% these are the key-value entries
\printentry{
aim={To demonstrate things},
summary={This is the abstract},
}
{bock2012polyphonic}


\printentry{
style={Conference proceedings}
}
{costantini2010svm}

\printentry{
style={Info on style},
summary={Summary information goes here},
}
{nava2004convolutional}

\printentry{
aim={1},
style={2},
xref={3},
summary={4}}
{dixon2001learning}

\printentry{
aim={5},
style={6},
%xref={7},
summary={8}}
{poliner2006discriminative}


% this is how a bibliography is printed with biblatex
%\printbibliography

\end{document}

笔记:这个答案依赖于biblatex(和biber,虽然在这种情况下不需要)因为它方便地包含一个\fullcite命令。

答案2

以下略微修改了 @jon 的\printentry上述命令块,以便在未提供键时不打印任何内容。正如回答的那样,@jon 的回复将始终打印示例中的四个字段。最好只打印提供键值的字段。请参阅此链接了解解决方案的详细信息。因此:

\usepackage{xparse}
\usepackage{xifthen}

\ExplSyntaxOn

\keys_define:nn { annotation }
 {
  % setup
  aim     .tl_set:N = \l_ann_aim_tl,
  style   .tl_set:N = \l_ann_style_tl,
  xref    .tl_set:N = \l_ann_xref_tl,
  summary .tl_set:N = \l_ann_summary_tl,
 }


\NewDocumentCommand{\annoteinfo}{ m }
 {
  \keys_set:nn { annotation } { #1 }
 }

\NewDocumentCommand{\printentry} {mm}
{
  \begingroup
  % the next line does most of the visual formatting...
  \parindent0pt \hangafter 1 \hangindent 1em%
  \fullcite{#2}. \par %\cite{#1}\space \fullcite{#1}\par
  % annotations are in the following environment...
  \begin{quote}
  \annoteinfo{#1}
    \tl_if_blank:VF \l_ann_aim_tl       {\textbf{Aim:}\quad              \l_ann_aim_tl     \par}    
    \tl_if_blank:VF \l_ann_style_tl     {\textbf{Style:}\quad            \l_ann_style_tl   \par}
    \tl_if_blank:VF \l_ann_xref_tl      {\textbf{Cross-references:}\quad \l_ann_xref_tl    \par}
    \tl_if_blank:VF \l_ann_summary_tl   {\textbf{Summary:}\quad          \l_ann_summary_tl \par}
  \end{quote}
  \endgroup
}

\ExplSyntaxOff

相关内容