Ann's Blog!

Where I talk about everything
random


Typora Margins

#Notes

A “quick” guide on how to change the margins for Typora

Hello! It's been a while xD I've been busy with school work for the past couple months and as such sort of put everything else on hold :( Anyhow! Typora! If you use markdown editors like I do for everything from notes to lab reports, then you've probably heard of Typora. It's such the convenient markdown editor. You can use latex in it for math equations and it automatically renders everything (my favorite thing about it xD). You can also see how many words you’ve typed, create tables, export it as a pdf or word document (plus a lot more), and best of all paste snips directly into Typora without having to save those images someplace on your computer. (Sooo convenient)

There are some downsides to Typora though. For one it’s definitely not collaborative. So if you wanted to use markdown with someone else then this is not the app for you. Another thing is that it’s an app, so if you wanted to access everything from online... well you can’t. For me that’s fine, great really because I like how quick it is to make a document + it doesn’t depend on internet connect (a concern of mine during the winter quarter).

However, the one thing that I really found so dreadfully annoying about Typora was the margins when you exported your files as a pdf. It was always so frustrating how the top and bottom margins were so small. Half the time if I was really picky about formatting I'd have to export my markdown file to Word and then add in the page breaks, but that would always mess up the look.

I know it’s a quick fix, but I finally got around to looking into how to add page breaks as well as how to fix the margins when you print the file. Anyhow! It's really simple. All you have to do is go to your favorite theme and make a couple edits to the css file. It's not going to do much, unless you really like using <hr> tags... In which case my condolences, this might not be the solution for you xD.

The <hr> tags are going to have to say bye bye. That’s because this solution makes use of them as page breaks. So if you know you want a page break at a specific place, you can use <hr>. It’s super convenient!!

I also changed the top and bottom margins of the page on print to be about 1 inch (25mm). It’s so nice now. I can look at my pdf’s and it doesn’t feel like something is off about it. Anyways, just stick this someplace in the css of your favorite theme and it should fix the printing issues unless of course you have something that’s a lot more serious than what this fixes xD

@media print, (overflow-block: paged) or (overflow-block: optional-paged) { hr { page-break-after: always; /* CSS 2 */ break-after: region; /* CSS 3+ */ /* minimal layout disruption: */ height: 0.1mm; visibility: hidden; } @page { margin-top: 25mm; margin-bottom: 25mm; } }