bibtex-tidy
bibtex 

所属分类:collect
开发工具:TeX
文件大小:0KB
下载次数:0
上传日期:2023-06-18 09:09:57
上 传 者sh-1993
说明:  BibTeX文件的清理器和格式设置工具,
(Cleaner and Formatter for BibTeX files,)

文件列表:
.pre-commit-hooks.yaml (105, 2023-06-18)
CHANGELOG.md (6152, 2023-06-18)
CONTRIBUTING.md (2006, 2023-06-18)
LICENSE (1067, 2023-06-18)
SECURITY.md (290, 2023-06-18)
bibtex-tidy.0 (7057, 2023-06-18)
bibtex-tidy.d.ts (9238, 2023-06-18)
bibtex-tidy.js (184924, 2023-06-18)
bin/ (0, 2023-06-18)
bin/bibtex-tidy (140484, 2023-06-18)
build.ts (12102, 2023-06-18)
docker/ (0, 2023-06-18)
docker/Dockerfile (641, 2023-06-18)
docker/bibtex-tidy.conf (334, 2023-06-18)
docker/docker-compose.yml (134, 2023-06-18)
docs/ (0, 2023-06-18)
docs/bundle.css (378345, 2023-06-18)
docs/bundle.js (963861, 2023-06-18)
docs/favicon.png (9142, 2023-06-18)
docs/index.html (508, 2023-06-18)
docs/manual/ (0, 2023-06-18)
docs/manual/key-generation.html (3336, 2023-06-18)
package-lock.json (320834, 2023-06-18)
package.json (3105, 2023-06-18)
scripts/ (0, 2023-06-18)
scripts/cover.sh (704, 2023-06-18)
scripts/prepare-release.sh (511, 2023-06-18)
scripts/validate-test-files.sh (469, 2023-06-18)
src/ (0, 2023-06-18)
src/__generated__/ (0, 2023-06-18)
src/__generated__/manPage.ts (7472, 2023-06-18)
... ...

