乳胶分类参考书目

发布于 2025-01-12 16:23:46 字数 2362 浏览 1 评论 0原文

我有一段代码可以根据 .bib 文件中的日期和类型对参考书目进行排序。它工作得很好,但是我被要求提供从 1996 年开始的参考书目,即跳过之前的所有内容。有关修改内容以添加此条件的任何帮助吗?谢谢 对于 .bib 文件,请将在线找到的以下测试保存在文件中,这是要排序的数据库的示例:

%%%%%%%%%%% mybib.bib %%%%%%%%%%%%%%%%%%%
@BOOK{HK,
AUTHOR={H. Kopka and P. W. Daly},
TITLE={A Guide to LaTeX},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1999.
}
@BOOK{MG,
AUTHOR={M. Goossens and F. Mittelbach and A. Samarin},
TITLE={A LaTeX Companion},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1994.
}
@ARTICLE{Pan,
AUTHOR={D. Pan},
TITLE={A Tutorial on MPEG/Audio Compression},
JOURNAL={IEEE Multimedia},
YEAR={1995},
VOLUME= {2} ,
PAGES={60-74},
MONTH={Summer}.
}
@INPROCEEDINGS{Boney96,
AUTHOR={L. Boney and A. H. Tewfik and K. N. Hamdy},
TITLE={Digital Watermarks for Audio Signals},
booktitle={Proceedings of the Third IEEE International Conference on
Multimedia},
PAGES={473-480},
MONTH={June},
YEAR={1996}.
}
%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[backend=biber,sorting=ddatent,style=phys, defernumbers=true, natbib=true, isbn=true]{biblatex}
    
    %sorting by date 
    \DeclareSortingScheme{ddatent}{
        \sort{
            \field{presort}
        }
        \sort[final]{
            \field{sortkey}
        }
        \sort[direction=descending]{
            \field[strside=left,strwidth=4]{sortyear}
            \field[strside=left,strwidth=4]{year}
            \literal{9999}
        }
        \sort[direction=descending]{
            \field[padside=left,padwidth=2,padchar=0]{month}
            \literal{00}
        }
        \sort[direction=descending]{
            \field[padside=left,padwidth=2,padchar=0]{day}
            \literal{00}
        }
        \sort[direction=descending]{
            \field[padside=left,padwidth=4,padchar=0]{volume}
            \literal{9999}
        }
        \sort{
            \name{sortname}
            \name{author}
            \name{editor}
            \name{translator}
            \field{sorttitle}
            \field{title}
        }
        \sort{
            \field{sorttitle}
            \field{title}
        }
    }
    
    \addbibresource{mybib.bib}

    \begin{document}
    \printbibliography[heading=none,type=book]
    \printbibliography[heading=none,type=article]
    \end{document} `

I have a piece of code that sort my bibliography by date and type from a .bib file. It works just fine however i am asked to provide my bibliography from a starting year say 1996 i.e. skipping everything before.any help on what to amend to add this condition? thanks
for the .bib file please save in a file the following test found online, this is an example of database to be sorted:

%%%%%%%%%%% mybib.bib %%%%%%%%%%%%%%%%%%%
@BOOK{HK,
AUTHOR={H. Kopka and P. W. Daly},
TITLE={A Guide to LaTeX},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1999.
}
@BOOK{MG,
AUTHOR={M. Goossens and F. Mittelbach and A. Samarin},
TITLE={A LaTeX Companion},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1994.
}
@ARTICLE{Pan,
AUTHOR={D. Pan},
TITLE={A Tutorial on MPEG/Audio Compression},
JOURNAL={IEEE Multimedia},
YEAR={1995},
VOLUME= {2} ,
PAGES={60-74},
MONTH={Summer}.
}
@INPROCEEDINGS{Boney96,
AUTHOR={L. Boney and A. H. Tewfik and K. N. Hamdy},
TITLE={Digital Watermarks for Audio Signals},
booktitle={Proceedings of the Third IEEE International Conference on
Multimedia},
PAGES={473-480},
MONTH={June},
YEAR={1996}.
}
%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[backend=biber,sorting=ddatent,style=phys, defernumbers=true, natbib=true, isbn=true]{biblatex}
    
    %sorting by date 
    \DeclareSortingScheme{ddatent}{
        \sort{
            \field{presort}
        }
        \sort[final]{
            \field{sortkey}
        }
        \sort[direction=descending]{
            \field[strside=left,strwidth=4]{sortyear}
            \field[strside=left,strwidth=4]{year}
            \literal{9999}
        }
        \sort[direction=descending]{
            \field[padside=left,padwidth=2,padchar=0]{month}
            \literal{00}
        }
        \sort[direction=descending]{
            \field[padside=left,padwidth=2,padchar=0]{day}
            \literal{00}
        }
        \sort[direction=descending]{
            \field[padside=left,padwidth=4,padchar=0]{volume}
            \literal{9999}
        }
        \sort{
            \name{sortname}
            \name{author}
            \name{editor}
            \name{translator}
            \field{sorttitle}
            \field{title}
        }
        \sort{
            \field{sorttitle}
            \field{title}
        }
    }
    
    \addbibresource{mybib.bib}

    \begin{document}
    \printbibliography[heading=none,type=book]
    \printbibliography[heading=none,type=article]
    \end{document} `

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城仅有旧梦在 2025-01-19 16:23:46

