Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org-ref citation support #5710

Open
sati-bodhi opened this issue Aug 27, 2019 · 10 comments
Open

Org-ref citation support #5710

sati-bodhi opened this issue Aug 27, 2019 · 10 comments

Comments

@sati-bodhi
Copy link

Does Pandoc currently support the rendering of Org-Ref style citations?
The documentation over here seems to suggest it does; but I was not able to get it working correctly.

Org Citations

[@徐復觀YinYangWuXingJiQiYouGuanWenXianDeYanJiu1969{555-563}];cite:陳鼓應YiChuanYuDaoJiaSiXiang1994

(saved as citation_issues.org)

To be rendered as:

徐復觀〈陰陽五行及其有關文獻的研究〉,收入《中國人性論史》,頁555-563。陳鼓應,《易傳與道家思想》(台北:臺灣商務印書館,1994年)。

CSL:

https://gist.github.com/sati-bodhi/31dd24dd280c88d51908

Bibtex:

@book{陳鼓應YiChuanYuDaoJiaSiXiang1994,
  langid = {pinyin},
  location = {{台北}},
  title = {易傳與道家思想},
  isbn = {978-957-05-0994-6},
  pagetotal = {382},
  publisher = {{臺灣商務印書館}},
  date = {1994},
  author = {陳鼓應},
  eprinttype = {googlebooks}
}

@incollection{徐復觀YinYangWuXingJiQiYouGuanWenXianDeYanJiu1969,
  location = {{臺北}},
  title = {陰陽五行及其有關文獻的研究},
  booktitle = {中國人性論史(先秦篇)},
  publisher = {{商務}},
  date = {1969},
  pages = {509-587},
  author = {{徐復觀}}
}

(saved as thesis.bib)

Pandoc:

pandoc -F pandoc-citeproc --csl=humanities-chinese.csl --bibliography=thesis.bib -f org -t odt -o citation_issues.odt citation_issues.org

Result:

徐復觀,〈陰陽五行及其有關文獻的研究〉,收入《中國人性論史(先秦篇)》(臺北:商務,1969),頁555–563;cite:陳鼓應YiChuanYuDaoJiaSiXiang1994。

Native Pandoc syntax works but org-ref syntax doesn't.

@mb21
Copy link
Collaborator

mb21 commented Aug 27, 2019

What's your pandoc version?

@sati-bodhi
Copy link
Author

pandoc 2.7.3
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.8.1

@jgm
Copy link
Owner

jgm commented Aug 27, 2019

@tarleb is the expert on this and might be able to comment.

@tarleb
Copy link
Collaborator

tarleb commented Aug 28, 2019

The problem stems from the semicolon between the citations: pandoc seems to mishandle the fullwidth semicolon (U+FF1B) in your text. It works if one uses a normal semicolon (U+003B) instead.

We could consider to treat more punctuation characters as "special characters" in the parser, which would resolve this. I will take a look into this.

@mb21
Copy link
Collaborator

mb21 commented Aug 28, 2019

Yes, if it's a common thing in Asian languages to use the full-width semicolon. Otherwise I don't think we should get into the hole of considering similar unicode chars for all the chars in our syntax.

@sati-bodhi
Copy link
Author

Full width punctuation is very common at least within the Chinese and Japanese context, partly because words in these two languages are not separated by spaces. For example:

This is a sentence; This is another sentence.
これは文です。これは別の文です。
這是一句話;這是另一句話。

Adding a full-stop at the back of the syntax also breaks the code.
cite:陳鼓應YiChuanYuDaoJiaSiXiang1994。

@tarleb
Copy link
Collaborator

tarleb commented Aug 28, 2019

From what I can tell, org-ref cites are special in that they do not conform to the usual emphasis conditions checked by org-mode.

Here are some examples and how they are translated to LaTeX by org-ref:

cite:陳鼓應YiChuanYuDaoJiaSiXiang1994
<cite:陳鼓應YiChuanYuDaoJiaSiXiang1994>
;citep:陳鼓應YiChuanYuDaoJiaSiXiang1994
#citep:陳鼓應YiChuanYuDaoJiaSiXiang1994
$citep:陳鼓應YiChuanYuDaoJiaSiXiang1994
%citep:陳鼓應YiChuanYuDaoJiaSiXiang1994

output

\cite{陳鼓應YiChuanYuDaoJiaSiXiang1994}
\cite{陳鼓應YiChuanYuDaoJiaSiXiang1994}
;\citep{陳鼓應YiChuanYuDaoJiaSiXiang1994}
\#\citep{陳鼓應YiChuanYuDaoJiaSiXiang1994}
\$citep:陳鼓應YiChuanYuDaoJiaSiXiang1994
\%citep:陳鼓應YiChuanYuDaoJiaSiXiang1994

Seems like it is mostly breaking at word boundaries, although I'm a bit confused about $ and %. I'll have to read the code.

@sati-bodhi
Copy link
Author

Citations with locator also didn't resolve well.

[[cite:陳鼓應YiChuanYuDaoJiaSiXiang1994][55-100]]

This one got interpreted as a simple link:

55-100

@sati-bodhi
Copy link
Author

sati-bodhi commented Aug 28, 2019

Another weird bug that might be a separate issue:
The Pandoc interpreter renders book citations with an extra text term in between title and publisher.

陳鼓應,《易傳與道家思想》。收入台北:臺灣商務印書館,1994年。

If we use the same csl file on Zotero or the Visual CSL Editor, the text term should not be there:

圖片

Add the following csl-data.json to Example citations → Advanced → Add new reference to testify the issue.

[
  {"id":"陳鼓應YiChuanYuDaoJiaSiXiang1994","type":"book","title":"易傳與道家思想","publisher":"臺灣商務印書館","number-of-pages":"382","source":"Google Books","ISBN":"978-957-05-0994-6","language":"zh-TW","author":[{"literal":"陳鼓應"}],"issued":{"date-parts":[[1994]]},"publisher-place":"台北"}
]

@bdarcus
Copy link

bdarcus commented Jul 24, 2021

Should be superceded by #7329?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants