<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><link rel="alternate" type="application/rss+xml" href="../rss.xml"/><style data-href="/styles.5590a669c9dba5321619.css" data-identity="gatsby-global-css">@font-face{font-display:fallback;font-family:Inter;font-style:normal;font-weight:400;src:url(https://rsms.me/inter/font-files/Inter-Regular.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-Regular.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:italic;font-weight:400;src:url(https://rsms.me/inter/font-files/Inter-Italic.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-Italic.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:normal;font-weight:600;src:url(https://rsms.me/inter/font-files/Inter-SemiBold.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-SemiBold.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:italic;font-weight:600;src:url(https://rsms.me/inter/font-files/Inter-SemiBoldItalic.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-SemiBoldItalic.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:normal;font-weight:700;src:url(https://rsms.me/inter/font-files/Inter-Bold.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-Bold.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:italic;font-weight:700;src:url(https://rsms.me/inter/font-files/Inter-BoldItalic.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-BoldItalic.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:normal;font-weight:400;src:url(../static/iosevka-regular-16dbe5061e131124a488bc943cab77d9.woff2) format("woff2"),url(../static/iosevka-regular-0a866faad05f5adaf3da07d0c4301ece.woff) format("woff"),url(../static/iosevka-regular-86e16893ae35205fb9cbd194d032d18d.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:italic;font-weight:400;src:url(../static/iosevka-italic-18bb4838493100eaf489d79269d4a8d0.woff2) format("woff2"),url(../static/iosevka-italic-9216409a4bb6480fc8d83a7185265740.woff) format("woff"),url(../static/iosevka-italic-df5bdd869170b93557f517b1d5072089.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:oblique;font-weight:400;src:url(../static/iosevka-oblique-bdc0b8c75ed6d4d80a8473e1b59d3835.woff2) format("woff2"),url(../static/iosevka-oblique-1b4ad417385daab8b6624bd0ee8a5bf8.woff) format("woff"),url(../static/iosevka-oblique-3c4a95b05396b67b453c938e876db665.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:normal;font-weight:700;src:url(../static/iosevka-bold-4bff02e3a4a1c702d93452ecd6c1a13f.woff2) format("woff2"),url(../static/iosevka-bold-043d268c51a9f3dfd2e57ea203fa42b0.woff) format("woff"),url(../static/iosevka-bold-dd88607d7c53d2001828e613350b6a72.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:italic;font-weight:700;src:url(../static/iosevka-bolditalic-1023faa6207623c2ed7294375abbca63.woff2) format("woff2"),url(../static/iosevka-bolditalic-100aa5a08bdea7237e4c0818a41b4c59.woff) format("woff"),url(../static/iosevka-bolditalic-8fce36ec3f40f04e4ddea632ab0f1d87.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:oblique;font-weight:700;src:url(../static/iosevka-boldoblique-ed02bd67300f828e3f1eb9c4e6a611d2.woff2) format("woff2"),url(../static/iosevka-boldoblique-ab212402dc8ff6ba80583ea996578a42.woff) format("woff"),url(../static/iosevka-boldoblique-ef2cf1a2430a178eeb3410e89d657175.ttf) format("truetype")}code[class*=language-],pre[class*=language-]{word-wrap:normal;color:#eceff4;font-family:Iosevka Web,"monospace";-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;white-space:pre;word-break:normal;word-spacing:normal}code[class*=language-]::selection,code[class*=language-] ::selection,pre[class*=language-]::selection,pre[class*=language-] ::selection{background:#3b4252}pre[class*=language-]{border-radius:.3em;margin:.5em 0;overflow:auto;padding:1em}:not(pre)>code[class*=language-]{background:#eceff4;border-radius:3px;color:#2e3440;font-family:Iosevka Web,"monospace";font-size:90%;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;padding:.05em .4em}:not(pre)>code[class*=language-]::selection{background:#c9ecff!important}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#4c566a}.token.punctuation{color:#e5e9f0}.namespace{opacity:.7}.token.boolean{color:#81a1c1}.token.number{color:#b48ead}.token.tag{color:#d8dee9}.token.constant,.token.deleted,.token.property,.token.symbol{color:#88c0d0}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string,.token.url{color:#eceff4}.token.entity{background:#eee8d5;color:#657b83}.token.attr-value,.token.keyword{color:#81a1c1}.token.atrule,.token.class-name,.token.function{color:#8fbcbb}.token.important,.token.regex,.token.variable{color:#81a1c1}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.name{color:#a3be8c}.token.trigger{color:#88c0d0}.token.snippet{color:#81a1c1}.token.tabstop{color:#ebcb8b}.token.flags,.token.inline{color:#b48ead}.gatsby-highlight-code-line{background-color:#13151b;border-left:.25em solid #88c0d0;display:block;margin-left:-1em;margin-right:-1em;padding:.1em 1em .1em .75em}</style><meta name="generator" content="Gatsby 4.4.0"/><link rel="preconnect" href="https://www.google-analytics.com"/><link rel="dns-prefetch" href="https://www.google-analytics.com"/><link rel="alternate" type="application/rss+xml" title="Gilles Castel's blog RSS Feed" href="../rss.xml"/><link rel="icon" href="../favicon-32x32.png%3Fv=c9dde36f72d3007a082734fe5feea5e4" type="image/png"/><link rel="manifest" href="../manifest.webmanifest" crossorigin="anonymous"/><meta name="theme-color" content="#2E3440"/><link rel="apple-touch-icon" sizes="48x48" href="../icons/icon-48x48.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="72x72" href="../icons/icon-72x72.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="96x96" href="../icons/icon-96x96.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="144x144" href="../icons/icon-144x144.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="192x192" href="../icons/icon-192x192.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="256x256" href="../icons/icon-256x256.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="384x384" href="../icons/icon-384x384.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="512x512" href="../icons/icon-512x512.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><title data-react-helmet="true">How I draw figures for my mathematical lecture notes using Inkscape | Gilles Castel</title><meta data-react-helmet="true" name="description" content="In my previous blog post, I explained how I take lecture notes using Vim and LaTeX.In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.Some examples First, let me show you some examples of figures…"/><meta data-react-helmet="true" property="og:title" content="How I draw figures for my mathematical lecture notes using Inkscape"/><meta data-react-helmet="true" property="og:description" content="In my previous blog post, I explained how I take lecture notes using Vim and LaTeX.In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.Some examples First, let me show you some examples of figures…"/><meta data-react-helmet="true" property="og:type" content="website"/><meta data-react-helmet="true" name="twitter:card" content="summary"/><meta data-react-helmet="true" name="twitter:creator" content="Gilles Castel"/><meta data-react-helmet="true" name="twitter:title" content="How I draw figures for my mathematical lecture notes using Inkscape"/><meta data-react-helmet="true" name="twitter:description" content="In my previous blog post, I explained how I take lecture notes using Vim and LaTeX.In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.Some examples First, let me show you some examples of figures…"/><style data-styled="" data-styled-version="5.3.3">.NEJsy{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #4C566A;border-top:1px solid #4C566A;padding:1em;font-size:80%;}/*!sc*/data-styled.g1[id="Bio__BioDiv-sc-1xze3le-0"]{content:"NEJsy,"}/*!sc*/.gzyKGq{padding-left:1em;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;}/*!sc*/data-styled.g2[id="Bio__Text-sc-1xze3le-1"]{content:"gzyKGq,"}/*!sc*/.iQePnH{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;border-radius:50%;}/*!sc*/data-styled.g3[id="Bio___StyledImg-sc-1xze3le-2"]{content:"iQePnH,"}/*!sc*/::selection{background:#c9ecff;}/*!sc*/::-moz-selection{background:#c9ecff;}/*!sc*/*{margin:0;padding:0;box-sizing:border-box;}/*!sc*/html,body{font-family:'Inter',sans-serif;text-rendering:optimizeLegibility;line-height:1.4;}/*!sc*/body{background:#ffffff;color:#3a343a;font-size:18px;text-rendering:optimizeLegibility;}/*!sc*/a{outline:none;-webkit-text-decoration:none;text-decoration:none;color:inherit;}/*!sc*/p a,figcaption a{border-bottom:1px solid #4C566A;}/*!sc*/table{margin:0 auto;}/*!sc*/.gatsby-resp-image-link{border-bottom:none;}/*!sc*/h1{font-size:230%;line-height:1.2;margin-bottom:0.2em;}/*!sc*/p{margin-top:1.4rem;margin-bottom:1.4rem;}/*!sc*/blockquote{font-style:italic;border-left:2px solid #2E3440;padding-left:1.4rem;margin-left:-1.4rem;}/*!sc*/li{margin-bottom:0.7rem;padding-left:1.4rem;}/*!sc*/ul,ol{padding-left:1.4rem;}/*!sc*/hr{border-top:none;border-bottom:1px solid black;}/*!sc*/.gatsby-highlight{box-shadow:0px 0px 10px rgba(0,0,0,0.2);font-family:'Iosevka Web','monospace';font-size:90%;background-color:#2e3440;margin:1em 0;padding:1em;overflow:auto;}/*!sc*/.gatsby pre,.gatsby pre code{font-family:'Iosevka Web','monospace';}/*!sc*/.gatsby-highlight pre[class*="language-"]{background-color:transparent;margin:0;padding:0;overflow:initial;float:left;min-width:100%;}/*!sc*/.gatsby-video-aspect-ratio{box-shadow:0px 0px 10px rgba(0,0,0,0.2);margin:1em 0;}/*!sc*/.gatsby-resp-image-wrapper{max-width:none !important;}/*!sc*/img[src$=gif]{background-color:#2E333F;box-shadow:0px 0px 10px rgba(0,0,0,0.2);width:100%;}/*!sc*/img[src$="svg"]{width:100%;}/*!sc*/#disqus_thread{position:relative;}/*!sc*/#disqus_thread::after{content:'';position:absolute;left:0;right:0;bottom:0;height:55px;background:#ffffff;}/*!sc*/kbd{font-size:90%;font-family:'Iosevka Web','monospace';padding:.05em .4em;border-radius:3px;border:1px solid gray;background:#ECEFF4;}/*!sc*/figure figcaption{padding:0.7em 1.4em;font-size:80%;background:#ECEFF4;}/*!sc*/data-styled.g4[id="sc-global-cLNjzj1"]{content:"sc-global-cLNjzj1,"}/*!sc*/.cxeJTm{padding:1em;color:#d8dee9;text-align:center;max-width:648px;margin:0 auto;font-size:80%;}/*!sc*/data-styled.g5[id="Layout__Footer-sc-g3mgjj-0"]{content:"cxeJTm,"}/*!sc*/.fwYusv{min-height:100vh;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}/*!sc*/data-styled.g6[id="Layout___StyledDiv-sc-g3mgjj-1"]{content:"fwYusv,"}/*!sc*/.chpAuY{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}/*!sc*/data-styled.g7[id="Layout___StyledDiv2-sc-g3mgjj-2"]{content:"chpAuY,"}/*!sc*/.kbKLKY{font-size:80%;text-transform:lowercase;font-weight:700;font-variant:small-caps;}/*!sc*/data-styled.g8[id="smallcaps__SmallCaps-sc-17d6b14-0"]{content:"kbKLKY,"}/*!sc*/.hyHJPv{font-size:80%;font-weight:700;}/*!sc*/data-styled.g9[id="smallcaps__FakeSmallCaps-sc-17d6b14-1"]{content:"hyHJPv,"}/*!sc*/.iDNUhN{border-bottom:1px solid #4C566A;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}/*!sc*/.iDNUhN > span,.iDNUhN a{padding:0.5em 0;}/*!sc*/data-styled.g10[id="blog-post__SupTitle-sc-1993m0e-0"]{content:"iDNUhN,"}/*!sc*/.ijGSzm{width:100%;text-align:center;margin:2.8rem 0;}/*!sc*/data-styled.g11[id="blog-post__Title-sc-1993m0e-1"]{content:"ijGSzm,"}/*!sc*/.cFnHMB{max-width:680px;margin:0 auto;padding:1em;}/*!sc*/.cFnHMB .custom-block.snippet .custom-block-body{font-style:italic;}/*!sc*/.cFnHMB h2,.cFnHMB h3,.cFnHMB h4,.cFnHMB h5,.cFnHMB h6{line-height:1.2;margin-bottom:-1rem;}/*!sc*/.cFnHMB h2{margin-top:2em;font-size:1.4rem;}/*!sc*/.cFnHMB h3{margin-top:2rem;font-size:1.2rem;}/*!sc*/.cFnHMB .toc{z-index:10;position:-webkit-sticky;position:sticky;top:2em;font-size:70%;height:0px;}/*!sc*/@media (max-width:1080px){.cFnHMB .toc{display:none;}}/*!sc*/.cFnHMB .toc ul{list-style:none;display:inline-block;width:calc((100vw - 680px) / 2 - 4em);}/*!sc*/.cFnHMB .toc li{padding-left:0;margin-bottom:0.3em;}/*!sc*/.cFnHMB .toc li p{margin:0;margin-bottom:0.5em;}/*!sc*/.cFnHMB .toc a{border-bottom:none;}/*!sc*/.cFnHMB .toc a.is-active{font-weight:bold;}/*!sc*/.cFnHMB .toc > ul{padding-left:0;-webkit-transform:translateX(calc(-100% - 2em)) translateY(4em);-ms-transform:translateX(calc(-100% - 2em)) translateY(4em);transform:translateX(calc(-100% - 2em)) translateY(4em);}/*!sc*/.cFnHMB .toc > ul::before{content:"Table of contents";font-weight:bold;padding-bottom:0.5em;display:inline-block;}/*!sc*/data-styled.g12[id="blog-post__Main-sc-1993m0e-2"]{content:"cFnHMB,"}/*!sc*/.ePTuVc{margin-bottom:2em;}/*!sc*/.ePTuVc ul{margin:0;padding:0;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}/*!sc*/.ePTuVc ul li{margin:0;padding:0;list-style-type:none;}/*!sc*/.ePTuVc ul li a{display:inline-block;padding:0.5em 0;}/*!sc*/.ePTuVc ul li.prev{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}/*!sc*/.ePTuVc ul li.next{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;text-align:right;padding-left:1em;}/*!sc*/data-styled.g13[id="blog-post__Nav-sc-1993m0e-3"]{content:"ePTuVc,"}/*!sc*/</style><link as="script" rel="preload" href="../webpack-runtime-f28b399e0936aecf66ac.js"/><link as="script" rel="preload" href="../framework-ea68fce3d30d105ba963.js"/><link as="script" rel="preload" href="../app-9c07f8581d6a14d0067d.js"/><link as="script" rel="preload" href="../04f12b145687b6350b874aa568443d7ed4a3c726-be6a39a4ebd1487fb52e.js"/><link as="script" rel="preload" href="../component---src-templates-blog-post-js-8cf4b165ff72f56ebc7c.js"/><link as="fetch" rel="preload" href="../page-data/post/lecture-notes-2/page-data.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="../page-data/sq/d/3128451518.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="../page-data/app-data.json" crossorigin="anonymous"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><div class="Layout___StyledDiv-sc-g3mgjj-1 fwYusv"><div class="Layout___StyledDiv2-sc-g3mgjj-2 chpAuY"><div class="blog-post__Main-sc-1993m0e-2 cFnHMB"><div class="smallcaps__SmallCaps-sc-17d6b14-0 blog-post__SupTitle-sc-1993m0e-0 kbKLKY iDNUhN"><a href="../index.html">← All articles</a><span>Apr<!-- --> <span class="smallcaps__FakeSmallCaps-sc-17d6b14-1 hyHJPv">26</span>,<!-- --> <span class="smallcaps__FakeSmallCaps-sc-17d6b14-1 hyHJPv">2019</span> •<!-- --> <span class="smallcaps__FakeSmallCaps-sc-17d6b14-1 hyHJPv">12</span> Min Read</span></div><h1 class="blog-post__Title-sc-1993m0e-1 ijGSzm">How I draw figures for my mathematical lecture notes using Inkscape</h1><div><div class="custom-block snippet"><div class="custom-block-body"><p>In my <a href="lecture-notes-1.html">previous blog</a> post, I explained how I take lecture notes using Vim and LaTeX.In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.</p></div></div><h2 id="some-examples">Some examples</h2><p>First, let me show you some examples of figures I’ve made.They were made for complex analysis, differential geometry, electrodynamics and my bachelors’s thesis on elliptic curves.I drew them during the lecture — except of course those for my thesis — using Inkscape, so let’s start with that.</p><p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/df84ee6b3a0f2016b1aa37a79deab7c0/93772/fig_1.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 56.470588235294116%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAArklEQVQoz42S2wrDMAxD9/8fm0BpXN8zqFhWmrab3mI4tmTn1SflR35Qv9JrLqkqEZlZRIDUXb9hdyciZjYzd89M1NHrCbZdIhIRsH18zsO/cESYGTKrambWWltrCIJGw8gZVtVhzN1FpJTSWkN+WLiFI2Lwmbksy7quvfdSChGpqog8ZYZzOKy1MjOKIrJt22ns9anMDCFxJBFh5nnV1zDyjyUdd/EXPL7XHQb4DQ8+jHi0L7awAAAAAElFTkSuQmCC'); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 1" title="Example 1" src="../static/df84ee6b3a0f2016b1aa37a79deab7c0/a4de1/fig_1.png" srcset="../static/df84ee6b3a0f2016b1aa37a79deab7c0/e3b59/fig_1.png 170w,../static/df84ee6b3a0f2016b1aa37a79deab7c0/d6fe0/fig_1.pngg 340w../static/df84ee6b3a0f2016b1aa37a79deab7c0/a4de1/fig_1.pngng 680../static/df84ee6b3a0f2016b1aa37a79deab7c0/e9ece/fig_1.pngpng 102../static/df84ee6b3a0f2016b1aa37a79deab7c0/93772/fig_1.png.png 1324w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/3eacd85683a5d2cdd10e7f6b2a281d86/689d4/fig_3.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 44.705882352941174%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAIAAAC9o5sfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA0UlEQVQoz5WRy4pEIQxE/f8PvTvxtq+kzMOhbwYZetEwtRCUquSYpP1/ubuZ7b3TF5M9Ou44e++lFGb+Dbv7cQOIF3dfa4mIuwNg5tfrdV1XJCOSImBmIsLMRKSqp+fem4gAqCoz55xrrWutyKfW2hgj7rXW3juAwyIiZqaqY4wgb62VUuac787rkaqKCBEd1Agzs4jEXwD03qPEnPPdOYBVda2FR6p6wjEkAPKolEJEZpZzBpCCLfCI6L7vYPmYfBSNoYbZzNLHAkXk+4b/Xn8AW+ESwjB3fLMAAAAASUVORK5CYII='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 2" title="Example 2" src="../static/3eacd85683a5d2cdd10e7f6b2a281d86/a4de1/fig_3.png" srcset="../static/3eacd85683a5d2cdd10e7f6b2a281d86/e3b59/fig_3.png 170w,../static/3eacd85683a5d2cdd10e7f6b2a281d86/d6fe0/fig_3.pngg 340w../static/3eacd85683a5d2cdd10e7f6b2a281d86/a4de1/fig_3.pngng 680../static/3eacd85683a5d2cdd10e7f6b2a281d86/e9ece/fig_3.pngpng 102../static/3eacd85683a5d2cdd10e7f6b2a281d86/e0c87/fig_3.png.png 13../static/3eacd85683a5d2cdd10e7f6b2a281d86/689d4/fig_3.png3.png 1432w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/8353ffee383e88481e3533874c18a40e/1d9fd/fig_6.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 86.47058823529412%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAIAAABSJhvpAAAACXBIWXMAAAsTAAALEwEAmpwYAAABe0lEQVQ4y42SQYvCMBCF+/9/kCB48aC3QlsrMSQlDVJTqoSGpKTtpOkuhnXdVdd9x5Bv5s2bieYHTdMEAOM4AoD3fhzHvu+ttY8/o1+Yc26aJu99eLHWcs5vhV7C8KWu64wxXdcJITDGCCEp5XTVc9h7H6yWZYkQyvOcECKEUEo1TaO1vrfzpLNzDgCMMefzWUoJAPemrLUvO9+PffsUIgCApmk454wxpVQIL+QXPWYIAMMwjFdprTnneZ4XRYEQOp1Of3W+RTDPszGGc55l2WKx2O/3nPO6rt/DAKCUOhwOGOOiKLbbbZIkQoi2bd/DdV1TSuM4Xq/X5VUBc87dZx79cmuMqapqt9sxxiilSZKEVfV9/+bCtNaMMULIcrnMsqwsy1tCj0v+hgGgbVtKKSEEY5ymKULocrkopebXikLVqqoYY5vNZrVaUUoZY2GTTxv+gMP1I4TSNI3juK5rKaVzbn6nKFzS8XgMnv8e8vnMwzA0Vxlj/kl+wh8FOtQd6yKOMQAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 3" title="Example 3" src="../static/8353ffee383e88481e3533874c18a40e/a4de1/fig_6.png" srcset="../static/8353ffee383e88481e3533874c18a40e/e3b59/fig_6.png 170w,../static/8353ffee383e88481e3533874c18a40e/d6fe0/fig_6.pngg 340w../static/8353ffee383e88481e3533874c18a40e/a4de1/fig_6.pngng 680../static/8353ffee383e88481e3533874c18a40e/e9ece/fig_6.pngpng 102../static/8353ffee383e88481e3533874c18a40e/1d9fd/fig_6.png.png 1251w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/9a7e08c455f98a30e210b3e3a4953fb1/a0367/fig_5.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 46.470588235294116%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAIAAAC9o5sfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAvklEQVQoz42R247DIAxE8/+fmbckCiSVDfhKpVhq2W1U9Txhw3gGmPoPqKq7f/ansRARInqV7m5mvfeUEiLGlHVd53nOOYvI5O61VgAgIrkYTUSEmbdtyzmbmaqWUh4XzDzFvAARAWAUq+pxHCLSew/xfewwaa0BQJxjZlUlotaau8ciAvrFW3yeJyISUSllFJdSiIiZU0r5IoK8ncP29UKBme37viyLiIz9P7HNrNb6uRdXuP2km6/6xxdZiJ+gzRMN2H9cQgAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 4" title="Example 4" src="../static/9a7e08c455f98a30e210b3e3a4953fb1/a4de1/fig_5.png" srcset="../static/9a7e08c455f98a30e210b3e3a4953fb1/e3b59/fig_5.png 170w,../static/9a7e08c455f98a30e210b3e3a4953fb1/d6fe0/fig_5.pngg 340w../static/9a7e08c455f98a30e210b3e3a4953fb1/a4de1/fig_5.pngng 680../static/9a7e08c455f98a30e210b3e3a4953fb1/e9ece/fig_5.pngpng 102../static/9a7e08c455f98a30e210b3e3a4953fb1/e0c87/fig_5.png.png 13../static/9a7e08c455f98a30e210b3e3a4953fb1/a0367/fig_5.png5.png 1414w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/14cd3152abeb915eebabcfa2e3aeac8c/f5eaf/fig_2.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 47.64705882352941%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/0lEQVQoz31R2W4DIQzc///RiLBLhInxCVRZq9sorToPlg+MPeNt/QIiMvNHcp74SG6XZ2ZjjLUWEbn7e9sYI5rHGCJCRL33OecW5bWWqoYjIrVWRIyPwoETRJRSyjnf7/cxxjbnjMLtdusnUkrHcahqUCAiVa21iggiAsBaK3bcmLmUwt8QkbDXzqrq7mHHCTOLHbfeOxExMwBEVk5Ec2st54yI+76rKhHlnIPwq9nM4ikzP5/PkLr3fqno7mamqjHT3S/lX5zdvbVWSkkn9n0vpQTn0NbMAAARIwzxf04lIqUUAIhjAEAMb63VWlX1OI4g+Hg8fia/3/NP/5/wC/XHSVXEF3VOAAAAAElFTkSuQmCC'); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 5" title="Example 5" src="../static/14cd3152abeb915eebabcfa2e3aeac8c/a4de1/fig_2.png" srcset="../static/14cd3152abeb915eebabcfa2e3aeac8c/e3b59/fig_2.png 170w,../static/14cd3152abeb915eebabcfa2e3aeac8c/d6fe0/fig_2.pngg 340w../static/14cd3152abeb915eebabcfa2e3aeac8c/a4de1/fig_2.pngng 680../static/14cd3152abeb915eebabcfa2e3aeac8c/e9ece/fig_2.pngpng 102../static/14cd3152abeb915eebabcfa2e3aeac8c/f5eaf/fig_2.png.png 1212w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p><div class="toc"><ul><li><a href="lecture-notes-2.html#some-examples">Some examples</a></li><li><a href="lecture-notes-2.html#what-is-inkscape">What is Inkscape?</a></li><li><a href="lecture-notes-2.html#why-inkscape">Why Inkscape?</a></li><li><a href="lecture-notes-2.html#including-inkscape-figures-in-a-latex-document">Including Inkscape figures in a LaTeX document</a></li><li><a href="lecture-notes-2.html#creating-and-including-figures-quickly">Creating and including figures quickly</a></li><li><p><a href="lecture-notes-2.html#drawing-figures">Drawing figures</a></p><ul><li><a href="lecture-notes-2.html#drawing-shapes">Drawing shapes</a></li><li><a href="lecture-notes-2.html#key-chords-to-apply-commonly-used-styles">Key chords to apply commonly used styles</a></li><li><a href="lecture-notes-2.html#adding-text">Adding text</a></li><li><a href="lecture-notes-2.html#saving-and-using-less-commonly-used-styles">Saving and using less commonly used styles</a></li><li><a href="lecture-notes-2.html#adding-and-saving-objects">Adding and saving objects</a></li></ul></li><li><a href="lecture-notes-2.html#code">Code</a></li><li><a href="lecture-notes-2.html#conclusion">Conclusion</a></li></ul></div><h2 id="what-is-inkscape">What is Inkscape?</h2><p><a href="https://inkscape.org/" target="_blank" rel="nofollow noopener noreferrer">Inkscape</a> is an open source vector graphics editor, available for all major platforms.It’s a free — but arguably less featureful — alternative to Adobe Illustrator.You can use it for designing flyers and logos like in the picture below,but it’s also a powerful tool for drawing mathematical figures.</p><p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/0da7559609e3a938b43ee18d7ca7d958/ac67c/inkscape.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 58.82352941176471%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAIAAADtbgqsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAClUlEQVQoz0XQTUgUYRgH8KlLhwgKDymSiEGuWRFWftQqWmlhZWBlBrUIBVF0KaUOHoou1ckO5sGQhEUl0I2KDEONNN3Mr/Ijh12/3Z2Pd2bnnZl3Zud731g3tuf+e/7/5yFCISpMgVCYZ1iW5VUgWBDFBBlDFIMoJioxipVoBkSgBKGoyqKKJD2KTA0hWSIAAKZp6bpuOVhebqL8VWF/LRi/HPZX02PX14dr5JBPM7BtmwJEwzOhETLiD4jfFuBkgCMEEWKMYzELYywv3F3v27M26F4dLJ3ylc/31s721knUAN4cVdPmVwAZQmRYHV8WF8MRQhDlTRzDGJNzS++6vvZ9GPN1jX75NPe+53dfLwmAmsCabk4H2R9/mIkAN7sqUhwkJIFPYglp6xscRfMUDWiaDQaXaYZR1X/YdhyOh4DnkYowtiiWIyQYwRg7joMxHhudaqx/1nDv6a1r9dUVN8sLai6Wefo/DyW2W5ZNkgtrYSDrjqzZLC8RAozfbFk2xviO51HqtoOuNPf+9JLs3Sdcqe5dW1wtTW/i2HE0M+b3DwzPUSMBdYiUyQ2ZgKIUr2TH8YPbj4tyzx/LPnt035lDGWV7UwpTtua8bvbGq9mObVuOYydvlBVEAD7yP/nGw8yd+TnpJa604qyUgowdR7YTWS0v2xPJUd2cWuQml6SJRWl6RQ6u8oQgisnkxvvPjx+4UF549VT+ldK86qLcc9mpbm9bd+IppmVzogqgAqDCiYogqoQa1ZL4ScOLk3mXqkrrKos9lSWeisLaw5mnO9p9CezYjqEbhmHqhmWYpmEYBAuAg1CUU1Qdf+z/+aq1s6vjbU9nR3dbu7e1s63ZO/P9l4IsHhmMrFA8LYp0VAhBhmIA9xeFojVoB2KKVAAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Inkscape" title="Inkscape" src="../static/0da7559609e3a938b43ee18d7ca7d958/a4de1/inkscape.png" srcset="../static/0da7559609e3a938b43ee18d7ca7d958/e3b59/inkscape.png 170w,../static/0da7559609e3a938b43ee18d7ca7d958/d6fe0/inkscape.pngg 340w../static/0da7559609e3a938b43ee18d7ca7d958/a4de1/inkscape.pngng 680../static/0da7559609e3a938b43ee18d7ca7d958/e9ece/inkscape.pngpng 102../static/0da7559609e3a938b43ee18d7ca7d958/e0c87/inkscape.png.png 13../static/0da7559609e3a938b43ee18d7ca7d958/ac67c/inkscape.pnge.png 1606w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p><h2 id="why-inkscape">Why Inkscape?</h2><p>The most common solutions for adding figures to LaTeX documents are Ti<em>k</em>Z, PSTricks and Asymptote.These options have one thing in common: they are command based, i.e.you just write some code that specifies how the figure should be drawn.For example, the following Ti<em>k</em>Z code</p><div class="gatsby-highlight" data-language="latex"><pre class="language-latex"><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">tikzpicture</span><span class="token punctuation">}</span> <span class="token function selector">\coordinate</span> (A) at (1, 3); <span class="token function selector">\draw</span><span class="token punctuation">[</span>thick, -><span class="token punctuation">]</span> (0, 0) -- (A); <span class="token function selector">\node</span><span class="token punctuation">[</span>above right<span class="token punctuation">]</span> at (A) <span class="token punctuation">{</span><span class="token equation string">$A = (1, 2)$</span><span class="token punctuation">}</span>;<span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">tikzpicture</span><span class="token punctuation">}</span></code></pre></div><p>gives this figure:</p><p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/4c2942fceb15c07c3e937135c552e754/c228c/tikzexample4.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 38.23529411764706%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAIAAAB2/0i6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAVklEQVQY053PSwrAMAgEUO9/2xiJEj8ptNBVNKWz9qkDK09EqOqcU1W3A1BgZsY7RPTs+orNrLW2yqRYRMYY24Nn3HvPqh6wmSHiOgXqn/9gdy+qvvgC4H7cfUqJjJcAAAAASUVORK5CYII='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="TikZ example" title="TikZ example" src="../static/4c2942fceb15c07c3e937135c552e754/a4de1/tikzexample4.png" srcset="../static/4c2942fceb15c07c3e937135c552e754/e3b59/tikzexample4.png 170w,../static/4c2942fceb15c07c3e937135c552e754/d6fe0/tikzexample4.pngg 340w../static/4c2942fceb15c07c3e937135c552e754/a4de1/tikzexample4.pngng 680../static/4c2942fceb15c07c3e937135c552e754/e9ece/tikzexample4.pngpng 102../static/4c2942fceb15c07c3e937135c552e754/e0c87/tikzexample4.png.png 13../static/4c2942fceb15c07c3e937135c552e754/c228c/tikzexample4.png4.png 1437w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p><p>The benefit of these packages is that drawing a figure is a lot like programming:you can use variables, do calculations, use <code class="language-text">for</code> loops, etc.Furthermore figures blend in nicely in your document because all text is typeset by LaTeX itself.This means that you can typeset math effortlessly, or that if later on, you decide to change the font of your document,all the figures will change automatically to match the new font.</p><p>However, these assets cost you visual feedback and speed.Drawing complex figures is inherently a graphical task and without a graphical interface, it can be extremely time consuming.It’s impossible to click and drag an object to move it, freehand draw a curve or drag the control points of a Bézier curve.This makes Ti<em>k</em>Z a lot harder and slower to use than Inkscape.While I use Ti<em>k</em>Z once in a while for complex figures, I found that in most cases, the benefits of Inkscape far outweigh those of Ti<em>k</em>Z,especially if you’re under time pressure during a lecture.</p><p>With this out of the way, let’s get started.</p><h2 id="including-inkscape-figures-in-a-latex-document">Including Inkscape figures in a LaTeX document</h2><p>Just like Ti<em>k</em>Z, Inkscape has the option to render the text of a figure using LaTeX.For this, it exports figures as both a pdf and a LaTeX file.The pdf document contains the figure with text stripped, and the LaTeX file contains the code needed to place the text at the correct position.For example, suppose you’re working on the following figure in Inkscape:</p><p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/c21062130180ff44b3bca5b48bf35b90/506a7/riemman-inkscape.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 65.29411764705883%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABkUlEQVQoz21SaY/bIBDl//+r7WqralXt8WG3yUZqEwcfEAwYc5hjcGV7403TPCE0DPNGbx6gEldFgRtyOpakrAihrG4oPbWUCS46IVXLJeei5dORcYnL5lgRemJCKlTgWvW9tYMx1hhr3RQ4542xqtdaG62t92G+dcY4IVWvp8r9kSJalT7E8V8AQJoBADFGrTUAXNU0TKCmZcPgL7N+xhLHGLuuU0qtmRVMSFS2wvuwplJKIYSl1ForpSSEGGMWFZdkwgTiNR3OXXPOMX6NkGeklGKMABBCuCQfSopEiwcfL0ddaFcic87e+yW/7Ls9RpzW7ix7JS/xomJttJI/DaMtEozclB1j5Jw7525ONI7jsaQIEzq4Yb7+NGw1RghBKV1G/d+wmnLUUDaR8wiQIY8p5xBDSmHMoLpOcOGHIYYYQoKcp5IMY566FLhGutc3Psm8pmdL6dq6M7TR6Ndmq7Zb/uPw/K6+0fBACixfwT7Cn3u8+6g2H+T77vnpdP9b3R0Ob/jJtI95f1e8/nx52/wFnDXvo4lye5cAAAAASUVORK5CYII='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Riemann's theorem" title="Riemann's theorem" src="../static/c21062130180ff44b3bca5b48bf35b90/a4de1/riemman-inkscape.png" srcset="../static/c21062130180ff44b3bca5b48bf35b90/e3b59/riemman-inkscape.png 170w,../static/c21062130180ff44b3bca5b48bf35b90/d6fe0/riemman-inkscape.pngg 340w../static/c21062130180ff44b3bca5b48bf35b90/a4de1/riemman-inkscape.pngng 680../static/c21062130180ff44b3bca5b48bf35b90/e9ece/riemman-inkscape.pngpng 102../static/c21062130180ff44b3bca5b48bf35b90/506a7/riemman-inkscape.png.png 1110w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p><p>To include this figure in a LaTeX document, you’d go to File › Save As, select ‘pdf’ as the extension and then press Save which makesthe following dialog pop up:</p><div style="width:100%;max-width:422px; position: relative; margin: 0 auto; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1)"> <span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 422px; "> <a class="gatsby-resp-image-link" href="../static/1f4576e71da68bcf723d4b75a264dd8b/8843a/saveas.png" style="display: block" target="_blank" rel="noopener"> <span class="gatsby-resp-image-background-image" style="padding-bottom: 81.17647058823529%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAIAAACZeshMAAAACXBIWXMAAAsTAAALEwEAmpwYAAACTElEQVQoz3VTh6rbQBDU//9eQvKebUnXe1G7KtkOJ6URCAzLMBzandlVZ50XUhvntLFKW+u8lNpPi/OTddO6hVL3XOo/SKmsIXWU8gEgxiUhDGLKhQQQa+ukMkKpZd2O56vute573Y/fyKWuW+yEVAjTfgAjRADiez/4aZ2XbQBwAGgECBEWUg4xrVtct3DWhhBjt4VLCsuv2t4tC4BohHiECCJCKB9HYP1c6p5yybmkhtzllEopKddLqrWouXyFM4TgMcARtua3e98PI8QEYUooB4iMEEmlO2ojEJNSikstleZCIqq+PajW2k+z85Of5osY57VpiRrrjPN+mrs7W7+MmhIMEKGUAUQ455RQY33KJcQc04USz9EunnKNKXdKCEIoIkxIxYUilI0AjwBhTD7vg7Wm1BpzvkyWuitl/DS/3+9lCx3j4vMxAIj6VjAm9HeEMYQb27BwUkomJD+htMWtkzbWd/OyauNs8+Ocaw7juZgtppwT1KkHbATgdu9v934A4ON2//5xewwj46pb225iaxPTFtLVdgtNWUOstTg/Cako40woyiUmzDiv2jm6jjL+GEAbe4SEMgCxsb7+Osl4JtQMn46VahG83+/j+dpC7Kx1mDIuJKacS0kop6xFyLgglEulc2nHWU7U/Sj1uEhMpXPOMyHPwYRqe26ZUyaEMrwJttSjvt778dyP1/mJ43i+juOZculiLn/+lb/4T6XUMC8zAMo4Y9wWSoir1Mj7JebcXdn8FymHaZ5vN6aMNjakfUsTV72b1lTqDwvifj9d1MPCAAAAAElFTkSuQmCC'); background-size: cover; display: block;"></span> <img class="gatsby-resp-image-image" alt="saveas" title="saveas" src="../static/1f4576e71da68bcf723d4b75a264dd8b/8843a/saveas.png" srcset="../static/1f4576e71da68bcf723d4b75a264dd8b/e3b59/saveas.png 170w,../static/1f4576e71da68bcf723d4b75a264dd8b/d6fe0/saveas.pngg 340w../static/1f4576e71da68bcf723d4b75a264dd8b/8843a/saveas.pngng 422w" sizes="(max-width: 422px) 100vw, 422px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async"> </a> </span></div><p>Choosing ‘Omit text in pdf and create LaTeX file’, will save the figure as pdf+LaTeX.To include these Inkscape figures in your LaTeX document, you can add the following code to your preamble:</p><div class="gatsby-highlight" data-language="latex"><pre class="language-latex"><code class="language-latex"><span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">import</span><span class="token punctuation">}</span><span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">xifthen</span><span class="token punctuation">}</span><span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">pdfpages</span><span class="token punctuation">}</span><span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">transparent</span><span class="token punctuation">}</span> <span class="token function selector">\newcommand</span><span class="token punctuation">{</span><span class="token function selector">\incfig</span><span class="token punctuation">}</span><span class="token punctuation">[</span>1<span class="token punctuation">]</span><span class="token punctuation">{</span><span class="token comment">%</span> <span class="token function selector">\def</span><span class="token function selector">\svgwidth</span><span class="token punctuation">{</span><span class="token function selector">\columnwidth</span><span class="token punctuation">}</span> <span class="token function selector">\import</span><span class="token punctuation">{</span>./figures/<span class="token punctuation">}</span><span class="token punctuation">{</span>#1.pdf_tex<span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre></div><p>Assuming the figure is located at <code class="language-text">figures/riemmans-theorem.svg</code>, it can simply be included with following code:</p><div class="gatsby-highlight" data-language="latex"><pre class="language-latex"><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">figure</span><span class="token punctuation">}</span><span class="token punctuation">[</span>ht<span class="token punctuation">]</span> <span class="token function selector">\centering</span> <span class="token function selector">\incfig</span><span class="token punctuation">{</span>riemmans-theorem<span class="token punctuation">}</span> <span class="token function selector">\caption</span><span class="token punctuation">{</span>Riemmans theorem<span class="token punctuation">}</span> <span class="token function selector">\label</span><span class="token punctuation">{</span><span class="token keyword">fig:riemmans-theorem</span><span class="token punctuation">}</span><span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">figure</span><span class="token punctuation">}</span></code></pre></div><p>Compiling your document, you’d get the following.</p><p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/f08abb93e49bbeb6982f0a6ef449790c/92fa3/latexrendered1.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 64.70588235294117%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAvklEQVQoz6VS0QrEIAzb///qQES3uqaaHkyQnezuBpcnUdOmaRb/A8vtLUkzA2AnWmtPyWamqq01ku6+73uMsZ9/kFtrKSUA7g5AREIItVYAtdZvZJIAeMLdSynbtqWU+k2v+JFcazWzqVwvRFJEJvFvZACTN9ffpZRJ+TJZNcg4cX09jmMqfTPz6LOuq4iM/t2Ob24P5SRDCDHGT3bckEmqap8t56yqY/OPQtLFA8g5l1J6yB6FZFrSWNVtPF9wdgRRe3euTAAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Rendered figure" title="Rendered figure" src="../static/f08abb93e49bbeb6982f0a6ef449790c/a4de1/latexrendered1.png" srcset="../static/f08abb93e49bbeb6982f0a6ef449790c/e3b59/latexrendered1.png 170w,../static/f08abb93e49bbeb6982f0a6ef449790c/d6fe0/latexrendered1.pngg 340w../static/f08abb93e49bbeb6982f0a6ef449790c/a4de1/latexrendered1.pngng 680../static/f08abb93e49bbeb6982f0a6ef449790c/e9ece/latexrendered1.pngpng 102../static/f08abb93e49bbeb6982f0a6ef449790c/92fa3/latexrendered1.png.png 1052w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p><p>As you can see, the text is rendered by LaTeX which makes the figure blend in beautifully.When you later decide to change the font, it gets updated accordingly:</p><p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/4032779787b17efc62bfd5446e2f73f7/6b105/latexrendered2.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 63.52941176470588%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAtUlEQVQoz6WS2QqEMAxF+/8/KigULWYxSZsBAyJldApz35LmZKE3+bPqqZeC9DVrZnJKVRERAEZhRBQRd2+tufu2bTlnM4vwDVZVAFBVdyeiUso8z2ZWa42Oj3BXISLMjIhx+XEc3fDUjTWzK+xKmTk2GoK7FkQ0ChPRvu/3VxHpWqduyHWzqk7TlHO+w283BxO7tdbWdS2ldPkf/xz2cPdlWcIeV2bIYfFnAMDMIvJk0uR/6ANAGgPTTVN8JQAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Rendered figure with different font" title="Rendered figure with different font" src="../static/4032779787b17efc62bfd5446e2f73f7/a4de1/latexrendered2.png" srcset="../static/4032779787b17efc62bfd5446e2f73f7/e3b59/latexrendered2.png 170w,../static/4032779787b17efc62bfd5446e2f73f7/d6fe0/latexrendered2.pngg 340w../static/4032779787b17efc62bfd5446e2f73f7/a4de1/latexrendered2.pngng 680../static/4032779787b17efc62bfd5446e2f73f7/e9ece/latexrendered2.pngpng 102../static/4032779787b17efc62bfd5446e2f73f7/6b105/latexrendered2.png.png 1061w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p><p>This setup allows you to draw figures in Inkscape, while still having the power of LaTeX for typesetting.</p><h2 id="creating-and-including-figures-quickly">Creating and including figures quickly</h2><p>When I’m taking notes during a lecture, I need to be able to add a figure without disrupting my flow,and not spend time opening Inkscape, searching for the correct directory, typing the LaTeX code for including the figure manually and so on.To avoid this, I added some shortcuts to Vim for managing my figures.For example, when I type the title of the figure I want to create and press <kbd>Ctrl+F</kbd>, the following happens:</p><ol><li>The script finds the figures directory depending on the location of the LaTeX root file.</li><li>Then it checks if a figure with the same name exists. If so, the script does nothing.</li><li>If not, my figure template gets copied to the figures directory.</li><li>The current line which contains the figure title gets replaced with the LaTeX code to include the figure.</li><li>The new figure opens in Inkscape.</li><li>A file watcher is set up such that whenever the figure is saved as an svg file by pressing <kbd>Ctrl + S</kbd>, it also gets saved as pdf+LaTeX. This means that the annoying pdf save dialog we’ve discussed before doesn’t pop up anymore.</li></ol><p>See it in action:</p><p><img src="../a48c6ef9b7407f13e4e0e86b2649333f/including_figure.gif" alt="Adding a figure"></p><p>When I want to edit a figure, I can press <kbd>Ctrl+F</kbd> in normal mode to open a selection dialog that allows me to search for figures in the current document. Upon selecting one, it shows me the figure in Inkscape. When I save the figure, the code for including it is copied to the clipboard. This way, I can reinclude it if I deleted the original code to do so.</p><p><img src="../6f6ff7a6c0d74474ae9177369c8392a9/editing_figure.gif" alt="Editing a figure"></p><p>These shortcuts make adding and opening figures a breeze.I don’t have to remember saving figures as pdf+LaTeX, pick the right directory or write the code needed for including the figure.The barrier to add a new figure is much lower than if I’d have to do those things manually.You can find my script for managing figures <a href="https://github.com/gillescastel/inkscape-figures" target="_blank" rel="nofollow noopener noreferrer">on Github</a>.</p><p>Now that I’ve explained how I manage my figures,I’d like to talk about actually <em>drawing</em> figures in Inkscape.</p><h2 id="drawing-figures">Drawing figures</h2><p>While drawing figures in Inkscape is quite a bit faster than using Ti<em>k</em>Z in most cases, it is still slower than drawing them by hand.Using the built-in shortcuts of Inkscape speeds up the process but it still doesn’t hit the mark.</p><p>Therefore, I decided to program a custom shortcut manager in Python which allows me to intercept all keyboard events before they reach Inkscape.This way, I have full control over how every keystroke gets interpreted, giving me a lot of flexibility.</p><h3 id="drawing-shapes">Drawing shapes</h3><p>Let’s start with the built in keyboard shortcuts of Inkscape.For example, <kbd>r</kbd> activates the rectangle drawing tool, <kbd>e</kbd> draws ellipses, etc.Implementation-wise, this means that the shortcut manager will ‘replay’ these keyboard events, i.e. it’ll just pass them through to Inkscape.</p><p>However, instead of the default shortcuts <kbd>p</kbd> for pencil and <kbd>b</kbd> for the Bézier tool, I use <kbd>w</kbd> and <kbd>f</kbd>, as these are a bit more comfortable to reach while using a mouse with my right hand.In the spirit of making shortcuts left handed, I also mapped <kbd>z</kbd> to undo, <kbd>Shift+z</kbd> to delete, and <kbd>x</kbd> to toggle snapping which is normally the hard to reach <kbd>%</kbd> key.</p><h3 id="key-chords-to-apply-commonly-used-styles">Key chords to apply commonly used styles</h3><p>Styling objects is the second most common thing I do in Inkscape.The styles I use for drawing figures are quite simple:</p><ul><li>Shapes e.g. rectangles or circles are mostly black, light gray, white or transparent and optionally have a stroke.</li><li>Lines (including strokes) are mostly solid, dotted or dashed. They can be (very) thick or have a normal width and optionally have an arrow on either side.</li></ul><p>These options combined give the following table of commonly used styles:</p><p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/035512f7f15d2a082fc7508431161472/44b06/default-styles-names2.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image"Lines 1–500 of 742. Load more
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><link rel="alternate" type="application/rss+xml" href="../rss.xml"/><style data-href="/styles.5590a669c9dba5321619.css" data-identity="gatsby-global-css">@font-face{font-display:fallback;font-family:Inter;font-style:normal;font-weight:400;src:url(https://rsms.me/inter/font-files/Inter-Regular.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-Regular.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:italic;font-weight:400;src:url(https://rsms.me/inter/font-files/Inter-Italic.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-Italic.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:normal;font-weight:600;src:url(https://rsms.me/inter/font-files/Inter-SemiBold.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-SemiBold.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:italic;font-weight:600;src:url(https://rsms.me/inter/font-files/Inter-SemiBoldItalic.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-SemiBoldItalic.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:normal;font-weight:700;src:url(https://rsms.me/inter/font-files/Inter-Bold.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-Bold.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Inter;font-style:italic;font-weight:700;src:url(https://rsms.me/inter/font-files/Inter-BoldItalic.woff2?v=3.3) format("woff2"),url(https://rsms.me/inter/font-files/Inter-BoldItalic.woff?v=3.3) format("woff")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:normal;font-weight:400;src:url(../static/iosevka-regular-16dbe5061e131124a488bc943cab77d9.woff2) format("woff2"),url(../static/iosevka-regular-0a866faad05f5adaf3da07d0c4301ece.woff) format("woff"),url(../static/iosevka-regular-86e16893ae35205fb9cbd194d032d18d.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:italic;font-weight:400;src:url(../static/iosevka-italic-18bb4838493100eaf489d79269d4a8d0.woff2) format("woff2"),url(../static/iosevka-italic-9216409a4bb6480fc8d83a7185265740.woff) format("woff"),url(../static/iosevka-italic-df5bdd869170b93557f517b1d5072089.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:oblique;font-weight:400;src:url(../static/iosevka-oblique-bdc0b8c75ed6d4d80a8473e1b59d3835.woff2) format("woff2"),url(../static/iosevka-oblique-1b4ad417385daab8b6624bd0ee8a5bf8.woff) format("woff"),url(../static/iosevka-oblique-3c4a95b05396b67b453c938e876db665.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:normal;font-weight:700;src:url(../static/iosevka-bold-4bff02e3a4a1c702d93452ecd6c1a13f.woff2) format("woff2"),url(../static/iosevka-bold-043d268c51a9f3dfd2e57ea203fa42b0.woff) format("woff"),url(../static/iosevka-bold-dd88607d7c53d2001828e613350b6a72.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:italic;font-weight:700;src:url(../static/iosevka-bolditalic-1023faa6207623c2ed7294375abbca63.woff2) format("woff2"),url(../static/iosevka-bolditalic-100aa5a08bdea7237e4c0818a41b4c59.woff) format("woff"),url(../static/iosevka-bolditalic-8fce36ec3f40f04e4ddea632ab0f1d87.ttf) format("truetype")}@font-face{font-display:fallback;font-family:Iosevka Web;font-style:oblique;font-weight:700;src:url(../static/iosevka-boldoblique-ed02bd67300f828e3f1eb9c4e6a611d2.woff2) format("woff2"),url(../static/iosevka-boldoblique-ab212402dc8ff6ba80583ea996578a42.woff) format("woff"),url(../static/iosevka-boldoblique-ef2cf1a2430a178eeb3410e89d657175.ttf) format("truetype")}code[class*=language-],pre[class*=language-]{word-wrap:normal;color:#eceff4;font-family:Iosevka Web,"monospace";-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;white-space:pre;word-break:normal;word-spacing:normal}code[class*=language-]::selection,code[class*=language-] ::selection,pre[class*=language-]::selection,pre[class*=language-] ::selection{background:#3b4252}pre[class*=language-]{border-radius:.3em;margin:.5em 0;overflow:auto;padding:1em}:not(pre)>code[class*=language-]{background:#eceff4;border-radius:3px;color:#2e3440;font-family:Iosevka Web,"monospace";font-size:90%;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;padding:.05em .4em}:not(pre)>code[class*=language-]::selection{background:#c9ecff!important}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#4c566a}.token.punctuation{color:#e5e9f0}.namespace{opacity:.7}.token.boolean{color:#81a1c1}.token.number{color:#b48ead}.token.tag{color:#d8dee9}.token.constant,.token.deleted,.token.property,.token.symbol{color:#88c0d0}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string,.token.url{color:#eceff4}.token.entity{background:#eee8d5;color:#657b83}.token.attr-value,.token.keyword{color:#81a1c1}.token.atrule,.token.class-name,.token.function{color:#8fbcbb}.token.important,.token.regex,.token.variable{color:#81a1c1}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.name{color:#a3be8c}.token.trigger{color:#88c0d0}.token.snippet{color:#81a1c1}.token.tabstop{color:#ebcb8b}.token.flags,.token.inline{color:#b48ead}.gatsby-highlight-code-line{background-color:#13151b;border-left:.25em solid #88c0d0;display:block;margin-left:-1em;margin-right:-1em;padding:.1em 1em .1em .75em}</style><meta name="generator" content="Gatsby 4.4.0"/><link rel="preconnect" href="https://www.google-analytics.com"/><link rel="dns-prefetch" href="https://www.google-analytics.com"/><link rel="alternate" type="application/rss+xml" title="Gilles Castel's blog RSS Feed" href="../rss.xml"/><link rel="icon" href="../favicon-32x32.png%3Fv=c9dde36f72d3007a082734fe5feea5e4" type="image/png"/><link rel="manifest" href="../manifest.webmanifest" crossorigin="anonymous"/><meta name="theme-color" content="#2E3440"/><link rel="apple-touch-icon" sizes="48x48" href="../icons/icon-48x48.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="72x72" href="../icons/icon-72x72.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="96x96" href="../icons/icon-96x96.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="144x144" href="../icons/icon-144x144.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="192x192" href="../icons/icon-192x192.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="256x256" href="../icons/icon-256x256.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="384x384" href="../icons/icon-384x384.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><link rel="apple-touch-icon" sizes="512x512" href="../icons/icon-512x512.png%3Fv=c9dde36f72d3007a082734fe5feea5e4"/><title data-react-helmet="true">How I draw figures for my mathematical lecture notes using Inkscape | Gilles Castel</title><meta data-react-helmet="true" name="description" content="In my previous blog post, I explained how I take lecture notes using Vim and LaTeX. In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.Some examples First, let me show you some examples of figures…"/><meta data-react-helmet="true" property="og:title" content="How I draw figures for my mathematical lecture notes using Inkscape"/><meta data-react-helmet="true" property="og:description" content="In my previous blog post, I explained how I take lecture notes using Vim and LaTeX. In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.Some examples First, let me show you some examples of figures…"/><meta data-react-helmet="true" property="og:type" content="website"/><meta data-react-helmet="true" name="twitter:card" content="summary"/><meta data-react-helmet="true" name="twitter:creator" content="Gilles Castel"/><meta data-react-helmet="true" name="twitter:title" content="How I draw figures for my mathematical lecture notes using Inkscape"/><meta data-react-helmet="true" name="twitter:description" content="In my previous blog post, I explained how I take lecture notes using Vim and LaTeX. In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.Some examples First, let me show you some examples of figures…"/><style data-styled="" data-styled-version="5.3.3">.NEJsy{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #4C566A;border-top:1px solid #4C566A;padding:1em;font-size:80%;}/*!sc*/ data-styled.g1[id="Bio__BioDiv-sc-1xze3le-0"]{content:"NEJsy,"}/*!sc*/ .gzyKGq{padding-left:1em;-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;}/*!sc*/ data-styled.g2[id="Bio__Text-sc-1xze3le-1"]{content:"gzyKGq,"}/*!sc*/ .iQePnH{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;border-radius:50%;}/*!sc*/ data-styled.g3[id="Bio___StyledImg-sc-1xze3le-2"]{content:"iQePnH,"}/*!sc*/ ::selection{background:#c9ecff;}/*!sc*/ ::-moz-selection{background:#c9ecff;}/*!sc*/ *{margin:0;padding:0;box-sizing:border-box;}/*!sc*/ html,body{font-family:'Inter',sans-serif;text-rendering:optimizeLegibility;line-height:1.4;}/*!sc*/ body{background:#ffffff;color:#3a343a;font-size:18px;text-rendering:optimizeLegibility;}/*!sc*/ a{outline:none;-webkit-text-decoration:none;text-decoration:none;color:inherit;}/*!sc*/ p a,figcaption a{border-bottom:1px solid #4C566A;}/*!sc*/ table{margin:0 auto;}/*!sc*/ .gatsby-resp-image-link{border-bottom:none;}/*!sc*/ h1{font-size:230%;line-height:1.2;margin-bottom:0.2em;}/*!sc*/ p{margin-top:1.4rem;margin-bottom:1.4rem;}/*!sc*/ blockquote{font-style:italic;border-left:2px solid #2E3440;padding-left:1.4rem;margin-left:-1.4rem;}/*!sc*/ li{margin-bottom:0.7rem;padding-left:1.4rem;}/*!sc*/ ul,ol{padding-left:1.4rem;}/*!sc*/ hr{border-top:none;border-bottom:1px solid black;}/*!sc*/ .gatsby-highlight{box-shadow:0px 0px 10px rgba(0,0,0,0.2);font-family:'Iosevka Web','monospace';font-size:90%;background-color:#2e3440;margin:1em 0;padding:1em;overflow:auto;}/*!sc*/ .gatsby pre,.gatsby pre code{font-family:'Iosevka Web','monospace';}/*!sc*/ .gatsby-highlight pre[class*="language-"]{background-color:transparent;margin:0;padding:0;overflow:initial;float:left;min-width:100%;}/*!sc*/ .gatsby-video-aspect-ratio{box-shadow:0px 0px 10px rgba(0,0,0,0.2);margin:1em 0;}/*!sc*/ .gatsby-resp-image-wrapper{max-width:none !important;}/*!sc*/ img[src$=gif]{background-color:#2E333F;box-shadow:0px 0px 10px rgba(0,0,0,0.2);width:100%;}/*!sc*/ img[src$="svg"]{width:100%;}/*!sc*/ #disqus_thread{position:relative;}/*!sc*/ #disqus_thread::after{content:'';position:absolute;left:0;right:0;bottom:0;height:55px;background:#ffffff;}/*!sc*/ kbd{font-size:90%;font-family:'Iosevka Web','monospace';padding:.05em .4em;border-radius:3px;border:1px solid gray;background:#ECEFF4;}/*!sc*/ figure figcaption{padding:0.7em 1.4em;font-size:80%;background:#ECEFF4;}/*!sc*/ data-styled.g4[id="sc-global-cLNjzj1"]{content:"sc-global-cLNjzj1,"}/*!sc*/ .cxeJTm{padding:1em;color:#d8dee9;text-align:center;max-width:648px;margin:0 auto;font-size:80%;}/*!sc*/ data-styled.g5[id="Layout__Footer-sc-g3mgjj-0"]{content:"cxeJTm,"}/*!sc*/ .fwYusv{min-height:100vh;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}/*!sc*/ data-styled.g6[id="Layout___StyledDiv-sc-g3mgjj-1"]{content:"fwYusv,"}/*!sc*/ .chpAuY{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}/*!sc*/ data-styled.g7[id="Layout___StyledDiv2-sc-g3mgjj-2"]{content:"chpAuY,"}/*!sc*/ .kbKLKY{font-size:80%;text-transform:lowercase;font-weight:700;font-variant:small-caps;}/*!sc*/ data-styled.g8[id="smallcaps__SmallCaps-sc-17d6b14-0"]{content:"kbKLKY,"}/*!sc*/ .hyHJPv{font-size:80%;font-weight:700;}/*!sc*/ data-styled.g9[id="smallcaps__FakeSmallCaps-sc-17d6b14-1"]{content:"hyHJPv,"}/*!sc*/ .iDNUhN{border-bottom:1px solid #4C566A;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}/*!sc*/ .iDNUhN > span,.iDNUhN a{padding:0.5em 0;}/*!sc*/ data-styled.g10[id="blog-post__SupTitle-sc-1993m0e-0"]{content:"iDNUhN,"}/*!sc*/ .ijGSzm{width:100%;text-align:center;margin:2.8rem 0;}/*!sc*/ data-styled.g11[id="blog-post__Title-sc-1993m0e-1"]{content:"ijGSzm,"}/*!sc*/ .cFnHMB{max-width:680px;margin:0 auto;padding:1em;}/*!sc*/ .cFnHMB .custom-block.snippet .custom-block-body{font-style:italic;}/*!sc*/ .cFnHMB h2,.cFnHMB h3,.cFnHMB h4,.cFnHMB h5,.cFnHMB h6{line-height:1.2;margin-bottom:-1rem;}/*!sc*/ .cFnHMB h2{margin-top:2em;font-size:1.4rem;}/*!sc*/ .cFnHMB h3{margin-top:2rem;font-size:1.2rem;}/*!sc*/ .cFnHMB .toc{z-index:10;position:-webkit-sticky;position:sticky;top:2em;font-size:70%;height:0px;}/*!sc*/ @media (max-width:1080px){.cFnHMB .toc{display:none;}}/*!sc*/ .cFnHMB .toc ul{list-style:none;display:inline-block;width:calc((100vw - 680px) / 2 - 4em);}/*!sc*/ .cFnHMB .toc li{padding-left:0;margin-bottom:0.3em;}/*!sc*/ .cFnHMB .toc li p{margin:0;margin-bottom:0.5em;}/*!sc*/ .cFnHMB .toc a{border-bottom:none;}/*!sc*/ .cFnHMB .toc a.is-active{font-weight:bold;}/*!sc*/ .cFnHMB .toc > ul{padding-left:0;-webkit-transform:translateX(calc(-100% - 2em)) translateY(4em);-ms-transform:translateX(calc(-100% - 2em)) translateY(4em);transform:translateX(calc(-100% - 2em)) translateY(4em);}/*!sc*/ .cFnHMB .toc > ul::before{content:"Table of contents";font-weight:bold;padding-bottom:0.5em;display:inline-block;}/*!sc*/ data-styled.g12[id="blog-post__Main-sc-1993m0e-2"]{content:"cFnHMB,"}/*!sc*/ .ePTuVc{margin-bottom:2em;}/*!sc*/ .ePTuVc ul{margin:0;padding:0;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}/*!sc*/ .ePTuVc ul li{margin:0;padding:0;list-style-type:none;}/*!sc*/ .ePTuVc ul li a{display:inline-block;padding:0.5em 0;}/*!sc*/ .ePTuVc ul li.prev{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}/*!sc*/ .ePTuVc ul li.next{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;text-align:right;padding-left:1em;}/*!sc*/ data-styled.g13[id="blog-post__Nav-sc-1993m0e-3"]{content:"ePTuVc,"}/*!sc*/ </style><link as="script" rel="preload" href="../webpack-runtime-f28b399e0936aecf66ac.js"/><link as="script" rel="preload" href="../framework-ea68fce3d30d105ba963.js"/><link as="script" rel="preload" href="../app-9c07f8581d6a14d0067d.js"/><link as="script" rel="preload" href="../04f12b145687b6350b874aa568443d7ed4a3c726-be6a39a4ebd1487fb52e.js"/><link as="script" rel="preload" href="../component---src-templates-blog-post-js-8cf4b165ff72f56ebc7c.js"/><link as="fetch" rel="preload" href="../page-data/post/lecture-notes-2/page-data.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="../page-data/sq/d/3128451518.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="../page-data/app-data.json" crossorigin="anonymous"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><div class="Layout___StyledDiv-sc-g3mgjj-1 fwYusv"><div class="Layout___StyledDiv2-sc-g3mgjj-2 chpAuY"><div class="blog-post__Main-sc-1993m0e-2 cFnHMB"><div class="smallcaps__SmallCaps-sc-17d6b14-0 blog-post__SupTitle-sc-1993m0e-0 kbKLKY iDNUhN"><a href="../index.html">← All articles</a><span>Apr<!-- --> <span class="smallcaps__FakeSmallCaps-sc-17d6b14-1 hyHJPv">26</span>,<!-- --> <span class="smallcaps__FakeSmallCaps-sc-17d6b14-1 hyHJPv">2019</span> •<!-- --> <span class="smallcaps__FakeSmallCaps-sc-17d6b14-1 hyHJPv">12</span> Min Read</span></div><h1 class="blog-post__Title-sc-1993m0e-1 ijGSzm">How I draw figures for my mathematical lecture notes using Inkscape</h1><div><div class="custom-block snippet"><div class="custom-block-body"><p>In my <a href="lecture-notes-1.html">previous blog</a> post, I explained how I take lecture notes using Vim and LaTeX. In this post, I’ll talk about how I draw figures for my notes using Inkscape and about my custom shortcut manager.</p></div></div> <h2 id="some-examples">Some examples</h2> <p>First, let me show you some examples of figures I’ve made. They were made for complex analysis, differential geometry, electrodynamics and my bachelors’s thesis on elliptic curves. I drew them during the lecture — except of course those for my thesis — using Inkscape, so let’s start with that.</p> <p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/df84ee6b3a0f2016b1aa37a79deab7c0/93772/fig_1.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 56.470588235294116%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAArklEQVQoz42S2wrDMAxD9/8fm0BpXN8zqFhWmrab3mI4tmTn1SflR35Qv9JrLqkqEZlZRIDUXb9hdyciZjYzd89M1NHrCbZdIhIRsH18zsO/cESYGTKrambWWltrCIJGw8gZVtVhzN1FpJTSWkN+WLiFI2Lwmbksy7quvfdSChGpqog8ZYZzOKy1MjOKIrJt22ns9anMDCFxJBFh5nnV1zDyjyUdd/EXPL7XHQb4DQ8+jHi0L7awAAAAAElFTkSuQmCC'); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 1" title="Example 1" src="../static/df84ee6b3a0f2016b1aa37a79deab7c0/a4de1/fig_1.png" srcset="../static/df84ee6b3a0f2016b1aa37a79deab7c0/e3b59/fig_1.png 170w,../static/df84ee6b3a0f2016b1aa37a79deab7c0/d6fe0/fig_1.pngg 340w../static/df84ee6b3a0f2016b1aa37a79deab7c0/a4de1/fig_1.pngng 680../static/df84ee6b3a0f2016b1aa37a79deab7c0/e9ece/fig_1.pngpng 102../static/df84ee6b3a0f2016b1aa37a79deab7c0/93772/fig_1.png.png 1324w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span> <span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/3eacd85683a5d2cdd10e7f6b2a281d86/689d4/fig_3.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 44.705882352941174%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAIAAAC9o5sfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA0UlEQVQoz5WRy4pEIQxE/f8PvTvxtq+kzMOhbwYZetEwtRCUquSYpP1/ubuZ7b3TF5M9Ou44e++lFGb+Dbv7cQOIF3dfa4mIuwNg5tfrdV1XJCOSImBmIsLMRKSqp+fem4gAqCoz55xrrWutyKfW2hgj7rXW3juAwyIiZqaqY4wgb62VUuac787rkaqKCBEd1Agzs4jEXwD03qPEnPPdOYBVda2FR6p6wjEkAPKolEJEZpZzBpCCLfCI6L7vYPmYfBSNoYbZzNLHAkXk+4b/Xn8AW+ESwjB3fLMAAAAASUVORK5CYII='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 2" title="Example 2" src="../static/3eacd85683a5d2cdd10e7f6b2a281d86/a4de1/fig_3.png" srcset="../static/3eacd85683a5d2cdd10e7f6b2a281d86/e3b59/fig_3.png 170w,../static/3eacd85683a5d2cdd10e7f6b2a281d86/d6fe0/fig_3.pngg 340w../static/3eacd85683a5d2cdd10e7f6b2a281d86/a4de1/fig_3.pngng 680../static/3eacd85683a5d2cdd10e7f6b2a281d86/e9ece/fig_3.pngpng 102../static/3eacd85683a5d2cdd10e7f6b2a281d86/e0c87/fig_3.png.png 13../static/3eacd85683a5d2cdd10e7f6b2a281d86/689d4/fig_3.png3.png 1432w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span> <span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/8353ffee383e88481e3533874c18a40e/1d9fd/fig_6.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 86.47058823529412%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAIAAABSJhvpAAAACXBIWXMAAAsTAAALEwEAmpwYAAABe0lEQVQ4y42SQYvCMBCF+/9/kCB48aC3QlsrMSQlDVJTqoSGpKTtpOkuhnXdVdd9x5Bv5s2bieYHTdMEAOM4AoD3fhzHvu+ttY8/o1+Yc26aJu99eLHWcs5vhV7C8KWu64wxXdcJITDGCCEp5XTVc9h7H6yWZYkQyvOcECKEUEo1TaO1vrfzpLNzDgCMMefzWUoJAPemrLUvO9+PffsUIgCApmk454wxpVQIL+QXPWYIAMMwjFdprTnneZ4XRYEQOp1Of3W+RTDPszGGc55l2WKx2O/3nPO6rt/DAKCUOhwOGOOiKLbbbZIkQoi2bd/DdV1TSuM4Xq/X5VUBc87dZx79cmuMqapqt9sxxiilSZKEVfV9/+bCtNaMMULIcrnMsqwsy1tCj0v+hgGgbVtKKSEEY5ymKULocrkopebXikLVqqoYY5vNZrVaUUoZY2GTTxv+gMP1I4TSNI3juK5rKaVzbn6nKFzS8XgMnv8e8vnMwzA0Vxlj/kl+wh8FOtQd6yKOMQAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 3" title="Example 3" src="../static/8353ffee383e88481e3533874c18a40e/a4de1/fig_6.png" srcset="../static/8353ffee383e88481e3533874c18a40e/e3b59/fig_6.png 170w,../static/8353ffee383e88481e3533874c18a40e/d6fe0/fig_6.pngg 340w../static/8353ffee383e88481e3533874c18a40e/a4de1/fig_6.pngng 680../static/8353ffee383e88481e3533874c18a40e/e9ece/fig_6.pngpng 102../static/8353ffee383e88481e3533874c18a40e/1d9fd/fig_6.png.png 1251w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span> <span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/9a7e08c455f98a30e210b3e3a4953fb1/a0367/fig_5.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 46.470588235294116%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAIAAAC9o5sfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAvklEQVQoz42R247DIAxE8/+fmbckCiSVDfhKpVhq2W1U9Txhw3gGmPoPqKq7f/ansRARInqV7m5mvfeUEiLGlHVd53nOOYvI5O61VgAgIrkYTUSEmbdtyzmbmaqWUh4XzDzFvAARAWAUq+pxHCLSew/xfewwaa0BQJxjZlUlotaau8ciAvrFW3yeJyISUSllFJdSiIiZU0r5IoK8ncP29UKBme37viyLiIz9P7HNrNb6uRdXuP2km6/6xxdZiJ+gzRMN2H9cQgAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 4" title="Example 4" src="../static/9a7e08c455f98a30e210b3e3a4953fb1/a4de1/fig_5.png" srcset="../static/9a7e08c455f98a30e210b3e3a4953fb1/e3b59/fig_5.png 170w,../static/9a7e08c455f98a30e210b3e3a4953fb1/d6fe0/fig_5.pngg 340w../static/9a7e08c455f98a30e210b3e3a4953fb1/a4de1/fig_5.pngng 680../static/9a7e08c455f98a30e210b3e3a4953fb1/e9ece/fig_5.pngpng 102../static/9a7e08c455f98a30e210b3e3a4953fb1/e0c87/fig_5.png.png 13../static/9a7e08c455f98a30e210b3e3a4953fb1/a0367/fig_5.png5.png 1414w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span> <span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/14cd3152abeb915eebabcfa2e3aeac8c/f5eaf/fig_2.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 47.64705882352941%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/0lEQVQoz31R2W4DIQzc///RiLBLhInxCVRZq9sorToPlg+MPeNt/QIiMvNHcp74SG6XZ2ZjjLUWEbn7e9sYI5rHGCJCRL33OecW5bWWqoYjIrVWRIyPwoETRJRSyjnf7/cxxjbnjMLtdusnUkrHcahqUCAiVa21iggiAsBaK3bcmLmUwt8QkbDXzqrq7mHHCTOLHbfeOxExMwBEVk5Ec2st54yI+76rKhHlnIPwq9nM4ikzP5/PkLr3fqno7mamqjHT3S/lX5zdvbVWSkkn9n0vpQTn0NbMAAARIwzxf04lIqUUAIhjAEAMb63VWlX1OI4g+Hg8fia/3/NP/5/wC/XHSVXEF3VOAAAAAElFTkSuQmCC'); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Example 5" title="Example 5" src="../static/14cd3152abeb915eebabcfa2e3aeac8c/a4de1/fig_2.png" srcset="../static/14cd3152abeb915eebabcfa2e3aeac8c/e3b59/fig_2.png 170w,../static/14cd3152abeb915eebabcfa2e3aeac8c/d6fe0/fig_2.pngg 340w../static/14cd3152abeb915eebabcfa2e3aeac8c/a4de1/fig_2.pngng 680../static/14cd3152abeb915eebabcfa2e3aeac8c/e9ece/fig_2.pngpng 102../static/14cd3152abeb915eebabcfa2e3aeac8c/f5eaf/fig_2.png.png 1212w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p> <div class="toc"> <ul> <li><a href="lecture-notes-2.html#some-examples">Some examples</a></li> <li><a href="lecture-notes-2.html#what-is-inkscape">What is Inkscape?</a></li> <li><a href="lecture-notes-2.html#why-inkscape">Why Inkscape?</a></li> <li><a href="lecture-notes-2.html#including-inkscape-figures-in-a-latex-document">Including Inkscape figures in a LaTeX document</a></li> <li><a href="lecture-notes-2.html#creating-and-including-figures-quickly">Creating and including figures quickly</a></li> <li> <p><a href="lecture-notes-2.html#drawing-figures">Drawing figures</a></p> <ul> <li><a href="lecture-notes-2.html#drawing-shapes">Drawing shapes</a></li> <li><a href="lecture-notes-2.html#key-chords-to-apply-commonly-used-styles">Key chords to apply commonly used styles</a></li> <li><a href="lecture-notes-2.html#adding-text">Adding text</a></li> <li><a href="lecture-notes-2.html#saving-and-using-less-commonly-used-styles">Saving and using less commonly used styles</a></li> <li><a href="lecture-notes-2.html#adding-and-saving-objects">Adding and saving objects</a></li> </ul> </li> <li><a href="lecture-notes-2.html#code">Code</a></li> <li><a href="lecture-notes-2.html#conclusion">Conclusion</a></li> </ul> </div> <h2 id="what-is-inkscape">What is Inkscape?</h2> <p><a href="https://inkscape.org/" target="_blank" rel="nofollow noopener noreferrer">Inkscape</a> is an open source vector graphics editor, available for all major platforms. It’s a free — but arguably less featureful — alternative to Adobe Illustrator. You can use it for designing flyers and logos like in the picture below, but it’s also a powerful tool for drawing mathematical figures.</p> <p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/0da7559609e3a938b43ee18d7ca7d958/ac67c/inkscape.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 58.82352941176471%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAIAAADtbgqsAAAACXBIWXMAAAsTAAALEwEAmpwYAAAClUlEQVQoz0XQTUgUYRgH8KlLhwgKDymSiEGuWRFWftQqWmlhZWBlBrUIBVF0KaUOHoou1ckO5sGQhEUl0I2KDEONNN3Mr/Ijh12/3Z2Pd2bnnZl3Zud731g3tuf+e/7/5yFCISpMgVCYZ1iW5VUgWBDFBBlDFIMoJioxipVoBkSgBKGoyqKKJD2KTA0hWSIAAKZp6bpuOVhebqL8VWF/LRi/HPZX02PX14dr5JBPM7BtmwJEwzOhETLiD4jfFuBkgCMEEWKMYzELYywv3F3v27M26F4dLJ3ylc/31s721knUAN4cVdPmVwAZQmRYHV8WF8MRQhDlTRzDGJNzS++6vvZ9GPN1jX75NPe+53dfLwmAmsCabk4H2R9/mIkAN7sqUhwkJIFPYglp6xscRfMUDWiaDQaXaYZR1X/YdhyOh4DnkYowtiiWIyQYwRg7joMxHhudaqx/1nDv6a1r9dUVN8sLai6Wefo/DyW2W5ZNkgtrYSDrjqzZLC8RAozfbFk2xviO51HqtoOuNPf+9JLs3Sdcqe5dW1wtTW/i2HE0M+b3DwzPUSMBdYiUyQ2ZgKIUr2TH8YPbj4tyzx/LPnt035lDGWV7UwpTtua8bvbGq9mObVuOYydvlBVEAD7yP/nGw8yd+TnpJa604qyUgowdR7YTWS0v2xPJUd2cWuQml6SJRWl6RQ6u8oQgisnkxvvPjx+4UF549VT+ldK86qLcc9mpbm9bd+IppmVzogqgAqDCiYogqoQa1ZL4ScOLk3mXqkrrKos9lSWeisLaw5mnO9p9CezYjqEbhmHqhmWYpmEYBAuAg1CUU1Qdf+z/+aq1s6vjbU9nR3dbu7e1s63ZO/P9l4IsHhmMrFA8LYp0VAhBhmIA9xeFojVoB2KKVAAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Inkscape" title="Inkscape" src="../static/0da7559609e3a938b43ee18d7ca7d958/a4de1/inkscape.png" srcset="../static/0da7559609e3a938b43ee18d7ca7d958/e3b59/inkscape.png 170w,../static/0da7559609e3a938b43ee18d7ca7d958/d6fe0/inkscape.pngg 340w../static/0da7559609e3a938b43ee18d7ca7d958/a4de1/inkscape.pngng 680../static/0da7559609e3a938b43ee18d7ca7d958/e9ece/inkscape.pngpng 102../static/0da7559609e3a938b43ee18d7ca7d958/e0c87/inkscape.png.png 13../static/0da7559609e3a938b43ee18d7ca7d958/ac67c/inkscape.pnge.png 1606w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p> <h2 id="why-inkscape">Why Inkscape?</h2> <p>The most common solutions for adding figures to LaTeX documents are Ti<em>k</em>Z, PSTricks and Asymptote. These options have one thing in common: they are command based, i.e. you just write some code that specifies how the figure should be drawn. For example, the following Ti<em>k</em>Z code</p> <div class="gatsby-highlight" data-language="latex"><pre class="language-latex"><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">tikzpicture</span><span class="token punctuation">}</span> <span class="token function selector">\coordinate</span> (A) at (1, 3); <span class="token function selector">\draw</span><span class="token punctuation">[</span>thick, -><span class="token punctuation">]</span> (0, 0) -- (A); <span class="token function selector">\node</span><span class="token punctuation">[</span>above right<span class="token punctuation">]</span> at (A) <span class="token punctuation">{</span><span class="token equation string">$A = (1, 2)$</span><span class="token punctuation">}</span>; <span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">tikzpicture</span><span class="token punctuation">}</span></code></pre></div> <p>gives this figure:</p> <p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/4c2942fceb15c07c3e937135c552e754/c228c/tikzexample4.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 38.23529411764706%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAIAAAB2/0i6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAVklEQVQY053PSwrAMAgEUO9/2xiJEj8ptNBVNKWz9qkDK09EqOqcU1W3A1BgZsY7RPTs+orNrLW2yqRYRMYY24Nn3HvPqh6wmSHiOgXqn/9gdy+qvvgC4H7cfUqJjJcAAAAASUVORK5CYII='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="TikZ example" title="TikZ example" src="../static/4c2942fceb15c07c3e937135c552e754/a4de1/tikzexample4.png" srcset="../static/4c2942fceb15c07c3e937135c552e754/e3b59/tikzexample4.png 170w,../static/4c2942fceb15c07c3e937135c552e754/d6fe0/tikzexample4.pngg 340w../static/4c2942fceb15c07c3e937135c552e754/a4de1/tikzexample4.pngng 680../static/4c2942fceb15c07c3e937135c552e754/e9ece/tikzexample4.pngpng 102../static/4c2942fceb15c07c3e937135c552e754/e0c87/tikzexample4.png.png 13../static/4c2942fceb15c07c3e937135c552e754/c228c/tikzexample4.png4.png 1437w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p> <p>The benefit of these packages is that drawing a figure is a lot like programming: you can use variables, do calculations, use <code class="language-text">for</code> loops, etc. Furthermore figures blend in nicely in your document because all text is typeset by LaTeX itself. This means that you can typeset math effortlessly, or that if later on, you decide to change the font of your document, all the figures will change automatically to match the new font.</p> <p>However, these assets cost you visual feedback and speed. Drawing complex figures is inherently a graphical task and without a graphical interface, it can be extremely time consuming. It’s impossible to click and drag an object to move it, freehand draw a curve or drag the control points of a Bézier curve. This makes Ti<em>k</em>Z a lot harder and slower to use than Inkscape. While I use Ti<em>k</em>Z once in a while for complex figures, I found that in most cases, the benefits of Inkscape far outweigh those of Ti<em>k</em>Z, especially if you’re under time pressure during a lecture.</p> <p>With this out of the way, let’s get started.</p> <h2 id="including-inkscape-figures-in-a-latex-document">Including Inkscape figures in a LaTeX document</h2> <p>Just like Ti<em>k</em>Z, Inkscape has the option to render the text of a figure using LaTeX. For this, it exports figures as both a pdf and a LaTeX file. The pdf document contains the figure with text stripped, and the LaTeX file contains the code needed to place the text at the correct position. For example, suppose you’re working on the following figure in Inkscape:</p> <p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/c21062130180ff44b3bca5b48bf35b90/506a7/riemman-inkscape.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 65.29411764705883%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABkUlEQVQoz21SaY/bIBDl//+r7WqralXt8WG3yUZqEwcfEAwYc5hjcGV7403TPCE0DPNGbx6gEldFgRtyOpakrAihrG4oPbWUCS46IVXLJeei5dORcYnL5lgRemJCKlTgWvW9tYMx1hhr3RQ4542xqtdaG62t92G+dcY4IVWvp8r9kSJalT7E8V8AQJoBADFGrTUAXNU0TKCmZcPgL7N+xhLHGLuuU0qtmRVMSFS2wvuwplJKIYSl1ForpSSEGGMWFZdkwgTiNR3OXXPOMX6NkGeklGKMABBCuCQfSopEiwcfL0ddaFcic87e+yW/7Ls9RpzW7ix7JS/xomJttJI/DaMtEozclB1j5Jw7525ONI7jsaQIEzq4Yb7+NGw1RghBKV1G/d+wmnLUUDaR8wiQIY8p5xBDSmHMoLpOcOGHIYYYQoKcp5IMY566FLhGutc3Psm8pmdL6dq6M7TR6Ndmq7Zb/uPw/K6+0fBACixfwT7Cn3u8+6g2H+T77vnpdP9b3R0Ob/jJtI95f1e8/nx52/wFnDXvo4lye5cAAAAASUVORK5CYII='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Riemann's theorem" title="Riemann's theorem" src="../static/c21062130180ff44b3bca5b48bf35b90/a4de1/riemman-inkscape.png" srcset="../static/c21062130180ff44b3bca5b48bf35b90/e3b59/riemman-inkscape.png 170w,../static/c21062130180ff44b3bca5b48bf35b90/d6fe0/riemman-inkscape.pngg 340w../static/c21062130180ff44b3bca5b48bf35b90/a4de1/riemman-inkscape.pngng 680../static/c21062130180ff44b3bca5b48bf35b90/e9ece/riemman-inkscape.pngpng 102../static/c21062130180ff44b3bca5b48bf35b90/506a7/riemman-inkscape.png.png 1110w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p> <p>To include this figure in a LaTeX document, you’d go to File › Save As, select ‘pdf’ as the extension and then press Save which makes the following dialog pop up:</p> <div style="width:100%;max-width:422px; position: relative; margin: 0 auto; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1)"> <span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 422px; "> <a class="gatsby-resp-image-link" href="../static/1f4576e71da68bcf723d4b75a264dd8b/8843a/saveas.png" style="display: block" target="_blank" rel="noopener"> <span class="gatsby-resp-image-background-image" style="padding-bottom: 81.17647058823529%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAIAAACZeshMAAAACXBIWXMAAAsTAAALEwEAmpwYAAACTElEQVQoz3VTh6rbQBDU//9eQvKebUnXe1G7KtkOJ6URCAzLMBzandlVZ50XUhvntLFKW+u8lNpPi/OTddO6hVL3XOo/SKmsIXWU8gEgxiUhDGLKhQQQa+ukMkKpZd2O56vute573Y/fyKWuW+yEVAjTfgAjRADiez/4aZ2XbQBwAGgECBEWUg4xrVtct3DWhhBjt4VLCsuv2t4tC4BohHiECCJCKB9HYP1c6p5yybmkhtzllEopKddLqrWouXyFM4TgMcARtua3e98PI8QEYUooB4iMEEmlO2ojEJNSikstleZCIqq+PajW2k+z85Of5osY57VpiRrrjPN+mrs7W7+MmhIMEKGUAUQ455RQY33KJcQc04USz9EunnKNKXdKCEIoIkxIxYUilI0AjwBhTD7vg7Wm1BpzvkyWuitl/DS/3+9lCx3j4vMxAIj6VjAm9HeEMYQb27BwUkomJD+htMWtkzbWd/OyauNs8+Ocaw7juZgtppwT1KkHbATgdu9v934A4ON2//5xewwj46pb225iaxPTFtLVdgtNWUOstTg/Cako40woyiUmzDiv2jm6jjL+GEAbe4SEMgCxsb7+Osl4JtQMn46VahG83+/j+dpC7Kx1mDIuJKacS0kop6xFyLgglEulc2nHWU7U/Sj1uEhMpXPOMyHPwYRqe26ZUyaEMrwJttSjvt778dyP1/mJ43i+juOZculiLn/+lb/4T6XUMC8zAMo4Y9wWSoir1Mj7JebcXdn8FymHaZ5vN6aMNjakfUsTV72b1lTqDwvifj9d1MPCAAAAAElFTkSuQmCC'); background-size: cover; display: block;"></span> <img class="gatsby-resp-image-image" alt="saveas" title="saveas" src="../static/1f4576e71da68bcf723d4b75a264dd8b/8843a/saveas.png" srcset="../static/1f4576e71da68bcf723d4b75a264dd8b/e3b59/saveas.png 170w,../static/1f4576e71da68bcf723d4b75a264dd8b/d6fe0/saveas.pngg 340w../static/1f4576e71da68bcf723d4b75a264dd8b/8843a/saveas.pngng 422w" sizes="(max-width: 422px) 100vw, 422px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async"> </a> </span> </div> <p>Choosing ‘Omit text in pdf and create LaTeX file’, will save the figure as pdf+LaTeX. To include these Inkscape figures in your LaTeX document, you can add the following code to your preamble:</p> <div class="gatsby-highlight" data-language="latex"><pre class="language-latex"><code class="language-latex"><span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">import</span><span class="token punctuation">}</span> <span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">xifthen</span><span class="token punctuation">}</span> <span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">pdfpages</span><span class="token punctuation">}</span> <span class="token function selector">\usepackage</span><span class="token punctuation">{</span><span class="token keyword">transparent</span><span class="token punctuation">}</span> <span class="token function selector">\newcommand</span><span class="token punctuation">{</span><span class="token function selector">\incfig</span><span class="token punctuation">}</span><span class="token punctuation">[</span>1<span class="token punctuation">]</span><span class="token punctuation">{</span><span class="token comment">%</span> <span class="token function selector">\def</span><span class="token function selector">\svgwidth</span><span class="token punctuation">{</span><span class="token function selector">\columnwidth</span><span class="token punctuation">}</span> <span class="token function selector">\import</span><span class="token punctuation">{</span>./figures/<span class="token punctuation">}</span><span class="token punctuation">{</span>#1.pdf_tex<span class="token punctuation">}</span> <span class="token punctuation">}</span></code></pre></div> <p>Assuming the figure is located at <code class="language-text">figures/riemmans-theorem.svg</code>, it can simply be included with following code:</p> <div class="gatsby-highlight" data-language="latex"><pre class="language-latex"><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">figure</span><span class="token punctuation">}</span><span class="token punctuation">[</span>ht<span class="token punctuation">]</span> <span class="token function selector">\centering</span> <span class="token function selector">\incfig</span><span class="token punctuation">{</span>riemmans-theorem<span class="token punctuation">}</span> <span class="token function selector">\caption</span><span class="token punctuation">{</span>Riemmans theorem<span class="token punctuation">}</span> <span class="token function selector">\label</span><span class="token punctuation">{</span><span class="token keyword">fig:riemmans-theorem</span><span class="token punctuation">}</span> <span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">figure</span><span class="token punctuation">}</span></code></pre></div> <p>Compiling your document, you’d get the following.</p> <p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/f08abb93e49bbeb6982f0a6ef449790c/92fa3/latexrendered1.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 64.70588235294117%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAvklEQVQoz6VS0QrEIAzb///qQES3uqaaHkyQnezuBpcnUdOmaRb/A8vtLUkzA2AnWmtPyWamqq01ku6+73uMsZ9/kFtrKSUA7g5AREIItVYAtdZvZJIAeMLdSynbtqWU+k2v+JFcazWzqVwvRFJEJvFvZACTN9ffpZRJ+TJZNcg4cX09jmMqfTPz6LOuq4iM/t2Ob24P5SRDCDHGT3bckEmqap8t56yqY/OPQtLFA8g5l1J6yB6FZFrSWNVtPF9wdgRRe3euTAAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Rendered figure" title="Rendered figure" src="../static/f08abb93e49bbeb6982f0a6ef449790c/a4de1/latexrendered1.png" srcset="../static/f08abb93e49bbeb6982f0a6ef449790c/e3b59/latexrendered1.png 170w,../static/f08abb93e49bbeb6982f0a6ef449790c/d6fe0/latexrendered1.pngg 340w../static/f08abb93e49bbeb6982f0a6ef449790c/a4de1/latexrendered1.pngng 680../static/f08abb93e49bbeb6982f0a6ef449790c/e9ece/latexrendered1.pngpng 102../static/f08abb93e49bbeb6982f0a6ef449790c/92fa3/latexrendered1.png.png 1052w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p> <p>As you can see, the text is rendered by LaTeX which makes the figure blend in beautifully. When you later decide to change the font, it gets updated accordingly:</p> <p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/4032779787b17efc62bfd5446e2f73f7/6b105/latexrendered2.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image" style="padding-bottom: 63.52941176470588%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAtUlEQVQoz6WS2QqEMAxF+/8/KigULWYxSZsBAyJldApz35LmZKE3+bPqqZeC9DVrZnJKVRERAEZhRBQRd2+tufu2bTlnM4vwDVZVAFBVdyeiUso8z2ZWa42Oj3BXISLMjIhx+XEc3fDUjTWzK+xKmTk2GoK7FkQ0ChPRvu/3VxHpWqduyHWzqk7TlHO+w283BxO7tdbWdS2ldPkf/xz2cPdlWcIeV2bIYfFnAMDMIvJk0uR/6ANAGgPTTVN8JQAAAABJRU5ErkJggg=='); background-size: cover; display: block;" ></span> <img class="gatsby-resp-image-image" alt="Rendered figure with different font" title="Rendered figure with different font" src="../static/4032779787b17efc62bfd5446e2f73f7/a4de1/latexrendered2.png" srcset="../static/4032779787b17efc62bfd5446e2f73f7/e3b59/latexrendered2.png 170w,../static/4032779787b17efc62bfd5446e2f73f7/d6fe0/latexrendered2.pngg 340w../static/4032779787b17efc62bfd5446e2f73f7/a4de1/latexrendered2.pngng 680../static/4032779787b17efc62bfd5446e2f73f7/e9ece/latexrendered2.pngpng 102../static/4032779787b17efc62bfd5446e2f73f7/6b105/latexrendered2.png.png 1061w" sizes="(max-width: 680px) 100vw, 680px" style="width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;" loading="lazy" decoding="async" /> </a> </span></p> <p>This setup allows you to draw figures in Inkscape, while still having the power of LaTeX for typesetting.</p> <h2 id="creating-and-including-figures-quickly">Creating and including figures quickly</h2> <p>When I’m taking notes during a lecture, I need to be able to add a figure without disrupting my flow, and not spend time opening Inkscape, searching for the correct directory, typing the LaTeX code for including the figure manually and so on. To avoid this, I added some shortcuts to Vim for managing my figures. For example, when I type the title of the figure I want to create and press <kbd>Ctrl+F</kbd>, the following happens:</p> <ol> <li>The script finds the figures directory depending on the location of the LaTeX root file.</li> <li>Then it checks if a figure with the same name exists. If so, the script does nothing.</li> <li>If not, my figure template gets copied to the figures directory.</li> <li>The current line which contains the figure title gets replaced with the LaTeX code to include the figure.</li> <li>The new figure opens in Inkscape.</li> <li>A file watcher is set up such that whenever the figure is saved as an svg file by pressing <kbd>Ctrl + S</kbd>, it also gets saved as pdf+LaTeX. This means that the annoying pdf save dialog we’ve discussed before doesn’t pop up anymore.</li> </ol> <p>See it in action:</p> <p><img src="../a48c6ef9b7407f13e4e0e86b2649333f/including_figure.gif" alt="Adding a figure"></p> <p>When I want to edit a figure, I can press <kbd>Ctrl+F</kbd> in normal mode to open a selection dialog that allows me to search for figures in the current document. Upon selecting one, it shows me the figure in Inkscape. When I save the figure, the code for including it is copied to the clipboard. This way, I can reinclude it if I deleted the original code to do so.</p> <p><img src="../6f6ff7a6c0d74474ae9177369c8392a9/editing_figure.gif" alt="Editing a figure"></p> <p>These shortcuts make adding and opening figures a breeze. I don’t have to remember saving figures as pdf+LaTeX, pick the right directory or write the code needed for including the figure. The barrier to add a new figure is much lower than if I’d have to do those things manually. You can find my script for managing figures <a href="https://github.com/gillescastel/inkscape-figures" target="_blank" rel="nofollow noopener noreferrer">on Github</a>.</p> <p>Now that I’ve explained how I manage my figures, I’d like to talk about actually <em>drawing</em> figures in Inkscape.</p> <h2 id="drawing-figures">Drawing figures</h2> <p>While drawing figures in Inkscape is quite a bit faster than using Ti<em>k</em>Z in most cases, it is still slower than drawing them by hand. Using the built-in shortcuts of Inkscape speeds up the process but it still doesn’t hit the mark.</p> <p>Therefore, I decided to program a custom shortcut manager in Python which allows me to intercept all keyboard events before they reach Inkscape. This way, I have full control over how every keystroke gets interpreted, giving me a lot of flexibility.</p> <h3 id="drawing-shapes">Drawing shapes</h3> <p>Let’s start with the built in keyboard shortcuts of Inkscape. For example, <kbd>r</kbd> activates the rectangle drawing tool, <kbd>e</kbd> draws ellipses, etc. Implementation-wise, this means that the shortcut manager will ‘replay’ these keyboard events, i.e. it’ll just pass them through to Inkscape.</p> <p>However, instead of the default shortcuts <kbd>p</kbd> for pencil and <kbd>b</kbd> for the Bézier tool, I use <kbd>w</kbd> and <kbd>f</kbd>, as these are a bit more comfortable to reach while using a mouse with my right hand. In the spirit of making shortcuts left handed, I also mapped <kbd>z</kbd> to undo, <kbd>Shift+z</kbd> to delete, and <kbd>x</kbd> to toggle snapping which is normally the hard to reach <kbd>%</kbd> key.</p> <h3 id="key-chords-to-apply-commonly-used-styles">Key chords to apply commonly used styles</h3> <p>Styling objects is the second most common thing I do in Inkscape. The styles I use for drawing figures are quite simple:</p> <ul> <li>Shapes e.g. rectangles or circles are mostly black, light gray, white or transparent and optionally have a stroke.</li> <li>Lines (including strokes) are mostly solid, dotted or dashed. They can be (very) thick or have a normal width and optionally have an arrow on either side.</li> </ul> <p>These options combined give the following table of commonly used styles:</p> <p><span class="gatsby-resp-image-wrapper" style="position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 680px; " > <a class="gatsby-resp-image-link" href="../static/035512f7f15d2a082fc7508431161472/44b06/default-styles-names2.png" style="display: block" target="_blank" rel="noopener" > <span class="gatsby-resp-image-background-image"