bookdown从右到左的方向

huangapple go评论62阅读模式
英文:

bookdown righ to left direction

问题

最近我开始使用R包bookdown写一本书。由于我想写一本波斯语书籍(从右到左的方向),我希望改变书籍的文本方向,但我找不到方法来实现这一点,因此如果有人面临类似问题并找到解决方法,我将很高兴与我分享。

您可以在bookdown演示项目中进行配置。

英文:

Recently I started to write a book with R package bookdown. As I want to write a Persian book (Right to left Direction), I want to change the text direction of book, but I can't find a way to do that, so if anyone faced with similar problem and solve it in any way, I will be happy to share it with me.

You can config with the bookdown demo project.

答案1

得分: 1

在你的项目中有一个名为 "style.css" 的文件,在渲染你的项目后,使用浏览器中的检查元素工具,找到适用于你的 ".html" 文件的正确属性,这很简单。如果你使用了 bs4 书籍,这可能会对你有所帮助:

.row{
  flex-direction: row-reverse;
}
header{
  direction: rtl;
  text-align: right;
}
main{
  direction: rtl;
  text-align: right;
}
nav{
  direction: rtl;
  text-align: right;
}
pre{
  direction: ltr !important;
  text-align: left !important;
}
英文:

there's a style.css in your project, render your project then use inspect element in browser, and find right properties for your .html files, it's simple. if you use bs4 book this may help you:

.row{
  flex-direction: row-reverse;
}
header{
  direction: rtl;
  text-align: right;
}
main{
  direction: rtl;
  text-align: right;
}
nav{
  direction: rtl;
  text-align: right;
}
pre{
  direction: ltr !important;
  text-align: left !important;
}

huangapple
  • 本文由 发表于 2023年3月1日 13:10:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/75599794.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定