Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
I draw figures for my mathematical lecture notes using Inkscape (2019) (castel.dev)
312 points by marcodiego on May 1, 2022 | hide | past | favorite | 77 comments


When I started writing papers I was really bullish on tikz. I thought that professional looking papers should have figures that were precise to the mm. But the time it takes to get something useful is just insane. I quickly moved to the vectorial drawing tool I had handy: keynote. It’s really not made for that, but it has enough features that you can quickly use it to do pretty things. I ended up using keynote to do all the figures in Real-World Cryptography https://www.amazon.com/dp/1617296716/ref=cm_sw_r_cp_api_i_GA...

You can see some example in this thread: https://twitter.com/cryptodavidw/status/1436368473395925000?...


I personally use Adobe XD for almost everything vector. It's not the job it's made for, but it's way faster to work in and is easier to organize. No need to switch between lucidcharts, illustrator and XD when everything I need is in one place.


Nice work! On using tikz for vector graphics, I use it mostly for technical presentations. I'm terribly slow and abysmal at writing tikz code, but still I was hell-bent on using it—just because of the clean and smooth melding of text and diagrams. I should really look at other tools to save time. I can't justify spending so much time mucking around with tikz anymore.


Went through the Twitter thread and these look really great.

Clear, understandable, just enough detail and context.

Congratulations on creating this book and putting it out into the world.


> I quickly moved to the vectorial drawing tool I had handy: keynote. It’s really not made for that [...]

You would be surprised at how many figures are drawn with PowerPoint on papers at top Machine Learning conferences.


I would say a large proportion of top chemical/materials science papers are also drawn in only powerpoint (besides data, where origin>matlab>excel).


Oh and I forgot, I have some of my tikz here: https://www.iacr.org/authors/tikz/


With all the discussion here about alternative programs to make vector graphics for mathematical figures, I'm a little surprised no one has mentioned Ipe (https://ipe.otfried.org/), given it's far and away the most popular tool in my field (and has good native support for LaTeX expressions).

It certainly doesn't have all the features that Inkscape supports (although it does have quite a lot of features), but the features it does have are implemented with a heavy emphasis on ease-of-use. It's sometimes easier to brainstorm within the program than on paper.

It's also plenty easy to add useful plugins in Lua: At one point I coded a plugin to check if a diagram of a graph contained a Hamiltonian cycle (by calling an external C++ program I wrote that used simple backtracking). I was able to very quickly experiment with which of my small graphs and modifications to said graphs ended up having Hamiltonian cycles, and was able to narrow down some useful features to think about.


What is your field?

As someone who likes the idea of and quality of images that TikZ produces but not how obtuse it is, I've done a fair amount of research into this space at times. However, I've never heard of Ipe. Even if I had, I'm not sure I'd use it. The material is basically devoid of examples. How does one learn how to use it?


I work mostly on computational geometry and graph algorithms, and some related things (although I certainly don't have a very long list of publications). Ipe is written entirely by one person (Otfried Cheong), who works on a lot of computational geometry, which is likely part of why it's most well-known among this group. I've used Ipe for every diagram in every paper I've ever published, and I used them for all the figures in the slides of a course I taught a couple years ago. Clearly I'm a bit biased, but having used TikZ a small but painful number of times during my undergraduate degree, I'd be more than happy if I never have to work with it again.

Like everyone else I know, I learned Ipe through trial and error, with a handful of little tidbits of advice. 90% of the functionality you will use is quite intuitive and right there on the interface if you hover over things (and all the tools also have keyboard shortcuts of course). Some of the tips I've given/been given over the years that are less intuitive are: - You can save directly in PDF and re-edit a PDF saved with Ipe. This is very helpful for a LaTeX project, since PDF files are very easy to import (even ones with multiple pages). - When you import into a LaTeX project, the dimensions of the figure will be cropped to the dimensions of the actual content (this may be obvious to some, but it wasn't to me). - You can edit the alignment of text (and other various hidden options) by right clicking on objects in select mode. - The different snapping modes are probably the killer feature of Ipe. You can snap to the intersection of curves, to the vertices of polylines, and much more. Between the intersection snapping mode, circle tool, and line segment tool, you can technically perform any compass-ruler construction you want from Euclidean geometry (with has been useful a handful of times for me surprisingly). - Selection of objects is a bit funny (but often useful): If you select from top-left to bottom-right, then you will only select things your selection box fully encapsulates. If you select instead from bottom-right to top-left, you will select anything your selection box intersects. - Writing extensions and editing configs (incl changing page dimensions, colour palette, text size palette) is unfortunately quite painful, and I can only recommend digging through the examples. I believe there is documentation somewhere, but I found it less than helpful. - You can edit the underlying points of any curve you place after the fact by using the "edit" option in the right-click menu. - In order to use the regular k-gon "ipelet" (under ipelets->goodies IIRC), you need to have a circle present first (which you can of course delete afterwards). Ipelets are the mechanism by which you can program functionality with Lua, and this is probably the one I use the most (it comes built in with the program).