# bibtex-tidy Tidy bibtex files. [Try it out](https://flamingtempura.github.io/bibtex-tidy/). ![Screen Recording 2020-10-23 at 16 25 26(1)](https://user-images.githubusercontent.com/1085434/97023051-dcbcf180-154c-11eb-9185-6f6de7c2fc68.gif) There are several ways you can use bibtex-tidy: * [In your browser](https://flamingtempura.github.io/bibtex-tidy/) * [CLI](#sec-cli) * As a pre-commit-hook * [Javascript/Typescript API](#sec-api) ## Example Before: ```bibtex @ARTICLE {feinberg1983technique, title={A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, author={Feinberg, Andrew P and Vogelstein, Bert}, journal = {Analytical biochemistry}, volume = 132, number=1, pages={6--13}, year=1983, publisher={Elsevier},} @article{miles1984qualitative, title={Qualitative data analysis: A sourcebook}, author={Miles, Matthew B and Huberman, A Michael and Saldana, J}, journal={Beverly Hills}, year=1984 } ``` After `bibtex-tidy references.bib`: ```bibtex @article{feinberg1983technique, title = {A technique for radiolabeling DNA restriction endonuclease fragments to high specific activity}, author = {Feinberg, Andrew P and Vogelstein, Bert}, year = 1983, journal = {Analytical biochemistry}, publisher = {Elsevier}, volume = 132, number = 1, pages = {6--13} } @article{miles1984qualitative, title = {Qualitative data analysis: A sourcebook}, author = {Miles, Matthew B and Huberman, A Michael and Saldana, J}, year = 1984, journal = {Beverly Hills} } ``` ## CLI Requires node v12 or later. ```sh npm install -g bibtex-tidy bibtex-tidy references.bib ``` ```manpage --help, -h Show help --v2 Input files will no longer be modified by default. Instead, you will need to specify `--modify`/`-m` option to overwrite the file, or `--output`/`-o` to output to a different file. --output, -o Write output to specified path. When omitted (and -m/--modify is not used), the result will be printed to stdout. --modify, -m, --no-modify Overwrite the original input files with the tidied result. This is enabled by default but will be disabled by default in v2. For v1, use --no-modify to output to stdout instead of overwriting the input files. --omit Remove specified fields from bibliography entries. Examples: --omit=id,name --curly, --no-curly Enclose all property values in braces. Quoted values will be converted to braces. For example, "Journal of Tea" will become {Journal of Tea}. --numeric, --no-numeric Strip quotes and braces from numeric/month values. For example, {1998} will become 1998. --months Convert all months to three letter abbreviations (jan, feb, etc). --space Indent all fields with the specified number of spaces. Ignored if tab is set. Examples: --space=2 (default), --space=4 --tab, --no-tab Indent all fields with a tab. --align, --no-align Insert whitespace between fields and values so that values are visually aligned. Examples: --align=14 (default) --blank-lines, --no-blank-lines Insert an empty line between each entry. --sort, --no-sort Sort entries by the specified field names (citation key is used if no fields are specified). For descending order, prefix the field with a dash (-). Multiple fields may be specified to sort everything by first field, then by the second field whenever the first field for entries are equal, etc. The following additional fields are also permitted: key (entry citation key), type (sorts by the type of entry, e.g. article), and special (ensures that @string, @preamble, @set, and @xdata entries are first). Examples: --sort (sort by citation key), --sort=-year,name (sort year descending then name ascending), --sort=name,year --duplicates Warn if duplicates are found, which are entries where DOI, abstract, or author and title are the same. Examples: --duplicates doi (same DOIs), --duplicates key (same IDs), --duplicates abstract (similar abstracts), --duplicates citation (similar author and titles), --duplicates doi, key (identical DOI or keys), --duplicates (same DOI, key, abstract, or citation) --merge, --no-merge Merge duplicates entries. Use the duplicates option to determine how duplicates are identified. There are different ways to merge: - first: only keep the original entry - last: only keep the last found duplicate - combine: keep original entry and merge in fields of duplicates if they do not already exist - overwrite: keep original entry and merge in fields of duplicates, overwriting existing fields if they exist --strip-enclosing-braces Where an entire value is enclosed in double braces, remove the extra braces. For example, {{Journal of Tea}} will become {Journal of Tea}. --drop-all-caps Where values are all caps, make them title case. For example, {JOURNAL OF TEA} will become {Journal of Tea}. Roman numerals will be left unchanged. --escape, --no-escape Escape special characters, such as umlaut. This ensures correct typesetting with latex. Enabled by default. --sort-fields Sort the fields within entries. If no fields are specified fields will be sorted by: title, shorttitle, author, year, month, day, journal, booktitle, location, on, publisher, address, series, volume, number, pages, doi, isbn, issn, url, urldate, copyright, category, note, metadata Examples: --sort-fields=name,author --strip-comments, --no-strip-comments Remove all comments from the bibtex source. --trailing-commas, --no-trailing-commas End the last key value pair in each entry with a comma. --encode-urls, --no-encode-urls Replace invalid URL characters with percent encoded values. --tidy-comments, --no-tidy-comments Remove whitespace surrounding comments. --remove-empty-fields, --no-remove-empty-fields Remove any fields that have empty values. --remove-dupe-fields, --no-remove-dupe-fields Only allow one of each field in each entry. Enabled by default. --generate-keys For all entries replace the key with a new key of the form . A JabRef citation pattern can be provided. This is an experimental option that may change without warning. --max-authors Truncate authors if above a given number into "and others". --no-lowercase Lowercase field names and entry type. Enabled by default. --enclosing-braces Enclose the given fields in double braces, such that case is preserved during BibTeX compilation. Examples: --enclosing-braces=title,journal (output title and journal fields will be of the form {{This is a title}}), --enclosing-braces (equivalent to ---enclosing-braces=title) --remove-braces Remove any curly braces within the value, unless they are part of a command. Examples: --remove-braces=title,journal, --remove-braces (equivalent to ---remove-braces=title) --wrap, --no-wrap Wrap long values at the given column Examples: --wrap (80 by default), --wrap=82 --version, -v Show bibtex-tidy version. --quiet Suppress logs on stdout. ``` <a name="sec-api" /> ## Javascript/Typescript API ``` npm install bibtex-tidy ``` ```js const tidy = require('bibtex-tidy'); const bibtex = fs.readFileSync('references.bib', 'utf8'); tidy.tidy(bibtex, { curly: true }); ``` Documentation for the options can be found [here](https://github.com/FlamingTempura/bibtex-tidy/blob/master/src/__generated__/optionsType.ts) ## Docker The web application can be deployed locally using the provided Docker configuration: 1. Build the Docker container: `docker build -t bibtex-tidy . -f docker/Dockerfile` 2. Start the docker container as a service: `cd docker && docker-compose up -d` 3. Visit the web application at http://localhost:8080 and do your BibTeX work 4. Stop the docker service, when you don't need it anymore: `cd docker && docker-compose down` </div> <hr> <div><B>近期下载者</B>:</div> <div id="download-users"></div> <hr> <div><B>相关文件</B>:</div> <div id="relate-items"></div> <hr> <div><B>评论</B>:[<a href=/Download/comment/id/1690457382873919.html data-toggle=modal data-target="#myModal">我要评论</a>] [<a class='pop-a' href=/Download/report/id/1690457382873919.html>举报此文件</a>]</div> <div id="file-comments"></div> <hr> <div><B>收藏者</B>:</div> <div id="favor-users"></div> <p></p> </div> <div class="col-xs-12 col-md-4"> <div class="ad-sidebar text-center"> <div class="ad-300"> </div> </div> </div> </div> </div> </div> <div class="my-footer"> <div class="container"> <div class="pull-right"> </div> <div> <a href="http://www.pudn.com" target=_blank>© 联合开发网 from 2004</a> | <a href="/Index/contact.html">联系站长</a> | <a href=" https://beian.miit.gov.cn" target=_blank>湘ICP备2023001425号</a> | <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43010502000604" target=_blank>网安备43010502000604</a> | </div> </div> </div> </div><!-- /wrapper--> <!-- page specific plugin scripts --> <!-- inline scripts related to this page --> <div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> </div> </div> </div><!-- /.modal-table --> </body> <script type="text/javascript"> $(document).on('click', '.list-more', function(){ var id=$(this).attr('data-id'); $('#list-'+id).css('max-height',$('#list-'+id)[0].scrollHeight); $(this).removeClass('list-more'); $(this).addClass('list-hide'); $(this).html('<i class="fa fa-angle-double-up"></i>'); //$(this).hide(); return false; }); $(document).on('click', '.list-hide', function(){ var id=$(this).attr('data-id'); $('#list-'+id).css('max-height','100px'); $(this).removeClass('list-hide'); $(this).addClass('list-more'); $(this).html('<i class="fa fa-angle-double-down"></i>'); return false; }); $("#myModal").on("hidden.bs.modal", function() { $(this).removeData(); }); $(document).on("click",".keyword",function(){ var keyword=$(this).attr("keyword"); var type_id=$(this).attr("type_id"); if(typeof(type_id) =="undefined" || type_id =="") type_id="0"; location.href="http://search.pudn.com/Download/index?keyword="+keyword; return false; }); </script> <script type="text/javascript" src="/js/time.js"></script> <script type="text/javascript" src="/js/marked.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.hide-list').each(function(){ if ($(this)[0].offsetHeight < $(this)[0].scrollHeight){ var id=$(this).attr('id'); id =id.substring(5); $(this).after('<div style="text-align:center"><a href="" class="list-more" data-id="' + id + '"><i class="fa fa-angle-double-down"></i></a></div>'); } }); }); var g_id="1690457382873919"; var keywords =new Array(); keywords[0] ='bibtex'; function get_download_user(){ var url ="/Download/get_download_user/id/"+g_id+".html"; $.get(url,function(ret){ if(ret.length ==0) return; var html=''; for(i in ret){ html =html + '<a href=/User/profile/id/'+ret[i].user_new_id+'.html>'+ret[i].name+'</a> '; } $('#download-users').append(html); }); } function get_relate_item(){ var url ="/Download/get_relate_item/id/"+g_id+'.html'; $.get(url,function(ret){ if(ret.length ==0) return; var html=''; var intro; for(i in ret){ intro =ret[i].intro; for(j in keywords){ var reg =new RegExp(keywords[j],'gmi'); intro =intro.replace(reg,'<font color=brown>'+keywords[j]+'</font>'); } html =html + '[<a href=/Download/item/id/'+ret[i].new_id+'.html>'+ret[i].name+'</a>]  '+intro+'<BR>'; } $('#relate-items').append(html); }); } function get_score_name(score){ switch(score){ case '100': return '很好,推荐下载'; case '85': return '还不错'; case '75': return '一般,勉强可用'; case '50': return '差'; case '3': return '纯粹是垃圾'; case '40': return '和说明完全不符'; case '20': return '文件不全'; case '10': return '不是源代码或资料'; case '5': return '文件有密码,不知道密码'; case '0': return '不能解压或下载失败'; } return ''; } function get_comment(){ var url ="/Download/get_comments/id/"+g_id+'.html'; $.get(url,function(ret){ if(ret.length ==0) return; var total_count =ret.total_count; var data =ret.data; var html=''; for(i in data){ html =html + '<a href="/User/profile/id/'+data[i].user_new_id+'.html" class="uploader">'+data[i].user_name+'</a>: <span class="comment-score">'+get_score_name(data[i].score)+'</span>, '+data[i].content+'<BR>'; } $('#file-comments').append(html); }); } function get_favor(){ var url ="/Download/get_item_favors/id/"+g_id+".html"; $.get(url,function(ret){ if(ret.length ==0) return; var html=''; for(i in ret){ html =html + '<a href=/User/profile/id/'+ret[i].user_new_id+'.html class=user>'+ret[i].name+'</a> '; } $('#favor-users').html(html); }); } // 得到下载这个的用户又下载了什么 function get_more_download(){ } // 得到下载这个的用户又搜索了什么 function get_more_keyword(){ } // 得到论坛相关问题 function get_bbs(){ } // 得到软件工场相关内容 function get_works(){ } // 得到相关聊天室 function get_chat(){ } // 得到相关软件商城信息 function get_shop(){ } // 得到job // 得到学习内容 // 数据 get_download_user(); //get_relate_item(); get_comment(); get_favor(); $('.vote-up').click(function(){ var url="/Download/vote/t/up/id/"+g_id; $.get(url,function(ret){ if(ret.status==0){ alert(ret.info); if(ret.url.length >0) location.href=ret.url; } else{ var s =$('#vote-up-count').html(); if(s =='') s="0"; var count =parseInt(s)+1; $('#vote-up-count').html(count); } }) return false; }); $('.vote-down').click(function(){ var url="/Download/vote/t/down/id/"+g_id; $.get(url,function(ret){ if(ret.status==0) alert(ret.info); else{ var s =$('#vote-down-count').html(); if(s =='') s="0"; var count =parseInt(s)+1; $('#vote-down-count').html(count); } }) return false; }); $('.favor-item').click(function(){ var url="/Favor/add/t/0/id/"+g_id; $.get(url,function(ret){ if(ret.status==0){ alert(ret.info); } else{ var s =$('#favor-count').html(); if(s =='') s="0"; var count =parseInt(s)+1; $('#favor-count').html(count); } }) return false; }); $('.pop-a').click(function(){ var url=$(this).attr('href'); $.get(url,function(ret){ alert(ret.info); //location.reload(); }) return false; }); document.getElementById('readme').innerHTML =marked.parse(document.getElementById('readme').innerHTML); </script> </html>