{"id":141663,"date":"2022-10-03T11:05:37","date_gmt":"2022-10-03T16:05:37","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=141663"},"modified":"2022-10-03T11:19:09","modified_gmt":"2022-10-03T16:19:09","slug":"ligatures-for-logic","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2022\/10\/03\/ligatures-for-logic\/","title":{"rendered":"Ligatures for Logic"},"content":{"rendered":"<p>A ligature in typesetting is a way of presenting two (or more) consecutive characters differently the individual characters would be displayed. For example, &#8220;fi&#8221; is often rendered with the top of the &#8216;f&#8217; dotting the &#8216;i&#8217;. Here&#8217;s an example from Computer Modern, the default font in LaTeX.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/fi_tex.png\" alt=\"fi\" width=\"25\" height=\"35\" \/><\/p>\n<p>Usually the difference is subtle\u2014ordinarily readers are not consciously aware of them\u2014but a ligature could look entirely different from its components. The <a href=\"https:\/\/www.johndcook.com\/blog\/2022\/10\/02\/flags-unicode\/\">previous post<\/a> is an example of the latter: the two-letter abbreviation for a country is rendered as the flag of that country.<\/p>\n<p>I&#8217;ve been playing around with <a href=\"https:\/\/github.com\/tonsky\/FiraCode\">Fira Code<\/a>, a font with ligatures for programming. Fonts like this aim to do for programming what ordinary ligatures do for prose. For example, a programming font might include a ligature to render <code>&gt;=<\/code> as \u2265.<\/p>\n<p>Programming fonts are obviously intended for use in programming, but I personally don&#8217;t like the idea of using ligatures in programming. They compromise the simplicity of plain text [1]. They&#8217;re supported in some environments but not in others, or they require some fiddly configuration before they&#8217;ll work, etc.<\/p>\n<p>Still, I like the aesthetics of Fira Code, particularly in the way it handles logic symbols. Here are some examples comparing a common monospace font and Fira Code.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/inconsolata_fira1.png\" alt=\"(a =&gt; b) &lt;=&gt; (\u00aca \\\/ b), {a} |= a \\\/ b, |= p \u2192 |- p\" width=\"600\" height=\"150\" \/><\/p>\n<p>The image above is a screen shot of a document created in LibreOffice Writer. The ligatures didn&#8217;t work when I tried using them in Microsoft Word.<\/p>\n<p>The Fira Code was designed as a monospace font, but has been <a href=\"https:\/\/fonts.google.com\/specimen\/Fira+Code\">extended<\/a> to include proportional fonts. Fira Code with a proportional font might be useful in prose documents. You could insert a few symbols with a couple key strokes rather than searching for the symbol or entering Unicode.<\/p>\n<p>However, it seems most of Fira Code&#8217;s ligatures are only available in monospaced versions of the font. If you use Fira Code in a prose document, you could switch from proportional font to monospace font just for an occasional symbol. It&#8217;s unclear whether that would be more or less work than other alternatives.<\/p>\n<p>There&#8217;s one place where I believe Fira Code would be ideal: code examples inside a prose document. In that context you care about aesthetics <em>and<\/em> you want a monospaced font. Here again are some examples comparing Inconsolata and Fira Code.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/inconsolata_fira2.png\" alt=\"if (a &gt;= b \/\\ c != d) {\u2026}\" width=\"525\" height=\"115\" \/><\/p>\n<h2>Related links<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/twitter.com\/logicpractice\">Logic Twitter account<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2018\/10\/29\/typesetting-modal-logic\/\">Typesetting modal logic<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/applied-logic\/\">Large-scale logic<\/a><\/li>\n<\/ul>\n<p>[1] If you use Fira Code font, your code doesn&#8217;t change a bit. You can have some aesthetic improvements along with the advantages of working in plain text. But it may not just work without some research and experimentation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A ligature in typesetting is a way of presenting two (or more) consecutive characters differently the individual characters would be displayed. For example, &#8220;fi&#8221; is often rendered with the top of the &#8216;f&#8217; dotting the &#8216;i&#8217;. Here&#8217;s an example from Computer Modern, the default font in LaTeX. Usually the difference is subtle\u2014ordinarily readers are not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[18],"tags":[150],"class_list":["post-141663","post","type-post","status-publish","format-standard","hentry","category-typography","tag-logic"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/141663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=141663"}],"version-history":[{"count":0,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/141663\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=141663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=141663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=141663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}