2017-08-27 5 views
2

私の論文で参考文献の引用スタイルを変更する際にいくつかの問題があります。よだれかけスタイルを指定するr-markdownによると(私はlatexからacmを必要とする)私は次の操作を行う必要があります。r markdown biblio-styleが機能しません

--- 
title: "title" 
bibliography: biblioteka.bib 
biblio-style: acm 
output: 
    pdf_document 
--- 

はしかし、biblio-style: acmは引用のスタイルには影響を及ぼさないように思われます。


現在の引用

ランダムフォレストはすでに...クレジット・スコアリング[@author1]に適用されている

@Article{author1, 
    Title     = {some title}, 
    Author     = {Einstein}, 
    Year     = {1997} 
} 

所望の出力

ランダムフォレストは、すでに信用スコアリング[1]に適用されている...

References 
[1] Einstein, some title, 1997 

答えて

1

私にとって最高の作品別の可能性がCitation Style Language (CSL)ファイルを追加することです - あなたのケースでacm.cslを - とYAMLでそれを参照してください。ヘッダ。テキストエディタを開き、以下のXMLコードをコピーして作業ディレクトリに保存し、名前を "acm.csl"に変更します。それは、このファイルにあなたのYAMLヘッダに参照した後

<?xml version="1.0" encoding="utf-8"?> 
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US"> 
    <info> 
    <title>ACM SIGCHI Proceedings (2016)</title> 
    <id>http://www.zotero.org/styles/acm-sigchi-proceedings</id> 
    <link href="http://www.zotero.org/styles/acm-sigchi-proceedings" rel="self"/> 
    <link href="http://cscw.acm.org/2016/submit/sigchi-word-proceedings.zip" rel="documentation"/> 
    <author> 
     <name>Yevgeniy Medynskiy</name> 
     <email>[email protected]</email> 
    </author> 
    <contributor> 
     <name>Sebastian Karcher</name> 
    </contributor> 
    <contributor> 
     <name>Eric Baumer</name> 
     <email>[email protected]</email> 
    </contributor> 
    <contributor> 
     <name>Svetlana Yarosh</name> 
     <email>[email protected]</email> 
    </contributor> 
    <contributor> 
     <name>Lilly Irani</name> 
     <email>[email protected]</email> 
    </contributor> 
    <category citation-format="numeric"/> 
    <category field="engineering"/> 
    <updated>2012-09-27T22:06:38+00:00</updated> 
    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights> 
    </info> 
    <macro name="author"> 
    <group suffix="."> 
     <names variable="author"> 
     <name delimiter=", " and="text" sort-separator=", "/> 
     <label form="short" prefix=" (" suffix=")"/> 
     <substitute> 
      <names variable="editor"/> 
     </substitute> 
     </names> 
    </group> 
    </macro> 
    <macro name="editor"> 
    <names variable="editor"> 
     <name delimiter=", " and="text" delimiter-precedes-last="never"/> 
     <label form="short" prefix=" (" suffix=")"/> 
    </names> 
    </macro> 
    <macro name="title"> 
    <choose> 
     <if type="bill book graphic legal_case legislation motion_picture report song" match="any"> 
     <text variable="title" font-style="italic"/> 
     </if> 
     <else> 
     <text variable="title"/> 
     </else> 
    </choose> 
    </macro> 
    <macro name="year"> 
    <date variable="issued"> 
     <date-part name="year"/> 
    </date> 
    </macro> 
    <macro name="journal"> 
    <group delimiter=", "> 
     <group delimiter=" "> 
     <text variable="container-title" font-style="italic"/> 
     <text variable="volume"/> 
     </group> 
     <text variable="issue"/> 
    </group> 
    </macro> 
    <macro name="edition"> 
    <choose> 
     <if is-numeric="edition"> 
     <group delimiter=" "> 
      <number variable="edition" form="ordinal"/> 
      <text term="edition" form="short"/> 
     </group> 
     </if> 
     <else> 
     <text variable="edition"/> 
     </else> 
    </choose> 
    </macro> 
    <macro name="book-publisher"> 
    <group delimiter=", "> 
     <text variable="publisher"/> 
     <text variable="publisher-place"/> 
    </group> 
    </macro> 
    <macro name="access"> 
    <choose> 
     <if variable="DOI"> 
     <text variable="DOI" prefix="https://doi.org/"/> 
     </if> 
     <else-if variable="URL"> 
     <group delimiter=" "> 
      <text term="retrieved" text-case="capitalize-first"/> 
      <date variable="accessed" form="text"/> 
      <text term="from"/> 
      <text variable="URL"/> 
     </group> 
     </else-if> 
    </choose> 
    </macro> 
    <citation collapse="citation-number"> 
    <sort> 
     <key variable="citation-number"/> 
    </sort> 
    <layout prefix="[" suffix="]" delimiter=","> 
     <group delimiter=":"> 
     <text variable="citation-number"/> 
     <text variable="locator"/> 
     </group> 
    </layout> 
    </citation> 
    <bibliography second-field-align="flush" entry-spacing="0"> 
    <sort> 
     <key macro="author"/> 
     <key variable="issued"/> 
    </sort> 
    <layout> 
     <text variable="citation-number" suffix="."/> 
     <group delimiter=". " suffix=". "> 
     <text macro="author"/> 
     <text macro="year"/> 
     <text macro="title"/> 
     </group> 
     <group suffix="."> 
     <choose> 
      <if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any"> 
      <text macro="book-publisher" suffix="."/> 
      </if> 
      <else-if type="paper-conference"> 
      <group suffix="." delimiter=", "> 
       <group delimiter=" "> 
       <text term="in" text-case="capitalize-first"/> 
       <group delimiter=" "> 
        <text variable="container-title" font-style="italic"/> 
        <text variable="collection-title" prefix="(" suffix=")"/> 
       </group> 
       </group> 
       <text variable="page"/> 
      </group> 
      </else-if> 
      <else-if type="chapter" match="any"> 
      <group delimiter=" "> 
       <text term="in" text-case="capitalize-first"/> 
       <group delimiter=", "> 
       <group delimiter=" "> 
        <text variable="container-title" font-style="italic"/> 
        <text macro="edition" prefix="(" suffix=")"/> 
       </group> 
       <text macro="editor"/> 
       </group> 
      </group> 
      <group suffix="." delimiter=", " prefix=". "> 
       <text macro="book-publisher"/> 
       <text variable="page"/> 
      </group> 
      </else-if> 
      <else-if type="article-journal"> 
      <group suffix="." delimiter=": "> 
       <text macro="journal"/> 
       <text variable="page"/> 
      </group> 
      </else-if> 
      <else> 
      <group suffix="." delimiter=", "> 
       <group delimiter=" " font-style="italic"> 
       <text variable="container-title"/> 
       <text variable="volume"/> 
       </group> 
       <text variable="page"/> 
      </group> 
      </else> 
     </choose> 
     </group> 
     <text macro="access" prefix=" "/> 
    </layout> 
    </bibliography> 
