首页 \ 问答 \ 在Rmarkdown的内联引用中使用“et al”(Italicising “et al” in inline citiations in Rmarkdown)

在Rmarkdown的内联引用中使用“et al”(Italicising “et al” in inline citiations in Rmarkdown)

我正在Rmarkdown生成一份报告,但是作者列表的简短形式的'et al'并没有在内联引用中得到斜体。 斜体确实在正常引用中发生。

以下是一些Rmarkdown来说明:

---
title: "testCite"
output:
  html_document:
    keep_md: true
csl: the-plant-journal.csl
bibliography: test.bib
---

The fly *Drosophila melanogaster* is one of the most intensively studied organisms in biology [@Adams:2000tj].

According to @Adams:2000tj, the fly *Drosophila melanogaster* is one of the most intensively studied organisms in biology.

这让我看到以下页面:

testCite.html

查看html我可以看到<em>标签没有被添加到内联引文中:

<p>The fly <em>Drosophila melanogaster</em> is one of the most intensively studied organisms in biology <span class="citation">(Adams <em>et al.</em>, 2000)</span>.</p>
<p>According to <span class="citation">Adams et al. (2000)</span>, the fly <em>Drosophila melanogaster</em> is one of the most intensively studied organisms in biology.</p>

the-plant-journal.csl从存储库下载 。 以下是test.bib的内容:

@article{Adams:2000tj,
author = {Adams, MD and Celniker, SE and Holt, RA and Evans, CA and Gocayne, JD and Amanatides, PG and Scherer, SE and Li, PW and Hoskins, RA and Galle, RF and George, RA and Lewis, SE and Richards, S and Ashburner, M and Henderson, SN and Sutton, GG and Wortman, JR},
title = {{The genome sequence of \emph{Drosophila melanogaster}}},
journal = {Science},
year = {2000},
volume = {287},
number = {5461},
pages = {2185--2195},
affiliation = {Celera Genom, Rockville, MD 20850 USA},
language = {English},
read = {Yes},
rating = {0},
date-added = {2012-03-02T23:35:05GMT},
date-modified = {2015-07-28T15:38:34GMT},
abstract = {The fly Drosophila melanogaster is one of the most intensively studied organisms in biology...},
url = {http://www.sciencemag.org/content/287/5461/2185.short}
}
}

不知道我在这里做错了什么。 我正在使用Rstudio 0.99.473 ,它调用pandoc 1.13.1pandoc-citeproc 0.5 。 SessionInfo结尾。 我希望这是所有必要的信息!

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8    LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] htmltools_0.2.6 tools_3.2.2     yaml_2.1.13     rmarkdown_0.8   digest_0.6.8   

I'm producing a report in Rmarkdown but 'et al' in the short form of the author list is not getting italicised in inline citations. Italicisation does occur in normal citations.

Here is some Rmarkdown to illustrate:

---
title: "testCite"
output:
  html_document:
    keep_md: true
csl: the-plant-journal.csl
bibliography: test.bib
---

The fly *Drosophila melanogaster* is one of the most intensively studied organisms in biology [@Adams:2000tj].

According to @Adams:2000tj, the fly *Drosophila melanogaster* is one of the most intensively studied organisms in biology.

This gets me the following page:

testCite.html

Looking in the html I can see the <em> tags are not being added to the inline citation:

<p>The fly <em>Drosophila melanogaster</em> is one of the most intensively studied organisms in biology <span class="citation">(Adams <em>et al.</em>, 2000)</span>.</p>
<p>According to <span class="citation">Adams et al. (2000)</span>, the fly <em>Drosophila melanogaster</em> is one of the most intensively studied organisms in biology.</p>

the-plant-journal.csl was downloaded from the repository. Here are the contents of test.bib:

@article{Adams:2000tj,
author = {Adams, MD and Celniker, SE and Holt, RA and Evans, CA and Gocayne, JD and Amanatides, PG and Scherer, SE and Li, PW and Hoskins, RA and Galle, RF and George, RA and Lewis, SE and Richards, S and Ashburner, M and Henderson, SN and Sutton, GG and Wortman, JR},
title = {{The genome sequence of \emph{Drosophila melanogaster}}},
journal = {Science},
year = {2000},
volume = {287},
number = {5461},
pages = {2185--2195},
affiliation = {Celera Genom, Rockville, MD 20850 USA},
language = {English},
read = {Yes},
rating = {0},
date-added = {2012-03-02T23:35:05GMT},
date-modified = {2015-07-28T15:38:34GMT},
abstract = {The fly Drosophila melanogaster is one of the most intensively studied organisms in biology...},
url = {http://www.sciencemag.org/content/287/5461/2185.short}
}
}

Not sure what I'm doing wrong here. I'm using Rstudio 0.99.473 which is calling pandoc 1.13.1 and pandoc-citeproc 0.5. SessionInfo at the end. I hope that is all the necessary information!

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8    LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] htmltools_0.2.6 tools_3.2.2     yaml_2.1.13     rmarkdown_0.8   digest_0.6.8   