您不得在参赛作品条目末尾使用 .


回到你的实际问题:你可以定义bibcheck:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[backend=biber,sorting=ddatent,style=phys, defernumbers=true, natbib=true, isbn=true]{biblatex}

%sorting by date 
\DeclareSortingScheme{ddatent}{
    \sort{
        \field{presort}
    }
    \sort[final]{
        \field{sortkey}
    }
    \sort[direction=descending]{
        \field[strside=left,strwidth=4]{sortyear}
        \field[strside=left,strwidth=4]{year}
        \literal{9999}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{month}
        \literal{00}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{day}
        \literal{00}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=4,padchar=0]{volume}
        \literal{9999}
    }
    \sort{
        \name{sortname}
        \name{author}
        \name{editor}
        \name{translator}
        \field{sorttitle}
        \field{title}
    }
    \sort{
        \field{sorttitle}
        \field{title}
    }
}

\begin{filecontents*}[overwrite]{\jobname.bib}
%%%%%%%%%%% mybib.bib %%%%%%%%%%%%%%%%%%%
@BOOK{HK,
AUTHOR={H. Kopka and P. W. Daly},
TITLE={A Guide to LaTeX},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1999,
}
@BOOK{MG,
AUTHOR={M. Goossens and F. Mittelbach and A. Samarin},
TITLE={A LaTeX Companion},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1994,
}
@ARTICLE{Pan,
AUTHOR={D. Pan},
TITLE={A Tutorial on MPEG/Audio Compression},
JOURNAL={IEEE Multimedia},
YEAR={1995},
VOLUME= {2} ,
PAGES={60-74},
MONTH={Summer},
}
@INPROCEEDINGS{Boney96,
AUTHOR={L. Boney and A. H. Tewfik and K. N. Hamdy},
TITLE={Digital Watermarks for Audio Signals},
booktitle={Proceedings of the Third IEEE International Conference on
Multimedia},
PAGES={473-480},
MONTH={June},
YEAR={1996},
}
%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%

\end{filecontents*}

\addbibresource{\jobname.bib}


\defbibcheck{recent}{%
  \iffieldint{year}
  {\ifnumless{\thefield{year}}{1996}
     {\skipentry}
     {}}
  {\skipentry}}

\begin{document}

\nocite{*}

\printbibliography[heading=none,type=book,check=recent]
\printbibliography[heading=none,type=article,check=recent]
\end{document} `

You mustn't use . at the end of your bib entries.


Back to your actual question: you can define bibcheck:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[backend=biber,sorting=ddatent,style=phys, defernumbers=true, natbib=true, isbn=true]{biblatex}

%sorting by date 
\DeclareSortingScheme{ddatent}{
    \sort{
        \field{presort}
    }
    \sort[final]{
        \field{sortkey}
    }
    \sort[direction=descending]{
        \field[strside=left,strwidth=4]{sortyear}
        \field[strside=left,strwidth=4]{year}
        \literal{9999}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{month}
        \literal{00}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=2,padchar=0]{day}
        \literal{00}
    }
    \sort[direction=descending]{
        \field[padside=left,padwidth=4,padchar=0]{volume}
        \literal{9999}
    }
    \sort{
        \name{sortname}
        \name{author}
        \name{editor}
        \name{translator}
        \field{sorttitle}
        \field{title}
    }
    \sort{
        \field{sorttitle}
        \field{title}
    }
}

\begin{filecontents*}[overwrite]{\jobname.bib}
%%%%%%%%%%% mybib.bib %%%%%%%%%%%%%%%%%%%
@BOOK{HK,
AUTHOR={H. Kopka and P. W. Daly},
TITLE={A Guide to LaTeX},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1999,
}
@BOOK{MG,
AUTHOR={M. Goossens and F. Mittelbach and A. Samarin},
TITLE={A LaTeX Companion},
PUBLISHER={Addison-Wesley},
ADDRESS={Reading, MA},
YEAR=1994,
}
@ARTICLE{Pan,
AUTHOR={D. Pan},
TITLE={A Tutorial on MPEG/Audio Compression},
JOURNAL={IEEE Multimedia},
YEAR={1995},
VOLUME= {2} ,
PAGES={60-74},
MONTH={Summer},
}
@INPROCEEDINGS{Boney96,
AUTHOR={L. Boney and A. H. Tewfik and K. N. Hamdy},
TITLE={Digital Watermarks for Audio Signals},
booktitle={Proceedings of the Third IEEE International Conference on
Multimedia},
PAGES={473-480},
MONTH={June},
YEAR={1996},
}
%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%

\end{filecontents*}

\addbibresource{\jobname.bib}


\defbibcheck{recent}{%
  \iffieldint{year}
  {\ifnumless{\thefield{year}}{1996}
     {\skipentry}
     {}}
  {\skipentry}}

\begin{document}

\nocite{*}

\printbibliography[heading=none,type=book,check=recent]
\printbibliography[heading=none,type=article,check=recent]
\end{document} `
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文