You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

org-mode导出reveal.js演示文稿时列表动画排版异常求助

Fixing Misaligned List Items When Using Per-Item #+ATTR_REVEAL in Org-Mode + Reveal.js

I've run into this exact quirk before—org-mode's reveal.js export can get finicky when you apply fragment attributes to individual list items instead of the whole list. Here's how to fix that messy line-wrap issue:

1. Double-Check Your Org Syntax Indentation

The most common culprit is incorrect spacing between the #+ATTR_REVEAL block and your list item content. The attribute block needs to be directly attached to the list item, and the item text must be indented under the attribute. Use this structure:

* Topic
- #+ATTR_REVEAL: :frag appear
  Item 1
- #+ATTR_REVEAL: :frag roll-in
  Item 2
- #+ATTR_REVEAL: :frag grow
  Item 3

Without that indent on the item text, the export parser can confuse the attribute block as part of the previous item's content, leading to merged list items in the final HTML.

2. Bypass Org's Attribute Parser (If Needed)

If the indent trick doesn't work, you can directly inject reveal.js's fragment classes into your list items using raw HTML. This skips any potential parsing weirdness:

* Topic
- <span class="fragment appear">Item 1</span>
- <span class="fragment roll-in">Item 2</span>
- <span class="fragment grow">Item 3</span>

This guarantees each list item gets its own fragment wrapper, keeping the layout clean and aligned.

Why This Happens

When you apply #+ATTR_REVEAL to individual list items, org-mode's export engine sometimes fails to properly associate the attribute with its list item. Instead, it treats the next list item as part of the previous one's content, resulting in that jumbled "Item 2 and 3 on the same line" mess. Proper indentation signals to the parser that each attribute belongs to its own list entry, generating the correct nested HTML structure reveal.js expects.

内容的提问来源于stack exchange,提问作者muteaudio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:19:12