Hello All,
As part of my system I INDEX my Obsidian Vault. The Font size on the markdown preview is small and I dont see an easy way to increase it - Is there a way ?
Hello All,
As part of my system I INDEX my Obsidian Vault. The Font size on the markdown preview is small and I dont see an easy way to increase it - Is there a way ?
Use a CSS that does what you need.
See the note in the Documents > Markdown Documents section of the built-in Help and manual…
Awesome, Thanks and thanks @chrillek - but I still need to learn CSS ![]()
I went with this option and it worked
Although I understand I can change the display style using CSS, I do believe that the default viewing size has a problem:
I have the following simple example document:
As you can see the source is well readable and that the rendered preview is not.
I tried increasing the font size using the above mentioned font size of the Rich Text & Note Font with no effect.
Changing the Markdown Font increases the size of the source editor.
For completeness, this is the view I get when setting both fonts to size 36:
For clarity, I do not have a stylesheet enabled:
Of course, as the rendering of MD is determined only by CSS. RTF and Note has nothing to do with that.
Of course, as the rendering of MD is determined only by CSS. The MD font has nothing to do with that.
If you want to influence the appearance of the rendered MD (which is HTML), you must do it in CSS.
More information here:
You are missing the point. Bluefrog stated that this font was used by preview if no CSS is applied which is the case.
Again, all I’m saying is that without CSS the default preview size is tiny. I would prefer to see something that is readable by default. The default is currently unreadable which I believe is a bug.
AFAIK, DT always applies a default CSS. Easy to see:
Convert your MD to HTML in DT and take a look at the HTML in source view. Here’s what I see (without any CSS defined on my side):
<style><!--
body { margin:1.5em calc(max(1.5em,(100vw - 59.3em)/2)); color:hsl(0, 0%, 18%); background-color: #fff; font-family: Helvetica, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.3; }
This is, of course, not a nice style since it uses a font size in pixels instead of something relative like 1em. But the point is that I can change the Rich Text & Note font which ever way I want without influencing the rendered MD document. @BLUEFROG? Perhaps the global preference is meant to work as described, but it doesn’t do so here (DT 4.1.1).
So, you do not really have an alternative to specifying your own CSS. Which is, IMO, a good thing, because the default is apparently not suited to all screens and eyes. Already setting font-size: 1em; for the body element makes the p elements easier to read.
And this is the reason of my post. I started by stating that I see a problem with the default viewing size and I know how I can change it myself using CSS, but I would prefer that the default viewing size would be more reasonable.
Switch to View > Document Display > Preview, then use View > Zoom > Actual Size. Does this fix the issue? If not, then the source view might be zoomed. Switch to View > Document Display > Source and again use View > Zoom > Actual Size
I think that this is technically difficult to realize. The rendered MD must use some kind of CSS, even if the user doesn’t define one. This CSS exists somewhere in DT (I didn’t find it) and would have to be rewritten depending on your preferences. So, one would first have to check if the user defined any CSS themself (which they can do with a style element, using css: at the top of the MD, with a user-defined style sheet in the preferences, and then possibly as a style for single elements). An algorithm would have to check all that before rendering the MD and possibly verify that they set a font-size, only replacing that in the default stylesheet. I would not want to write that (nor would I want to wait for the MD file to be rendered while all that is being verified).
And the font size is only one aspect. The font itself is another one (and its value in the preferences is ignored as well), as are line spacing, margins, colors, table formatting, etc. Some of those are defined in the default style sheet; some are not. Or perhaps not in the way a user wants them to be.
Therefore, the most flexible way is to define a stylesheet setting everything to the preferred values.
Having said all that, 13px as a font size (and any font size in pixels) is not what one should put in a style sheet. Relative dimensions are good, absolute ones are not.
The issue here is that the documentation states a behavior that I do not see in DT 4: no aspect of the font specified for RTF and Formatted Notes is reflected by the rendered MD, even if I do not specify my own style sheet.
The default style sheet should not set a bogus font size like 13px but rather something like 1em or xxvh or whatever relative units might be appropriate. WKWebViewConfiguration’s preferences property allows specifying a minimum font size, which could be taken from DT’s preferences. Then, 1rem should automagically be the same as this font size. If Apple does everything right, that is.
There’s a dedicated Markdown font since version 4 which is used by the internal, dynamic default stylesheet. Without a custom style sheet both the source and preview should be quite similar without zooming.
Indeed, that does what it says it does. And the manual for version 4 correctly explains the role of these presets.
This fixes my problem!!! Thanks.
I used a pinch on my trackpad to correct the zoom to make it visible before. Apparently that pinch is temporarily where the “zoom in” and “zoom out” are sticky. Perhaps you should consider to make a pinch sticky as well.
Anyway this resolves my problem.
Glad to hear that this fixed the issue.