{"id":345,"date":"2021-02-21T07:32:37","date_gmt":"2021-02-21T06:32:37","guid":{"rendered":"https:\/\/www.benscoat.eu\/?p=345"},"modified":"2021-02-21T07:32:38","modified_gmt":"2021-02-21T06:32:38","slug":"open-new-libreoffice-documents-easily","status":"publish","type":"post","link":"https:\/\/www.benscoat.eu\/index.php\/2021\/02\/21\/open-new-libreoffice-documents-easily\/","title":{"rendered":"Open New LibreOffice Documents Easily"},"content":{"rendered":"\n<p>After the most successful poll in Twitter&#8217;s history, I switched from Office to LibreOffice more than one year ago. There were many reasons to this shift, the main one being my <strong>non-willingness to pay a licence for software that I use less and less<\/strong>. For instance, Excel is only a UI to have a glance at data, since I analyse and produce graphics and summaries from them exclusively with R; and I use Word and PowerPoint only for compatibility with my colleagues, since I use LaTeX, Markdown, or R to produce text documents and presentations.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"twitter-tweet\" data-width=\"550\" data-dnt=\"true\"><p lang=\"en\" dir=\"ltr\">I&#39;m running macOS and I&#39;m seriously considering moving from Office to an alternative. Any advice?<\/p>&mdash; Benjamin Dietre (@bencfd) <a href=\"https:\/\/twitter.com\/bencfd\/status\/1176877138592632832?ref_src=twsrc%5Etfw\">September 25, 2019<\/a><\/blockquote><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div><\/figure>\n\n\n\n<p>However, on macOS, LibreOffice is not a bundle of several apps (Writer, Calc, Impress), but a single application that contains the modules necessary for all these features. The application dynamically shows on the UI only the relevant modules (eg only the ones for a text document, for a spreadsheet, or for a presentation). I&#8217;m fine with that, except that <strong>there is no shortcut to open any given type of document<\/strong>. If you&#8217;re running a text-focused UI, the shortcut to open a new document opens a new <em>text<\/em> document. If you&#8217;re running a spreadsheet-focused UI, the same shortcut opens a new <em>spreadsheet<\/em>. Etc. But I found a solution.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>There is <strong>a Terminal command<\/strong> to open any given type of LibreOffice document, regardless what the UI is currently set to. For instance, below is the command to open a new spreadsheet.<\/p>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">\/Applications\/LibreOffice.app\/Contents\/MacOS\/soffice --calc &amp;&gt; \/dev\/null &amp;<\/code><\/pre>\n\n\n\n<p>So <code>calc<\/code> is for a spreadsheet. If you want a text document, replace it by <code>writer<\/code>, or by <code>impress<\/code> if you want a presentation.<\/p>\n\n\n\n<p>Now, obviously, we don&#8217;t want to fire a Terminal each time we want to open a LibreOffice document. To make things run smooth, <strong>the secret lies in an Alfred Workflow<\/strong>, as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"780\" src=\"https:\/\/www.benscoat.eu\/wp-content\/uploads\/2021\/02\/Capture-decran-2021-02-15-a-17.13.40-1024x780.png\" alt=\"\" class=\"wp-image-346\" srcset=\"https:\/\/www.benscoat.eu\/wp-content\/uploads\/2021\/02\/Capture-decran-2021-02-15-a-17.13.40-1024x780.png 1024w, https:\/\/www.benscoat.eu\/wp-content\/uploads\/2021\/02\/Capture-decran-2021-02-15-a-17.13.40-300x229.png 300w, https:\/\/www.benscoat.eu\/wp-content\/uploads\/2021\/02\/Capture-decran-2021-02-15-a-17.13.40-768x585.png 768w, https:\/\/www.benscoat.eu\/wp-content\/uploads\/2021\/02\/Capture-decran-2021-02-15-a-17.13.40.png 1042w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>An Alfred Workflow for LibreOffice. Each keyword is connected to a bash script (equivalent to a Terminal window) that contains the appropriate code.<\/figcaption><\/figure>\n\n\n\n<p><a href=\"https:\/\/www.benscoat.eu\/wp-content\/uploads\/2021\/02\/LibreOffice-Suite.alfredworkflow.zip\">This workflow<\/a> consists in a set of keywords. Each keyword is connected to the related code as explained above, and <strong>it only takes a few letters to open new LibreOffice documents<\/strong>. For instance, for a new spreadsheet, type <code>calc<\/code> in Alfred&#8217;s main window, and hit <code>Enter<\/code>.<\/p>\n\n\n\n<p><em>Et voil\u00e0!<\/em><\/p>\n\n\n\n<p>One more thing. In the introduction I talked about <em>compatibility<\/em>. More than one year after I replaced Office apps by LibreOffice, no one has complained about my files not being exploitable with their Office-based environment. However, I did have a hard time opening someone else&#8217;s Office documents with the official Office Viewer apps, while LibreOffice did the job perfectly. <strong>I&#8217;m much comfortable with<a href=\"https:\/\/www.libreoffice.org\/donate\/\"> supporting such software<\/a>!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After the most successful poll in Twitter&#8217;s history, I switched from Office to LibreOffice more than one year ago. There were many reasons to this shift, the main one being my non-willingness to pay a licence for software that I use less and less. For instance, Excel is only a UI to have a glanceContinue reading &rarr;<\/p>\n","protected":false},"author":1,"featured_media":350,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[11,10,12],"_links":{"self":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts\/345"}],"collection":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/comments?post=345"}],"version-history":[{"count":6,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts\/345\/revisions"}],"predecessor-version":[{"id":386,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/posts\/345\/revisions\/386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/media\/350"}],"wp:attachment":[{"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/media?parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/categories?post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.benscoat.eu\/index.php\/wp-json\/wp\/v2\/tags?post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}