英文:
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;
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论