当在VS代码上以PDF为PDF时,如何更改字体大小? (Markdown PDF -yzane)

发布于 2025-02-11 02:06:16 字数 95 浏览 2 评论 0原文

我已经使用了将近2个月的Markdown PDF扩展名,并且是它的忠实拥护者,但我觉得默认字体大小有点大,我想编辑它。我之前没有使用任何扩展程序的默认设置,所以不知道该怎么办。

I have been using the Markdown PDF extension for almost 2 months now and been a big fan of it but I feel like the default font size is a bit big and I would like to edit that. I haven't played around with the default settings of any extension before so have no idea what to do.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

残花月 2025-02-18 02:06:16

您可以添加CSS文件以更改生成器的样式。

首先,创建一个CSS文件,

您需要创建CSS文件。例如,在项目的根源上: markdown.css

我使用的内容:

p, li, ul, code {
    font-size: 12px;
    line-height:150%;
}

然后,在文件 .vscode/settings.json 中更新vscode项目的设置

,添加行:

"markdown-pdf.styles": [
    "markdown.css"
]

如果 settings.json 的文件丢失了,您需要创建它并且不要忘记卷曲括号:

{
    "markdown-pdf.styles": [
       "markdown.css"
    ] 
}

进一步

markdown-pdf.styles 是插件解释的选项(现有选项的列表)。您可以使用选项 markdown-pdf.includedeDefaultStyles 设置为 false

而且,如果您想将CSS文件调整为您的需求,请使用命令将其作为HTML文件生成:“ markdown PDF:export(html)”。然后,您可以检查HTML标签。

You can add css files to change the style for the generator.

First, create a css file

You need to create the css file. For example, at the root of the project: markdown.css.

The content I use:

p, li, ul, code {
    font-size: 12px;
    line-height:150%;
}

Then, update the vscode project's settings

In the file .vscode/settings.json, add the lines:

"markdown-pdf.styles": [
    "markdown.css"
]

If the settings.json's file is missing, you need to create it and do not forget the curly brackets :

{
    "markdown-pdf.styles": [
       "markdown.css"
    ] 
}

To go further

markdown-pdf.styles is an option interpreted by the plugin (the list of the existing options). You can remove the default style with the option markdown-pdf.includeDefaultStyles set to false.

And if you want to adapt the css file to your needs, generate the markdown as an html file with the command: "Markdown PDF: Export (html)". And then, you can check the HTML tags.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文