</style> 

--- 
title: "title" 
bibliography: biblioteka.bib 
csl: acm.csl 
output: 
    pdf_document 
--- 

だけCSL-Websiteで別の引用のスタイルを見つけ、スタイルを変更し、異なる* .cslに応じて進めるために。

完全を期すために、あなたの論文の最後に、あなたが目録を追加する必要があります:

# References 
```{r refmgr references, results="asis", echo=FALSE} 
# PrintBibliography(bib) 
``` 
+0

をちょっとjaySfが、私はあなたの助けが必要!私はちょうど複数の作者がすべてを反復するのではなく、参考文献に 'et al'として提示されていることに気付いた。 ' [51] Ong、C.S. et al。タイトル。ジャーナル。 29(1)、(2005)、41-47。 ここはbibファイルの一部です。出力は 'et al。 'の代わりになければなりません。これは共著者のすべての名前を与えます。あなたはそれを助けてもらえますか? '@article {ong2005、 タイトル= {タイトル}、 著者= {オング、CSとHuanga、JJとTzeng、GH}、 年= {2005}、 ジャーナル= {}ジャーナル、 体積= { 29(1)} } – abe

+0

あなたのヒントをありがとう!問題を再現することはできますが、自分のapa.cslを使用していたときは問題を再現できませんでした。したがって、私は最初のacm.cslに欠陥があり、正常に動作していると思われるものを見つけたと仮定しました。私はそれに応じて私の答えのコードを編集しました。 – jaySf

+0

jaySf !!もう一度!迅速な返信に感謝!!!!どうもありがとう!!!! – abe

関連する問題