In my personal opinion, the only major weak point of Ipe is how annoying it is to rotate things (to the point where I often prefer to redraw things in rotated form, unless it's quite complex). To do this you need to very carefully select a pivot point type and a rotation type through the right-click menu. You also have to be very conscious of snapping as you perform the rotation.


Agreed. IPE is far far superior to Inkscape for mathematical diagrams. Honestly Inkscape is rather painful to use just for arty stuff. Using it for precise diagrams with maths labels sounds downright masochistic.


Ipe is to my mind the rightful moral heir to Xfig. Love both for their support for latex.


Inkscape is great for technical figures, especially cartoons like the examples shown here. At least in my field, purely conceptual futures are called "cartoons" to distinguish from "figures" which are based on observational data.

A former advisor of mine had a quote that I'll happily steal here: "A cartoon is the highest form of scientific communication". Distilling a concept down to a very simple illustration is an underappreciated artform.

Inkscape is really great for scientific cartoons. I've used illustrator for many years, as well, and it's more powerful, but lacks something for quick bare-bones sketches compared to inkscape. There are things that illustrator is far better suited for, but these sort of conceptual sketches are kind of a sweet spot for inkscape.


I saw in your profile that you’re a geologist, and as a geology major about to finish my undergrad I’m particularly interested in how you’ve used Inkscape to create scientific cartoons.

I’ve been using Inkscape to complete assignments for my classes, and it’s been an uphill (yet rewarding!) battle. It seems that my professors and peers each have a different program of choice, so I decided to forge my own way with OSS.

My contact info can be found in my profile if you prefer.


I've used it for figures, posters, etc for many years. For the most part, no one cares too much about what you use, more about the final figure. If you're working so closely with someone that you're sharing raw files (e.g. they're using illustrator and want you to share a .ai file), you're going to hit issues, certainly.

However, most work will focus on the end result -- i.e. a paper with static exported figures.

At any rate, there's nothing wrong with the proprietary tools either -- they're great. It's just a matter of what you can get access to and what's best for the use case at hand.

If it helps to have some examples, pretty much every figure in my dissertation was made with a combination of matplotlib, QGIS, and Inkscape: http://digital.library.wisc.edu/1711.dl/YHJWFVKMNVZGN8S E.g. see fig 2.12 for a cartoon made purely in Inkscape and things like fig 2.4 or 2.6 are a combination of matplotlib and Inkscape.


This should have a (2019) in the title. If I'm not wrong, somewhere between 2019 and now Inkscape 1.0 was released. And now the betas have numerous new features and UI changes, most notably the introduction of multiple pages in a single document.

Besides, framing Inkscape as 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" seems poor and rather unfair to it. Its compliance to the SVG standard makes it the best tool to produce scalable graphics for the web and it's extensively used to develop icon systems and theming in multiple FOSS software.


Heh. I must have missed the introduction of the multiple pages feature. I used to hand-write math homework in Inkscape with a Wacom tablet. I found it unusually effective, but the single page limit always made longer problems a bit unwieldy.

(Note: I could never get my head around doing problem sets directly in LaTeX, although I did mostly OK using it for proofs in my analysis classes.)


Multiple pages? Finally! I started making slide presentations in Inkscape, and the option of exporting to multi-page PDFs will come in handy!

More info: https://wiki.inkscape.org/wiki/index.php?title=Release_notes...


Year added above. Thanks!


But have any of the issues the article addresses been smoothed out?

The guy basically built a whole macro layer to make inkscape less clunky


The UI is getting fixed up in piecemeal fashion, gradually moving around elements or consolidating them. If you want to see the full details, the devs stream and record video showing progress and reviewing major new versions.

Specific to this article, the alignment tools have recently gotten a pass of updates - something which everyone doing technical drawings can make use of. Layers and objects have been merged into one panel and the update performance of the panel uses a more scalable algorithm now, making it easier to navigate the document in outline form and reducing some of the burdens of object manipulation that the author calls out to external code for.

Styling still needs improvement but IIRC there is work in progress on swatches that might address that.

It's now possible to use a command bar to type in commands (as is the trend with every complex app) which addresses some of the use of macros. Shortcut binding is in need a pass to improve assignability; that would eliminate a second source of pain.


