在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.
这让我看到以下页面:
查看
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.1
和pandoc-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:
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 oftest.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 callingpandoc 1.13.1
andpandoc-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
最满意答案
您可以检查主班中的碰撞
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
-
对象碰撞问题(Object Collision Issues)[2022-03-12]
您的问题是您使用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); ... -
AS3:避免碰撞(AS3: Avoid collision)[2023-03-15]
设置最大距离,然后在更新位置之前检查距离 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; ... -
水平物体碰撞(Level object collision)[2023-11-09]
我认为这是合理的。 你有简单的形状,并进行简单的碰撞检查。 想象一下更具图形性的游戏。 即使这样,他们可能会为角色设置复杂的骨架网格物体,但只需对易于计算的边界形状进行碰撞检查,他们可能会同时进行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 ...