index.html (9712B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script><title>Guide to Markdown with Pandoc – Fedor_Vinogradov</title> 5 <meta name="description" content="SoruceHut"> 6 7 <meta name="viewport" content="width=device-width, initial-scale=1"> 8 <meta charset="UTF-8"/> 9 10 11 12 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" /> 13 14 15 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.9.4/css/academicons.min.css" integrity="sha512-IW0nhlW5MgNydsXJO40En2EoCkTTjZhI3yuODrZIc8cQ4h1XcF53PsqDHa09NqnkXuIe0Oiyyj171BqZFwISBw==" crossorigin="anonymous" referrerpolicy="no-referrer" /> 16 17 18 <link rel="stylesheet" href="http://localhost:1313/css/palettes/nord-dark.css"> 19 <link rel="stylesheet" href="http://localhost:1313/css/risotto.css"> 20 <link rel="stylesheet" href="http://localhost:1313/css/custom.css"> 21 22 23 24 25 26 27 28 29 30 31 </head> 32 33 <body> 34 <div class="page"> 35 36 <header class="page__header"><nav class="page__nav main-nav"> 37 <ul> 38 <li class="nomarker"><h1 class="page__logo"><a href="http://localhost:1313/" class="page__logo-inner">Fedor_Vinogradov</a></h1></li> 39 40 41 <li class="main-nav__item"><a class="nav-main-item" href="http://localhost:1313/about/" title="">About</a></li> 42 43 <li class="main-nav__item"><a class="nav-main-item" href="http://localhost:1313/posts/" title="">Posts</a></li> 44 45 </ul> 46 </nav> 47 48 </header> 49 50 <section class="page__body"> 51 <header class="content__header"> 52 <h1>Guide to Markdown with Pandoc</h1> 53 </header> 54 <div class="content__body"> 55 <p>In this post I will describe my setup that I use to write papers and make presentations. My approach to these are quite unique, but simple. The main idea is to use Neo Vim to write the text, and then quickly have a fully formatted PDF document or a presentation.</p> 56 <p>TODO: Add a picture of test.pdf 57 <img src="../../assets/pdfDocumentExample.png" alt="demonstration of a compiled file">{width=50%}</p> 58 <p>Above you can see and example of a markdown document after I compile it with Pandoc.</p> 59 <h2 id="tools-that-i-use">Tools That I Use.</h2> 60 <ul> 61 <li><strong>Nvim</strong>: my text edit or choice</li> 62 <li><strong>Pandoc</strong>: Markdown to PDF converter</li> 63 <li><strong>Zathura</strong>: minimalistic PDF viewer</li> 64 </ul> 65 <h2 id="writing-notes">Writing notes</h2> 66 <h3 id="nvim-setup">Nvim setup</h3> 67 <p>While I will briefly go over some of my nvim extensions, they are not the main focus of this post since they are not crucial for my setup but do make the whole process smoother.</p> 68 <ul> 69 <li><strong>toggleterm</strong>: A popup terminal for nvim, Really handy to run a custom pandoc command without exiting nvim.</li> 70 <li><strong>neo-tree</strong>: I dont use it as often, but it often comes in handy when I need to quickly see the file layout or to grap the name of a picture.</li> 71 <li><strong>marksman</strong>: Markdown lsp server of choice.</li> 72 </ul> 73 <h4 id="shortcuts">Shortcuts</h4> 74 <p>I have a viewer shortcut. All it does is open the PDF file with the same name as the markdown file but wihtout the “.” at the start.</p> 75 <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-vim" data-lang="vim"><span style="display:flex;"><span><span style="color:#a6e22e">zathura</span> %:<span style="color:#a6e22e">r</span>:<span style="color:#a6e22e">s</span><span style="color:#e6db74">/^./</span>/.<span style="color:#a6e22e">pdf</span><<span style="color:#a6e22e">CR</span>> 76 </span></span></code></pre></div><p>The main part of my Nvim setup is the shortcut that compules my markdown file into a PDF. The shortcut simply trigers the follwing bash command:</p> 77 <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-vim" data-lang="vim"><span style="display:flex;"><span><span style="color:#a6e22e">pandoc</span> -<span style="color:#a6e22e">H</span> ~<span style="color:#e6db74">/.config/</span><span style="color:#a6e22e">nix</span><span style="color:#e6db74">/home-manager/</span><span style="color:#a6e22e">modules</span><span style="color:#e6db74">/nixvim/</span><span style="color:#a6e22e">header</span>.<span style="color:#a6e22e">tex</span> --<span style="color:#a6e22e">pdf</span>-<span style="color:#a6e22e">engine</span>=<span style="color:#a6e22e">xelatex</span> -<span style="color:#a6e22e">o</span> %:<span style="color:#a6e22e">r</span>:<span style="color:#a6e22e">s</span><span style="color:#e6db74">/^./</span>/.<span style="color:#a6e22e">pdf</span> %:<span style="color:#a6e22e">r</span>.<span style="color:#a6e22e">md</span><<span style="color:#a6e22e">CR</span>> 78 </span></span></code></pre></div><p>Every markdown file that i plan to compile with pandoc, is always a hidden file. this allows the directory to look cleaner when you open it, and still keep the ability to edit the md files.</p> 79 <ul> 80 <li> 81 <p><code>--pdf-engine=xelatex</code> –> Is the engine that pandoc uses to compile the PDF.</p> 82 </li> 83 <li> 84 <p><code>-o %:r:s/^.//.pdf %:r.md</code> –> This is the output file, and the input file. The output file is the same as the input file, but with the first character removed. This is done to remove the hidden character ( . ) from the file name.</p> 85 </li> 86 <li> 87 <p><code>-H ~/.config/nix/home-manager/modules/nixvim/header.tex</code> –> Is a reference to a custom header file that I use to style my PDFs.</p> 88 </li> 89 </ul> 90 <h3 id="headertex-file">header.tex file</h3> 91 <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-latex" data-lang="latex"><span style="display:flex;"><span> <span style="color:#66d9ef">\usepackage</span>{fontspec} 92 </span></span><span style="display:flex;"><span> <span style="color:#66d9ef">\setmainfont</span>{Atkinson Hyperlegible} 93 </span></span><span style="display:flex;"><span> 94 </span></span><span style="display:flex;"><span> <span style="color:#66d9ef">\usepackage</span><span style="color:#a6e22e">[left=2cm,right=2cm]</span>{geometry} 95 </span></span><span style="display:flex;"><span> 96 </span></span><span style="display:flex;"><span> 97 </span></span><span style="display:flex;"><span> <span style="color:#66d9ef">\usepackage</span>{xcolor} 98 </span></span><span style="display:flex;"><span> 99 </span></span><span style="display:flex;"><span> <span style="color:#66d9ef">\definecolor</span>{linequote}{RGB}{245,245,245} <span style="color:#75715e">% Very light gray 100 </span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span> <span style="color:#66d9ef">\definecolor</span>{backquote}{RGB}{245,245,245} <span style="color:#75715e">% Very light gray 101 </span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span> <span style="color:#66d9ef">\definecolor</span>{bordercolor}{RGB}{220,220,220} <span style="color:#75715e">% Light gray 102 </span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span> 103 </span></span><span style="display:flex;"><span> <span style="color:#66d9ef">\usepackage</span>{mdframed} 104 </span></span><span style="display:flex;"><span> <span style="color:#66d9ef">\surroundwithmdframed</span><span style="color:#a6e22e">[linecolor=linequote,backgroundcolor=backquote,linewidth=2pt]</span>{quote} 105 </span></span></code></pre></div><p>This is the header file that I use to style my PDFs. <code>\setmainfont{Atkinson Hyperlegible}</code> is the font that I use for my PDFs. It is a free font that is designed to be easy to read, perfect for long skimming large documents.</p> 106 107 </div> 108 <footer class="content__footer"></footer> 109 110 </section> 111 112 <section class="page__aside"> 113 <div class="aside__about"> 114 <div class="aside__about"> 115 116 117 <h1 class="about__title">My Socials</h1> 118 <p class="about__description">SoruceHut</p> 119 </div> 120 121 122 <ul class="aside__social-links"> 123 124 <li> 125 <a href="" rel="me" aria-label="SourceHut" title="SourceHut"><i class="fa-regular fa-circle" aria-hidden="true"></i></a> 126 </li> 127 128 <li> 129 <a href="" rel="me" aria-label="Matrix" title="Matrix"><i class="fa-regular fa-comment" aria-hidden="true"></i></a> 130 </li> 131 132 <li> 133 <a href="www.linkedin.com/in/fedor-vinogradov-b4454219a" rel="me" aria-label="LinkedIn" title="LinkedIn"><i class="fa-brands fa-linkedin-in" aria-hidden="true"></i></a> 134 </li> 135 136 </ul> 137 </div> 138 <hr> 139 <div class="aside__content"> 140 <p>A guide for how i make all of my documents</p> 141 142 <p> 143 144 2024-11-02 145 </p> 146 147 148 149 150 </div> 151 </section> 152 153 <footer class="page__footer"><p> 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 <br/><span class="active">$ echo $LANG<br/><b>English</b></span><br/> 172 173 174 175 176 177 178 179 </p> 180 <br /><br /> 181 <p class="copyright"></p> 182 <p class="advertisement">Powered by <a href="https://gohugo.io/">hugo</a> and <a href="https://github.com/joeroe/risotto">risotto</a>.</p> 183 </footer> 184 185 </div> 186 </body> 187 188 </html>