Call me cheugy, but there is absolutely no way that I'd be able to use any computer graphics tool effectively during a lecture to draw diagrammatic notes of any substantial complexity, and pay attention to the lecture at the same time.


Depends on how well you know the tool. I wrote my lecture notes for Graph Theory in LaTeX+TikZ, but it only went well because I had been doing TikZ drawings frequently for about 2 years by that point, and also the course was introductory level, so the drawings were rather simple.

For most other courses, we had a process involving at least two people, wherein one person would take notes in LaTeX with placeholders where the images need to go, and one person would take notes by hand, including images. Then we would produce the drawings either via TikZ or via Inkscape afterwards. This could be streamlined into one person doing LaTeX notes with placeholders, who also drew the images on paper to later insert them into the digital version.


I love inkskape, but I wish it took some interface tips from modern graphical software like Sketch. Inkscape's interface hasn't changed much in the last 15 years or more, and since then a LOT has changed in the UX world. Tools like Sketch and Figma introduced so many tiny interface and usability improvements, that when combined with each other they raise productivity be a factor of 10 or more for tasks like drawing a vector icon.


As a counterpoint, I recently had to use Inkscape for a few non-trivial tasks after not having used it for years, and I was pleasantly surprised that all the tools and functionalities were still in the same place as they were all those years ago. I was extremely glad that I did not have to struggle with and decipher a newfangled UX but could instead just do what I wanted in a quick and easy fashion without having to relearn it.


If you know Inkscape, you'll feel right at home with Sketch. The extra functionality I'm talking is usually unlocked with additional hotkeys and visual helpers that appear by themselves when dragging things around. I'm not exaggerating about 10x productivity boost, it is really that big.


Looked it up, it seems more targeted to page layout applications. Is it really that much better for something like a drawing in a math textbook?


For that specific goal, maybe, no. Sketch really excels when doing vector designs that are going to be presented in a raster displays, so a lot of its features revolves around a pixel grid.

Inkscape does not care about pixel grid, being an SVG vector editor, but it still could use some modern interface tricks, like various stroke/outline options, nudge settings and rulers for measuring distances between objects.


Steam's UI hasn't changed a lot either really. A UI that works well doesn't have to change much and probably shouldn't. I personally greatly dislike the modern web UI look with text boxes the size of Mt. Rushmore.


The many random sidebars in Inkscape are a bit questionable, but I prefer its UI over many modern ones. The UI just works for me for the cases, where I use Inkscape.


What I'd like to see is a constraint solver, where e.g. you can fix distances, angles, projections, etc.

Also missing is Path->Calligraphic stroke conversion, arguably the most important tool for cartoon drawing.


Having experimented a bit in the space i think constraint solvers are actually a little overhyped for 2d drawing. I find just being able to do math and rendering the drawing from text to be enough.


Ok. How about a way to enter LaTeX expressions in-place?


TexText (Re-editable LaTeX graphics for Inkscape) is a neat plugin. https://textext.github.io/textext/index.html


I remember I tried to use Inkscape for a logo once and was so frustrated I ended up just writing the SVG in to jsfiddle because I couldn’t work out how in Inkscape.


Of several FOSS tools I regularly use for technical diagrams Inkscape has the best balance of olskool accurate features and modern "designy" type stuff. XFig is my old friend, and I love its inbuilt library of 1970's style clip art, icons, and technical symbols. But XFig feels clunky now. Dia is a useful quick tool for drawing boxes and sticks. But Inkscape has the overall balance right. Light enough to draw a quick diagram, featured enough to design a book cover or complex layered diagram. One feature I love is scanning/tracing bitmaps to layered SVG objects that can be broken apart, simplified and remixed. I noticed when using Openshot video editor under Linux recently that it integrates seamlessly with Inkscape and Blender for designing animated titles.


This seems like the right thread to ask.

I love the idea of tools like these to be able to easily and programmatically draw diagrams, but eventually it gets thrown into a powerpoint, where then it is locked behind some tool and arcane DSL that only I know. So when my boss who doesn't care about the tools inevitable wants to move the arrow up an inch or make the box green instead of blue, I have to go back to do it. Meaning I give up on using these tools so I don't end up a fulltime diagram engineer.

Anyone know of a tool that is close to inkscape/graphviz, but has an "export back to powerpoint" feature?


If the boss wants to "move arrows up" then it is possible, that the boss should have been involved in the design process, or keep feedback for later to be worked in, but not in the middle of a presentation.

And please ... Don't do software modelling in powerpoints. It is quite painful to watch that happening. It lowers interest in contributing of people, who would have used a proper tool for such a job and would have been 3x faster that way.


