Skip to content →

Year: 2016

Ulysses and LaTeX

If you’re a mathematician chances are that your text-editor of choice will be TeXShop, the perfect environment for writing papers. Even when writing a massive textbook, most of us stick to this or a similar LaTeX-frontend. The order of chapters in such a book is usually self-evident, and it is enough to use one TeX-file per chapter.

If you’re a blogger, chances are you spend a lot of writing time within the WordPress-editor. If you have a math-blog, there’s no longer the issue of including TeX-output images in some laborious way, thanks to MathJax. Even for a longer series of blog-posts there’s no problem staying within the WordPress-environment.

However, if you’re reckless enough to want to write a novel, or a math-book for a larger audience, you may need different equipment.

You will have to be able to follow story-lines, to follow your main characters throughout the plot, get word counts on scenes and chapters, jot down ideas and results from research, but most of all: you will have to be able to remain focussed just on your writing, as far away as possible from all bells and whistles and thrills of internet and preview-on-the-go editors.

In short, you may consider moving all of your writing to Ulysses.

I’ve been an early adopter from the days their iPad-app was called Daedalus, which I found cute, being a pathetic Joyce-fan. However, the app’s iCloud syncing sucked, but it is now replaced by the Ulysses.app which works like magic, syncing every keystroke between iPad, iPhone and whatever Mac you use as your workhorse.

But, what if you want to write about math and are unwilling to ban all LaTeX-formulas from your text.

Well, I’ve tried everything, including the approach below (in a faulty way), and figured it was impossible due to the fact that Ulysses is a MarkDown editor in which underscores are entirely different from indices.

Fortunately, yesterday Eline Steffens posted “Writing Mathematical Equations in Ulysses” showing me what I did wrong.

If you want MathJax to parse your text you need to include the standard code in your header. What I missed was that you have to include it as a ‘Raw source block’ (under ‘Markup’ in Ulysses).

Further, I forgot to prepend dollar-signs with a tilde, which works as an escape character in Ulysses so that all underscores are safe within the LaTeX-boundaries.

But now it works like a charm.

Ulysses is able to export your text in a variety of ways. You can preview it as HTML, including all rendered LaTex, and you can export directly either to Medium (on which I should begin to cross-post stuff asap) or your own WordPress-site.

In fact, I wrote this in Ulysses, then clicked the export-icon, choose ‘Publishing’ and NeverEndingBooks, and bingo I was able to post it as a draft. I can even fill in categories and tags, even add the featured image appearing at the top of this post, check everything in WordPress-admin and hit: “Publish”.

I guess I’ll be doing all my non-paper writing from now on entirely in Ulysses.

Leave a Comment

NaNoWriMo (2)

Two more days to go in the NaNoWriMo 2016 challenge. Alas, it was clear from the outset that I would fail, bad.

I didn’t have a sound battle plan. Hell, I didn’t even have a a clue which book to write…

But then, I may treat myself to a SloWriMo over the Christmas break.

For I’ve used this month to sketch the vaguest possible outlines of an imaginary book.

ulysses2

[section_title text=”An imaginary interview”]

Question: What is the title of your book?

I don’t know for sure, but my working title is Primes and other imaginary shapes.

Question: What will the cover-illustration look like?

At the moment I would settle for something like this:

Question: Does your book have an epigraph?

That’s an easy one. Whenever this works out, I’ll use for the opening quote:

[quote name=”David Spivak in ‘Presheaf, the cobbler'”]God willing, I will get through SGA 4 and Lurie’s book on Higher Topos Theory.
[/quote]

Question: Any particular reason?

Sure. That’s my ambition for this book, but perhaps I’ll save Lurie’s stuff for the sequel.

Question: As you know, Emily Riehl has a textbook out: Category Theory in Context. Here’s a recent tweet of hers:

Whence the question: does your book have a protagonist?

Well, I hope someone gave Emily the obvious reply: Yoneda! As you know, category theory is a whole bunch of definitions, resulting in one hell of a lemma.

But to your question, yes there’ll be a main character and her name is Alice.

I know, i know, an outrageous cliché, but at least I can guarantee there’ll be no surprise appearances of Bob.

These days, Alices don’t fall in rabbit holes, or crawl through looking-glasses. They just go online and encounter weird and wondrous creatures. I need her to be old enough to set up a Facebook and other social accounts.

My mental image of Alice is that of the archetypical STEM-girl

In her younger years she was a lot like Lewis Carroll’s Alice. In ten years time she’ll be a copy-cat Alice Butler, the heroine of Scarlett Thomas’ novel PopCo.

Question: What will be the opening scene of your book?

Alice will post a question on Lego-stackexchenge, and yes, to my surprise such a site really exists

(to be continued, perhaps)

Leave a Comment

Grothendieck topologies as functors to Top

Either this is horribly wrong, or it must be well-known. So I guess I’m asking for either a rebuttal or a reference.

Take a ‘smallish’ category $\mathbf{C}$. By this I mean that for every object $C$ the collection of all maps ending in $C$ must be a set. On this set, let’s call it $y(C)$ for Yoneda’s sake, we can define a pre-order $f \leq g$ if there is a commuting diagram

$\xymatrix{D \ar[rr]^f \ar[rd]_h & & C \\ & E \ar[ru]_g &}$

A sieve $S$ on $C$ is the same thing as a downset in $y(C)$ with respect to this pre-order. Composition with $h : D \rightarrow C$ gives a map $h : y(D) \rightarrow y(C)$ such that $h^{-1}(S)$ is a downset (or, sieve) in $y(D)$ whenever $S$ is a downset in $y(C)$.

A Grothendieck topology on $\mathbf{C}$ is a function $J$ which assigns to every object $C$ a collection $J(C)$ of sieves on $C$ satisfying:

  • $y(C) \in J(C)$,
  • if $S \in J(C)$ then $h^{-1}(S) \in J(D)$ for every morphism $h : D \rightarrow C$,
  • a sieve $R$ on $C$ is in $J(C)$ if there is a sieve $S \in J(C)$ such that $h^{-1}(R) \in J(D)$ for all morphisms $h : D \rightarrow C$ in $S$.

From this it follows for all downsets $S$ and $T$ in $y(C)$ that if $S \subset T$ and $S \in J(C)$ then $T \in J(C)$ and if both $S,T \in J(C)$ then also $S \cap T \in J(C)$.

In other words, the collection $\mathcal{J}_C = \{ \emptyset \} \cup J(C)$ defines an ordinary topology on $y(C)$, and the second condition implies that we have a covariant functor

$\mathbf{J} : \mathbf{C} \rightarrow \mathbf{Top}$ sending $C \mapsto (y(C),\mathcal{J}_C)$

That is, one can view a Grothendieck topology as a functor to ordinary topological spaces.

Furher, the topos of sheaves on the site $(\mathbf{C},J)$ seems to fit in nicely. To a sheaf

$A : \mathbf{C}^{op} \rightarrow \mathbf{Sets}$

one associates a functor of flabby sheaves $\mathcal{A}(C)$ on $(y(C),\mathcal{J}_C)$ having as stalks

$\mathcal{A}(C)_h = Im(A(h))$ for all points $h : D \rightarrow C$ in $y(C)$

and as sections on the open set $S \subset y(C)$ all functions of the form

$s_a : S \rightarrow \bigsqcup_{h \in S} \mathcal{A}(C)_h$ where $s_a(h)=A(h)(a)$ for some $a \in A(C)$.

2 Comments