【问题标题】:How to break a line in Slidify如何在 Slidify 中换行
【发布时间】:2017-08-13 19:45:13
【问题描述】:

我正在使用 Slidify 创建幻灯片。我的标题太长,所以我想换行
。但是,我尝试了管道符号,它没有从“and”中断开线。它在 HTML 输出中显示了 /The Relationship between Motivation/and Learning Strategies on the 2012 PISA Math。

   ---
    title: |
        | The Relationship between Motivation 
        | and Learning Strategies on the 2012 PISA Math 
    subtitle    : LCA
    author      : Ali
    job         : Student 
    framework   : io2012        # {io2012, html5slides, shower, dzslides, ...}
    highlighter : highlight.js  # {highlight.js, prettify, highlight}
    hitheme     : tomorrow      # 
    widgets     : []            # {mathjax, quiz, bootstrap}
    mode        : selfcontained # {standalone, draft}
    knit        : slidify::knit2slides
    ---

【问题讨论】:

    标签: markdown slidify


    【解决方案1】:

    问题在于 YAML 标头被解析为 HTML,这样做会清除所有特殊字符。您还将“多行 YAML”(管道符号)误认为“多行标题”(输出)。

    管道符号将允许多行 YAML,因为您可以将一个 YAML 写在多行上。比较:

    title: |
      The Relationship between Motivation  
      and Learning Strategies on the 2012 PISA Math
    

    title: The Relationship between Motivation and Learning Strategies on the 2012 PISA Math
    

    如果检查生成的 HTML,前者在源代码中有多行,但没有特定的 <br/ > 标记,则不会有换行符。

    我玩过很多换行符,但我还没有找到阻止 pandoc 清理任何特殊字符的方法。你需要像 LaTeX 中的 \protect{} 命令(这是你的问题,但解决了 LaTeX:In Pandoc, how do I add a newline between authors through the YAML metablock without modifying the template?

    您最好/最简单的办法是打开 HTML 源代码并在一切完成后手动添加 <br/ > 标签。在文件中搜索<h1>The Relationship ...</h1>标签:(

    【讨论】:

      猜你喜欢
      • 2013-07-11
      • 2013-09-19
      • 1970-01-01
      • 2013-05-30
      • 1970-01-01
      • 2014-07-08
      • 1970-01-01
      • 2014-04-29
      • 2013-08-25
      相关资源
      最近更新 更多