原文:https://stackoverflow.com/questions/32357593
更新时间:2024-04-24 07:04

最满意答案

您可以检查主班中的碰撞

var player:Player;

var walls:Array;

function checkCollistion():void
{

     for each (var wall:YourWallClass in walls)
     {
         //here is the simplest wall to do check hitTestObject
         //you can optimize it
         if (player.hitTestObject(wall)
         {

         }

     }
}

或者您可以在播放器类中保留墙参考。 所以当你创建一个playe实例时,在主类中定义了wall。

 public class Player 
 {

     private var walls:Array;

     public function Player($walls:Array)
     {
          walls = $walls;
     }
 }

You may check collision in your main class

var player:Player;

var walls:Array;

function checkCollistion():void
{

     for each (var wall:YourWallClass in walls)
     {
         //here is the simplest wall to do check hitTestObject
         //you can optimize it
         if (player.hitTestObject(wall)
         {

         }

     }
}

Or you could keep a walls reference in your player class. So when you create a playe instance with the walls define in the main class.

 public class Player 
 {

     private var walls:Array;

     public function Player($walls:Array)
     {
          walls = $walls;
     }
 }

相关问答

更多
  • 也许你的问题来自于你正在测试地图中只有一个对象的碰撞。 尝试使用循环: package as3 { public class wl_CollisionDetection { private var tChar:wl_Character; private var tMap:wl_MapBuilder; public function wl_CollisionDetection(xChar:wl_Character,xMap:wl_MapBuilder) { t ...
  • 我想出了如何做到这一点。 如果您有兴趣,可以在raphaelhennessy.com/misc/LightStage.zip上找到代码 I figured out how to do this. If you are interested you can find the code at raphaelhennessy.com/misc/LightStage.zip
  • 您的问题是您使用size变量来确定以下循环的迭代次数。 size初始化为bullCount.size() ,但是如果从bullCount删除一个元素,那么该列表的大小会变小,并且循环会抛出IndexOutOfBoundException : for (int i = 0; i < size; i++) { if(bullCount.get(i).getBounds().intersects(enemy.get(0).getBounds())) { enemy.remove(0); ...
  • 设置最大距离,然后在更新位置之前检查距离 function update(e:Event) { //Point fish at main fish var dx = MovieClip(parent).mainfish01.x - x; var dy = MovieClip(parent).mainfish01.y - y; var angle = Math.atan2(dy,dx) / Math.PI * 180; ...
  • 我认为这是合理的。 你有简单的形状,并进行简单的碰撞检查。 想象一下更具图形性的游戏。 即使这样,他们可能会为角色设置复杂的骨架网格物体,但只需对易于计算的边界形状进行碰撞检查,他们可能会同时进行500多件事情。 在更复杂的游戏引擎中,不同类型可能阻止某些类型而不阻止其他类型,因此不仅要检查简单重叠事件,还必须知道重叠对象是否应该交互。 或者对于不同的对象可能存在不同的交互。 对于游戏,总的来说你的瓶颈是渲染和相关的计算,所以除非你知道你有使用游戏逻辑(复杂的路径查找或AI或类似的东西)做一些非常缓慢的事情 ...
  • 问题是,对于两体碰撞,能量和动量守恒基本上足以确定结果,但对于三体问题,情况已不再是这样。 即使你做了Mark和Daren的建议,并且在一个时间步中确定了所有碰撞的物体,但它并没有真正让你感觉到任何地方,因为1)碰撞后你仍然不知道如何移动物体; 2)在每次碰撞期间需要考虑多少个对象的主要问题不是时间步骤,而是对象的变形,如果正确处理这个对象,时间步长内的更新顺序就不重要了。 例如,如果你有非常柔软的物体,他们可能会接触很多时间步长,而非常坚硬的物体只有几个时间步长。 这个问题的一个很好的答案有点棘手,其原因 ...
  • 您可以检查主班中的碰撞 var player:Player; var walls:Array; function checkCollistion():void { for each (var wall:YourWallClass in walls) { //here is the simplest wall to do check hitTestObject //you can optimize it if (player.hi ...
  • 它始终是相同的单词,因为您只在程序开头设置了randomIndex一次。 一个简单的解决方法是在发生冲突时更新该值: if (cell.hitTestObject(island)) { ... randomIndex = Math.floor(Math.random () * array.length); txtWordDisplay.text = "Killed by" + array [randomIndex]; } It's always the same word bec ...
  • 我认为你应该使用mouseEvent,而不是键盘事件。 你怎么用键盘拖动? balkje.addEventListener(MouseEvent.MOUSE_DOWN, drag); balkje.addEventListener(MouseEvent.MOUSE_UP, drop); function drag(e:MouseEvent):void { e.target.startDrag(); } function drop(e:MouseEvent):void { e.target ...
  • 根据精度水平,你的剑可以用两条线表示,你只需要找到它们是否交叉。 这可能会为你做到这一点。 http://keith-hair.net/blog/2008/08/04/find-intersection-point-of-two-lines-in-as3/ Depending on the level of accuracy, your swords could be represented by two lines and you just need to find if they cross. this ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)