在 rmarkdown 中将文本强制为两列时,项目符号重复数字 [英] Bullets repeat numbers when forcing text to two columns in rmarkdown

查看:50
本文介绍了在 rmarkdown 中将文本强制为两列时,项目符号重复数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过以下方式在我的幻灯片中获取两列文本:

1. 螺纹耦合器 (TC)2. 带头杆耦合器 (HBC)3. 杆夹(型锻)耦合器 (BSC)

<div style="float: right;宽度:60%;"4. 剪切螺钉耦合器 (SSC)5. 灌浆套筒耦合器 (GSC)

但我得到的结果是:

解决方案

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Columns 似乎是您所需要的:

<块引用>

CSS Multi-column Layout 是一个 CSS 模块,增加了对多列布局的支持.支持确定布局中的列数,以及内容应如何在列之间流动、列之间的间隙大小以及列分隔线(称为列规则)及其外观.

示例

ol {列数:2;}

    <li>项目</li><li>项目</li><li>项目</li><li>项目</li><li>项目</li>

您可以缩小它并将列设置为项目的最大宽度:

ol {列数:2;宽度:最大内容;列距:2em;边框:实心;}李{框阴影:0 0 0 1px;}

    <li>项目更长</li><li>项目</li><li>项目</li><li>项目</li><li>项目</li>

I am trying to get two columns of text in my slide in isolides by:

<div style="float: left; width: 40%;">
1.    Threaded couplers (TC)
2.    Headed bar couplers (HBC)
3.    Bar-grip (swaged) couplers (BSC)
</div>

<div style="float: right; width: 60%;">
4.    Shear screw couplers (SSC)
5.    Grouted sleeve couplers (GSC)
</div>

But the results I get is:

解决方案

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Columns seems to be what you need:

CSS Multi-column Layout is a module of CSS that adds support for multi-column layouts. Support is included for establishing the number of columns in a layout, as well as how content should flow from column to column, gap sizes between columns, and column dividing lines (known as column rules) along with their appearance.

example

ol {
  column-count: 2;
}

<ol>
  <li>item</li>
  <li>item</li>
  <li>item</li>
  <li>item</li>
  <li>item</li>
</ol>

You can shrink it and set columns to max-width of an item:

ol {
  column-count: 2;
  width: max-content;
  column-gap: 2em;
  border: solid;
}

li {
  box-shadow: 0 0 0 1px;
}

<ol>
  <li>item longer</li>
  <li>item</li>
  <li>item</li>
  <li>item</li>
  <li>item</li>
</ol>

这篇关于在 rmarkdown 中将文本强制为两列时,项目符号重复数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