Notion-MW
Notion-MW
 
(同じ利用者による、間の8版が非表示)
25行目: 25行目:
本来はこんな言語依存の単一文字列ではなく年、月、日それぞれ明示的に別のデータとして管理するのが筋だろう。実際、この仕様のせいで、Better BibTeXの使用時に問題が発生していた(後述)。
本来はこんな言語依存の単一文字列ではなく年、月、日それぞれ明示的に別のデータとして管理するのが筋だろう。実際、この仕様のせいで、Better BibTeXの使用時に問題が発生していた(後述)。


<span id="better-bibtex-for-zotero-m_linksep_m"></span>
<span id="better-bibtex-for-zotero"></span>
== [https://retorque.re/zotero-better-bibtex/ <strong>Better BibTeX for Zotero</strong>] ==
== [https://retorque.re/zotero-better-bibtex/ <strong>Better BibTeX for Zotero</strong>] ==


42行目: 42行目:
参考文献には出版年を書く必要があり、BibTeXではyearというフィールドに書かれる。このデータはZoteroの文献情報のdateのところから取得されており、「April 22, 2011」「2011&#45;04&#45;22」のようなdateのデータからは正しく「2011」だけを抽出してくれるが、dateが前述の「4月 22 , 2011」のような書式になっていた場合はうまくいかず、この文字列全てがBibTeX(.bib)に出力されてしまう(報告済み&#58; [https://github.com/retorquere/zotero-better-bibtex/issues/2449 &#91;Bug&#93;&#58; Japanese date format is not parsed correctly · Issue &#35;2449 · retorquere/zotero&#45;better&#45;bibtex]、6.7.61あたりで修正済み)。←の通り、Better BibTeXのエクスポート時に適用されるscript(Export → postscript)のところにデータを置換するための以下のようなコードを書いておくとよい。
参考文献には出版年を書く必要があり、BibTeXではyearというフィールドに書かれる。このデータはZoteroの文献情報のdateのところから取得されており、「April 22, 2011」「2011&#45;04&#45;22」のようなdateのデータからは正しく「2011」だけを抽出してくれるが、dateが前述の「4月 22 , 2011」のような書式になっていた場合はうまくいかず、この文字列全てがBibTeX(.bib)に出力されてしまう(報告済み&#58; [https://github.com/retorquere/zotero-better-bibtex/issues/2449 &#91;Bug&#93;&#58; Japanese date format is not parsed correctly · Issue &#35;2449 · retorquere/zotero&#45;better&#45;bibtex]、6.7.61あたりで修正済み)。←の通り、Better BibTeXのエクスポート時に適用されるscript(Export → postscript)のところにデータを置換するための以下のようなコードを書いておくとよい。


<syntaxhighlight lang="visual basic">if (tex.has.year) {
<syntaxhighlight lang="vb.net">if (tex.has.year) {
tex.add({name: 'year', replace: true, value: tex.has.year.value.replace(/.* /, '')})
tex.add({name: 'year', replace: true, value: tex.has.year.value.replace(/.* /, '')})
}</syntaxhighlight>
}</syntaxhighlight>
49行目: 49行目:
<div class="res-img">https://turgenev.cloudfree.jp/mw1/imgs/zot-settings.jpg</div>
<div class="res-img">https://turgenev.cloudfree.jp/mw1/imgs/zot-settings.jpg</div>


* 今は治っているかもしれないが、デバッグ出力を有効化して再起動してからスクリプトを一度編集しないとスクリプトが読み込まれないバグがあった([https://github.com/retorquere/zotero-better-bibtex/issues/2447 https://github.com/retorquere/zotero-better-bibtex/issues/2447])。
* 今は治っているかもしれないが、デバッグ出力を有効化して再起動してからスクリプトを一度編集しないとスクリプトが読み込まれないバグがあった([https://github.com/retorquere/zotero-better-bibtex/issues/2447 <span>https://github.com/retorquere/zotero-better-bibtex/issues/2447</span>])。


<span id="zotero-protocolを使用した操作"></span>
<span id="zotero-protocolを使用した操作"></span>
74行目: 74行目:
コード例&#58;
コード例&#58;


m_with_cap_m
<syntaxhighlight style="margin-bottom:0.2em;" lang="python">import sqlite3
 
<syntaxhighlight lang="python">import sqlite3
import sys
import sys
import json
import json