Have had to do lots of technical / latex-y drawings in the past as academic, and found Ipe [0] to be incredibly useful.

It is very minimalistic and easy to use. The images produced are simple to embed in latex documents, and they fit the style/font of the rest of the document. I think this tool should be a lot more popular than it is.

[0] https://en.wikipedia.org/wiki/Ipe_(software) -- using the wikipedia link since the official site doesn't have many screenshots


These look excellent.

On the other hand, I still make an embarrassing amount of technical figures using powerpoint built in shapes.


Try https://excalidraw.com/ - it's SUPER NICE for these simple "shape" diagrams.


I wish there was something as polished and easy to use as excalidraw that wasn't as minimalistic in its features.


I like the minimalist featureset. I end up making the sketch, not shaving the yak. Yes a rectangle makes a perfectly good text input, and also a mobile phone screen. It's a versatile shape!


Question: how do you add a label to an arrow (such that it stays on the arrow if you move it)?


You can select the label and the arrow and press control+G to create a group.

You can also do the opposite, pin the arrow to the label so that if the label moves the arrow follows: double click the arrow to see the path points, select an end point and move it on top of the label until you see the bounding box of the label.


I tried it but it only semi-worked. The label moves with the arrow, but if I move one side of the arrow (by moving the box it is attached to) the label does not move. (Note: I want the label on the arrow, not on its endpoints).


It is a very nice looking tool, but I can't live without ellipse arcs. The bezier elbow lines always look so cheap to me.


If it works, it works.


Until it doesn't and you have to redo your entire drawing in another tool ...

It is always better to choose a tool where you're least likely to run into a dead-end street.


If you know in advance that you're not going to need a more powerful, more complicated/expensive/... tool, then it's okay and even recommended to use the "lesser" tool. If I need to screw in a few screws, am I better off buying a small screwdriver or a professional 18V screwdriver/drill combo with 24 add-ons? Who knows, it depends on my projects and my skills, but it's entirely possible that buying the $5 screwdriver is the appropriate thing to do.


That's a bad example because you can always switch to the powertool if needed without building your project from scratch.


This looks awesome.

I'd pay $50 to have this workflow fully integrated and working with my editor (emacs; I'd also take VSCode or something else that's not vim). apt-get install a few things, and it works.

That's conveying value-add, not suggesting someone should do it for that amount (which is to say I'd gladly pay, but I can't imagine it's worth doing for that amount, or that there's a reasonably way to find and collect $$$ from more people like me).


Emacs integration for the OP's style of inkscape usage[1]

My fork with personalizations[2]

Org-mode integration for Krita[3] and Xournal[4]

[1] https://github.com/foxfriday/ink [2] https://github.com/karthink/ink [3] https://github.com/lepisma/org-krita [4] https://gitlab.com/vherrmann/org-xournalpp


Thank you!


One of my pet theories/takes is that if any billionaire wants to make science more productive they need to fund a modern replacement of LaTeX and really streamline flows for things like this.

TikZ in particular but latex in general has awful compile times in part because of it's ancient design.


> modern replacement of LaTeX

It's one of the most reliable and useful pieces of software, and it seems to be doing just fine. Most efforts at modernization focus on extension, either with packages, other languages, GUIs, etc.

> latex in general has awful compile times in part because of it's ancient design.

I would expect the "ancient" to mean it's faster, as it was designed for a more restricted resource environment, and Knuth tailors optimal algorithms for each task. For example, the single-pass is ergonomically a pain, because you often have to run it multiple times to get the final output but it also makes it faster.

Do you have ideas about alternative architectures that would improve performance?


> It's one of the most reliable and useful pieces of software, and it seems to be doing just fine. Most efforts at modernization focus on extension, either with packages, other languages, GUIs, etc.

I love LaTeX and use it everyday, and in particular I have no gripes with compile time, but honestly it's only doing just fine (in terms of usage) because there's no alternative, not due to its own merits. Because the UX is ridiculously outdated.

- Needing to compile 2 or 3 times to get the document right (and not having an option of doing it automatically or been warned about it).

- Need to include an unusual Unicode character? Good luck navigating the different packages for character encodings, font encodings, etc. A couple of days ago we needed to include Қ (Tajik/Uzbek/Kazakh character) and after a few hours of googling and desperately trying several solutions that in theory should work, we ended up including a vector image of the character created in Inkscape (funnily enough the workaround is less bad than it sounds, because the Inkscape image actually has the character as a character, and latex is smart enough to make it copy-pastable as any other text character). Honestly in 2022 any software should Just Work(tm) with Unicode, period. It's trivial to write Қ in a modern browser and have it appear in HN, for example.

