Open aminevsaziz opened 2 years ago
-- | Read a link-like org-ref style citation. The citation includes pre and
-- post text. However, multiple citations are not possible due to limitations
-- in the syntax.
linkLikeOrgRefCite :: PandocMonad m => OrgParser m (F Citation)
linkLikeOrgRefCite = try $ do
_ <- string "[["
mode <- orgRefCiteMode
key <- orgRefCiteKey
_ <- string "]["
pre <- trimInlinesF . mconcat <$> manyTill inline (try $ string "::")
spc <- option False (True <$ spaceChar)
suf <- trimInlinesF . mconcat <$> manyTill inline (try $ string "]]")
Looks like we're only allowing link-style citations which have the structure [[cite:foo][...morestuff]]
, which may not be correct. I don't use this org feature, so I'll let @tarleb comment further.
That's good news. I hope @tarleb have more insights about such issue.
My knowledge about many org features is out of date; I'll have to read up on that. Help, especially in form of links to relevant docs, would be welcome.
My knowledge about many org features is out of date; I'll have to read up on that. Help, especially in form of links to relevant docs, would be welcome.
That's good news ☺️ . But don't you think that adding support to [[cite:&key]] would be possible since: 1.org-cite is only [cite:@key].
Please check https://github.com/jkitchin/org-ref/blob/master/org-ref.org also @jkitchin maybe help, he is the author of the package.
You may want to set org-ref-cite-insert-version
to 2, and just keep using the version 2 syntax that is supported. If not, it is easy enough to write a pre-processing hook to convert the version 3 syntax to the cite:key syntax.
You may want to set
org-ref-cite-insert-version
to 2, and just keep using the version 2 syntax that is supported. If not, it is easy enough to write a pre-processing hook to convert the version 3 syntax to the cite:key syntax.
Thank you for sharing. However, the limited knowledge of emacs makes it a bit hard to do it. If you can sharing some proposals or materials that help achieving this quest.
Update:
@jkitchin I tried v2 and the native output from pandoc (-t native) show that org-ref citation are recognized as links due to its format of [[]].
so the issue was that inserting org-ref style citation in org file and then process it outside of emac using pandoc. at first, the expected output should be citation processed using CSL or at least recognized. However, pandoc recognize the citation as links but if if i use org-ref-export/body function and use CSL option in render the citation as text only. see the test below this the test.org file
this the zotlib.bib file
and this the command i used pandoc -f org -t native --citeproc --csl=elsevier-harvard.csl --bibliography=zotlib.bib --standalone test.org
the native ouput was [ RawBlock (Format "org") "#+csl-style: elsevier-harvard.csl" , RawBlock (Format "org") "#+PANDOC_OPTIONS: bibliography:zotlib.bib" , RawBlock (Format "org") "#+BIBLIOGRAPHY: zotlib.bib" , Para [ Link ( "" , [] , [] ) [ Str "cite:&nam-2011" ] ( "cite:&nam-2011" , "" ) ] , Header 1 ( "bibliography" , [] , [] ) [ Str "Bibliography" ] , Para [ Str "bibliographystyle:unsrtnat" , SoftBreak , Str "bibliography:zotlib.bib" ] ]
Hint i checked the inline reader parser for org-ref style citation in https://github.com/jgm/pandoc/blob/394fa9d0727a30f540d9c36ccfa68fc942cad587/src/Text/Pandoc/Readers/Org/Inlines.hs#L357 and it point out to "][" instead of "]]"
Pandoc version pandoc 2.17 and 2.18, on Archlinux