<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gabriel Gambetta on Medium]]></title>
        <description><![CDATA[Stories by Gabriel Gambetta on Medium]]></description>
        <link>https://medium.com/@gabrielgambetta?source=rss-d14eb1b758------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fwbWjqZfSPAPUO1-OgdOcA.jpeg</url>
            <title>Stories by Gabriel Gambetta on Medium</title>
            <link>https://medium.com/@gabrielgambetta?source=rss-d14eb1b758------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:05:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gabrielgambetta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I wrote my first novel during my daily commute]]></title>
            <link>https://medium.com/@gabrielgambetta/how-i-wrote-my-first-novel-during-my-daily-commute-e1d02c9447b9?source=rss-d14eb1b758------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1d02c9447b9</guid>
            <category><![CDATA[writers-on-writing]]></category>
            <category><![CDATA[books-and-authors]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[fiction]]></category>
            <category><![CDATA[life-hacking]]></category>
            <dc:creator><![CDATA[Gabriel Gambetta]]></dc:creator>
            <pubDate>Wed, 10 Aug 2016 07:28:15 GMT</pubDate>
            <atom:updated>2017-06-29T15:15:22.859Z</atom:updated>
            <content:encoded><![CDATA[<h4>Writing a 330 page novel aboard Swiss trains, 40 minutes at a time.</h4><p>It is said that everyone has a book in them. Ask around and you’ll find most people have an amazing idea that would make for a great story — if they only had the time to write it! Having a full-time job, family, friends, and all these annoying “adult” responsibilities leaves little time to write. But I found the time I needed in the otherwise dead time known as “the commute”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yu5Yz0VAZRdN3xssqxBz7A.jpeg" /><figcaption>Every writer has their writing corner. Mine looked roughly like this.<em> (</em><a href="https://bahnbilder.ch/picture/4505"><em>Photo</em></a><em>: David Gubler / </em><a href="https://creativecommons.org/licenses/by-nc-sa/2.5/"><em>CC BY-NC-SA</em></a><em>)</em></figcaption></figure><p>I love Swiss trains. They’re comfortable, quiet, and always on time (some of these facts actually made it into the novel itself). But perhaps most importantly, I could almost always find a seat.</p><h3>Reverse-engineering Dan Brown</h3><p>Back in 2010 I found myself reading my third or fourth Dan Brown novel and thinking two things: “<em>This man knows how to write page-turners</em>” and “<em>I should be able to do this</em>”. I had written short stories before, but could I pull off a novel?</p><p>I set out to work. I did what felt natural, but in retrospect may have been a product of my engineering background: I created a spreadsheet with a Dan Brown novel in each column and a story point or character relationship in each row. Then I re-read the novels, taking copious notes as I went along, and filled this table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pGcGd4-huXN2Jv4B3-opKQ.jpeg" /><figcaption>The character and plot table.</figcaption></figure><p>Soon the structure underlying <em>The Da Vinci Code</em> and <em>Angels and Demons</em> and <em>The Lost Symbol</em> was laying bare before my eyes. I could see <em>why</em> the stories worked.</p><p>I had reverse-engineered Dan Brown.</p><p>So I took the obvious next step: I added a new column named <em>“my novel”</em> and set out to fill in the blanks. Although it ended up looking quite different, this column was the basis for what later became my first novel, <a href="https://www.amazon.com/dp/B00QPBYGFI"><strong>The Golden Legacy</strong></a><strong>.</strong></p><p>Four more years would pass before I had the first copy of the novel in my hands. As it turns out, writing is a lot of work.</p><h3>Laying out solid foundations</h3><p>I became obsessed with story structure. I needed to understand <em>why</em> novels and movies worked. I had to know the blueprint. I read book after book after book, from <em>The Hero with a Thousand Faces</em> to <em>The Screenwriter’s Bible</em> to the controversial <em>Save the Cat</em>, until I could see the underlying themes and principles that unified all the different structures and methodologies.</p><p>Writers come in two flavours: those who plan and those who don’t. Stephen King famously starts writing his novels without knowing how they will end; unsurprisingly, some people think that <a href="https://www.quora.com/Does-Stephen-King-have-issues-with-ending-his-books">endings aren’t one of Stephen King’s strengths</a>. I admire his bravery, but I know this wouldn’t work for me — I would be terrified of not knowing what I’d write next (as it turns out, this was one of the reasons I could write my novel during my daily commute).</p><p>I loosely followed the <a href="http://www.advancedfictionwriting.com/articles/snowflake-method/">Snowflake method</a>, devised by a novelist who also has a PhD in Theoretical Physics. In a nutshell, you describe the plot of your novel in a single sentence; then in a single paragraph; then in four paragraphs; then in four pages; then you make a list of every scene in the story; then you write. This fractal structure gives the Snowflake method its name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VDtE_9RYa4bAdEAUf4ABw.jpeg" /><figcaption>The scene list for <strong>The Golden Legacy</strong>.</figcaption></figure><p>My scene list ended up containing roughly 80 entries. I gave a lot of thought to the story structure, making sure there were no plot holes, that the actions of every character made sense at all times given their knowledge, situation and goals, and that the story itself was exciting and compelling.</p><p>This process took me three years. Of course, I wasn’t working on the novel full time — shortly after beginning this project, I moved to Zürich and started working at Google, so the novel was abandoned for months at a time.</p><p>But this also meant that my full time job and other life responsibilities didn’t leave a lot of time left to turn this list of 80 items into a 300+ page novel.</p><h3>Fighting writer’s block on Swiss trains</h3><p>My commute from Winterthur to Zürich Enge was around 40 minutes long. I developed the habit of sitting down and taking out my laptop in a single move. Writing requires focus so I had to train myself to put on my “writing hat” as soon as I sat down.</p><p>And so I started writing my novel, in two 40 minute chunks per day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y13HxoyHgXVY3OAUSuZi9g.jpeg" /><figcaption>The very satisfying results of all this effort.</figcaption></figure><p>This is where having my list of 80 scenes was extremely helpful. I began each writing “session” by reading the one-line description of the current and previous scenes, and the last couple of paragraphs I had written; this was enough to restore my mental context and continue writing where I had left before.</p><p>An unexpected benefit of this approach is that it also minimised the dreaded writer’s block. I discovered that writer’s block comes in two variants: not knowing what needs to happen next in the story, and not knowing how to write it. The first one was solved by having my 80 scene list; I <em>always</em> knew what needed to happen next. The second one was a consequence of under-specifying some of the scenes. “<em>The protagonist escapes</em>”. But how, exactly? Most of the time I just went ahead and improvised, giving myself permission to suck and promising myself I’d edit later, but more often than not, the results were reasonably good.</p><h3>The finishing touches</h3><p>It took me another year to write the full text of the novel on the train, and a few months to have a finished product — including editing passes, getting a cover, formatting the book for ebooks and print, and so on (this process is detailed in <a href="https://medium.com/techspiration-ideas-making-it-happen/how-i-wrote-and-published-my-novel-using-only-open-source-tools-5cdfbd7c00ca">this article</a>).</p><p>But I couldn’t be happier with the results. <a href="https://www.amazon.com/dp/B00QPBYGFI"><strong>The Golden Legacy</strong></a> has been well received. Some people have read it in a single sitting, which may be the best compliment I could have expected. And just the fact of holding your actual, tangible, physical book in your hands is hard to describe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*kQfsbqaLSukANX7LeN4d8Q.jpeg" /></figure><p><strong>The Golden Legacy</strong> is available on <a href="https://www.amazon.com/dp/B00QPBYGFI">Kindle</a> and <a href="https://www.amazon.com/dp/1505522439">paperback</a> on Amazon. If you want to read it but not buy it, <a href="/service/mailto:gabriel.gambetta@gmail.com">contact me</a> and I’ll be happy to get you a copy. This is my first novel, so feedback is extremely welcome!</p><p><a href="https://medium.com/@gabrielgambetta/how-i-wrote-and-published-my-novel-using-only-open-source-tools-5cdfbd7c00ca">How I wrote and published my novel using only open source tools</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1d02c9447b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I wrote and published my novel using only open source tools]]></title>
            <link>https://medium.com/techspiration-ideas-making-it-happen/how-i-wrote-and-published-my-novel-using-only-open-source-tools-5cdfbd7c00ca?source=rss-d14eb1b758------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cdfbd7c00ca</guid>
            <category><![CDATA[kindle]]></category>
            <category><![CDATA[self-publishing]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[publishing]]></category>
            <category><![CDATA[writing]]></category>
            <dc:creator><![CDATA[Gabriel Gambetta]]></dc:creator>
            <pubDate>Wed, 10 Aug 2016 07:25:43 GMT</pubDate>
            <atom:updated>2016-08-18T19:24:25.527Z</atom:updated>
            <content:encoded><![CDATA[<h4>From Markdown to paperback and Kindle without proprietary software.</h4><p>I&#39;ve recently published my first novel <a href="https://www.amazon.com/dp/B00QPBYGFI"><strong>The Golden Legacy</strong></a> on Kindle and paperback through Amazon, achieving very professional results. Along the way, I created a process and a couple of tools based exclusively on open source software. Here’s my process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zzdPQ4u61Q5rS6m_nqafQ.jpeg" /></figure><h3>The manuscript</h3><p>The most important piece of content for publication is the <em>manuscript</em> (i.e. the text of the novel). I originally started writing this in a Google Doc, but it soon became apparent that Offline Mode wasn&#39;t as robust as I expected (this was critical for me, since <a href="https://medium.com/@gabrielgambetta/how-i-wrote-my-first-novel-during-my-daily-commute-e1d02c9447b9">I wrote the whole novel during my daily commute</a>), and Docs had latency problems handling a really big document. So I wrote a quick script to export the text to <a href="https://en.wikipedia.org/wiki/Markdown">Markdown</a> and abandoned the Google Doc.</p><p>There are many editors for Markdown. For a brief period of time, I used <a href="http://texts.io/">Texts</a> on Mac, but in the end I went the old-school way with <a href="http://www.vim.org/about.php">vim</a> (gvim on Linux and mvim on Mac).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ne8aeFiS6CQE-b_oJCpiKg.jpeg" /><figcaption>Yes, that’s gvim running on Fedora 20.</figcaption></figure><p>I didn&#39;t use much formatting. I used # for chapter headers, ## for chapter subtitles (e.g. dates and locations), and indented text for preformatted monospaced sections (the novel includes some encrypted text the protagonists attempt to decode).</p><h3>Kindle and epub</h3><p>I created a separate Markdown file for the <em>front matter</em> of the book, that is, all the text that comes before the text of the novel itself (I consider the Prologue and the Epilogue integral parts of the story). The front matter includes the title page, colophon, and acknowledgements. I also had the book cover as a separate file.</p><p>The magical tool that converts this into an epub file is the fantastic <a href="http://pandoc.org/">pandoc</a>. Besides the text (both front matter and manuscript), it can also take the filename of a cover image, a metadata file, and a stylesheet file.</p><p>The metadata file is an XML file with <a href="http://dublincore.org/documents/dces/">Dublin Core</a> tags such as title, author, and copyright line. Although this information is already included in the front matter, this is metadata for the epub file itself, and not part of the text visible to the reader.</p><p>The stylesheet file is a CSS file that lets you customise the appearance of the book. In my case, I just modified the Header tags to be centered, but used the defaults otherwise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*12pKEzXbmypmFCjaXeGlaQ.jpeg" /><figcaption><strong>The Golden Legacy</strong> on a Kindle.</figcaption></figure><p>Pandoc produces a very good epub file with these inputs, but I wanted further customisation. Since an epub file is a zip file with some HTML and metadata, I wrote a quick Python script that unzips the file, moves a few things around in the content.opf file, and reassembles the epub.</p><p>This epub file is directly readable by Apple iBooks and Google Play Books. For Kindle, you create the same epub file but without the cover, and then upload the epub file and the cover image separately during the setup process in the <a href="https://kdp.amazon.com/">Kindle Direct Publishing</a> site.</p><h3>Paperback</h3><p>Creating the ebook files is straightforward. Paperback is substantially more complex, since you have full control over the formatting of the book.</p><p>I went with <a href="https://www.createspace.com/">CreateSpace</a>, which does print on demand, and is fully integrated with Amazon. For CreateSpace you need a cover file and an interior file.</p><p>The cover file is a high-resolution PDF file with the back cover, the spine, and the front cover, with a blank space where CreateSpace inserts the ISBN. There are templates and very exact guidelines on their website; just ask the cover designer to follow them.</p><p>The interesting part is the interior file. This is another PDF file which will be printed <em>exactly</em> as it looks, so it’s extremely important to get it right.</p><p>To create this file, I used Pandoc again, this time to convert the Markdown files to ODT (OpenDocument Text), which can be read by <a href="https://www.libreoffice.org/">LibreOffice</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bR5ADXdYso_OKGlk7a-UCA.jpeg" /><figcaption>Customising page styles in LibreOffice.</figcaption></figure><p>The key step is to provide a reference ODT file to Pandoc. Pandoc takes the styles, headers, and footers from this document and applies them to the output. So here is where you define the page headers and footers, the way chapter headings and subheadings look, and so on.</p><p>LibreOffice has many page formatting options that are non-obvious but incredibly important. For example, I wanted the first page of each chapter to be a right page, and to exclude the page header. I defined my chapter heading style to have a “page break before” and set a page style of “first page” (which is a right page without a header), which is followed by “right page,” which is followed by “left page,” which goes back to “right page.”</p><p>Getting the spacing right for the title page was tricky as well. I wanted it vertically centered, which doesn’t exist as a concept in Markdown, so I just inserted empty lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4BQzL-thqvXmaxQL-6rXg.jpeg" /><figcaption>The subtle details in formatting make a huge difference in how “professional” the book feels.</figcaption></figure><p>Once you’re satisfied with the result, you can print the document to PDF and upload it to CreateSpace.</p><h3>The results</h3><p>I couldn&#39;t be happier with the finished book — it looks fantastic! Give CreateSpace correctly formatted PDF files, and they will give you an absolutely professional-looking book. And holding your actual, tangible, physical book in your hands is hard to describe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*kQfsbqaLSukANX7LeN4d8Q.jpeg" /></figure><p><strong>The Golden Legacy</strong> is available on <a href="https://www.amazon.com/dp/B00QPBYGFI">Kindle</a> and in <a href="https://www.amazon.com/dp/1505522439">paperback on Amazon</a>. If you want to read it but not buy it, <a href="/service/mailto:gabriel.gambetta@gmail.com">contact me</a> and I’ll be happy to get you a copy. This is my first novel, so feedback is extremely welcome!</p><p><a href="https://medium.com/@gabrielgambetta/how-i-wrote-my-first-novel-during-my-daily-commute-e1d02c9447b9">How I wrote my first novel during my daily commute</a></p><h4>Published in Techspiration + Ideas + Making It Happen.</h4><figure><a href="https://medium.com/techspiration-ideas-making-it-happen"><img alt="" src="https://cdn-images-1.medium.com/max/720/1*n0J_5QvGZeLGFZnFnmsfQw.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cdfbd7c00ca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techspiration-ideas-making-it-happen/how-i-wrote-and-published-my-novel-using-only-open-source-tools-5cdfbd7c00ca">How I wrote and published my novel using only open source tools</a> was originally published in <a href="https://medium.com/techspiration-ideas-making-it-happen">Techspiration + Ideas + Making It Happen</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>