- Interactions between packages making a mess, so when you want to pitch your paper to a new journal and adopt their template, multiple errors start to come up, and after trying to decipher some cryptic messages, you find the hard way that some table package you're using is incompatible with the journal template.

- Related to the previous... error messages are sometimes extremely cryptic. Especially when something you do causes an error to be caught inside a package you're using, and you get pointed to a line that doesn't even relate to your code at hand.

- There is nothing to ease the learning curve, so entire scientific fields won't touch it. Why can't we have something that is as simple as Markdown if you just want to create a simple document with headers and lists, and where complexity is added as you need it?

I use LaTeX because all alternatives I know are worse but to me, it's a clear example of a local minimum where we are stuck. It would take a lot of effort to create something better so no one does it, and as a result we have to do with an UX from the 80s. I just wish people wouldn't act as if it were the bee's knees every time its obvious aging is mentioned.


I agree the UX is clunky, that just wasn't the criticism expressed in the comment I responded to.


By that logic C and C++ should compile really fast because of the preprocessor. It's possible to do a really fast preprocessor so obviously the overall system is fast, surely!?


C does compile extremely fast. C++ does too, except that as computers have become faster developers have pushed the generics further.


Lol a simpler latex is so far down my list of what needs to be fixed in science it’s comical as a suggestion.

Here are three options for you: 1. Use latex as is, if this is your bread and butter the initial setup and learning curve is a few weeks. 2. Use overleaf. And please don’t start on “I’ll never submit my data to a cloud” no billionaire is going to not take your data. 3. Use word and let your assistant digitize your diagrams.

Point is the tool to make figures is not what’s slowing down good science. It’s the heads that do it that are a problem


I think it does slow down progress enough to be worth considering because it's clunky but more importantly because it's ancient so there is almost no ability to extract metadata or properly target anything other than print as a first class target. In teaching for example I think a book of basically just symbols is dated, we should be trying richer ways to display textbooks (e.g. beyond mere hypertext), using information either annotated or extracted from the source.

This isn't about figures but rather making it more productive to use in general, and making its use more semantically analysable, and more deterministic: If you include data in a paper is it actually up to date? Does that expression actually solve the equation etc. These are all things you could check automatically.

There are obviously bigger problems in science but what are you gonna do about them? It's nearly all political either in the department's or in government, whereas a new LaTeX is a relatively direct thing that can be done with a small team and a lot of money.


I am thoroughly ashamed that I have overlooked the option to render text through latex for all these years.


I use Geogebra to draw, and then export as PGF/TikZ. You can then edit the code to fine-tune or make any modifications. Works very well. The advantage is that you can also include plots in the figures along with SVG. Not sure if Inkscape allows that.


Can someone recommend me an Ubuntu friendly application that’s one step up from MS Paint?

I find Inkscape and GIMP far too heavy and tedious for my needs: I work remote and just want to doodle on a screenshot.


> Ubuntu friendly application that’s one step up from MS Paint

mtPaint -- For Windows and Linux, and very stable. (https://en.wikipedia.org/wiki/MtPaint)


If you're actually using Windows (you mention MS paint), there's built-in functionality to doodle on screenshots. It's built on the same tech as e.g. onenote so it's surprisingly good. Just press win+shift+s. For an existing photo/screenshot, just open it with the default image viewer and click modify.

And the "pro-tip", if I may: when you take a screenshot, it gets copied in your clipboard. Try pasting it somewhere. It works in an astouding number of places.


As mentioned below, there's Krita, which is very drawing oriented. Maybe also Xournal++ - I use it for drawing on/annotating documents on video calls.


Try flameshot. It’s a screenshot tool that has a builtin mini editor with arrows, lines, drawing, etc. very basic but still useful for marking up a screenshot.


KolourPaint is a better alternative to MS Paint with pretty much the same UI.


You might try Krita.


I've been pretty happy with pinta for that sort of thing


Check out the drawing mode in TeXmacs:

https://www.youtube.com/watch?v=baF3kpx_JSo


I use a variety of options depending on the complexity of the illustration. I use tikz for very simple figures, while geogebra for mathematical ones with tikz/pgf export. I use Inkscape to render drawings which have more elements and are complex with latex output included.


I use a program called Latexdraw that gives the best of both worlds. You can draw with the GUI and get pstricks code and use latex expressions and math fonts. (Free, author accepts donations) http://latexdraw.sourceforge.net/


Curious about the right side of terminal, there is a white screen. Is this integrated into the terminal, or is this a different window?


OP shared the link without even reading it!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: