{"id":197,"date":"2016-08-25T15:52:44","date_gmt":"2016-08-25T15:52:44","guid":{"rendered":"https:\/\/doublelayer.eu\/vilab\/?p=197"},"modified":"2018-01-20T21:27:19","modified_gmt":"2018-01-20T21:27:19","slug":"taming-the-equations-in-libreoffice","status":"publish","type":"post","link":"https:\/\/doublelayer.eu\/vilab\/2016\/08\/25\/taming-the-equations-in-libreoffice\/","title":{"rendered":"Taming the equations in Libreoffice"},"content":{"rendered":"<p>Working on large documents with many equations in a word processor is a torture. In my case, booklets of chemistry problems require a lot of work. For certain reason I prefer to use LibreOffice. When is\u00a0needed to reformat all equations in a document\u00a0the following macro is very useful:<\/p>\n<p><code><\/code><\/p>\n<p style=\"margin: 0; text-indent: 0in;\">Sub FormulaFontSizeChanger<\/p>\n<p style=\"margin: 0; text-indent: 0.5in;\">o = ThisComponent.getEmbeddedObjects()<\/p>\n<p style=\"margin: 0; text-indent: 0.5in;\">fontSize = 12<\/p>\n<p style=\"margin: 0; text-indent: 0.5in;\">fontFamily = &#8220;Arial&#8221;<\/p>\n<p style=\"margin: 0; text-indent: 0.5in;\">For i = 0 to o.count-1<\/p>\n<p style=\"margin: 0; text-indent: 1in;\">if (not IsNull(o(i))) and (not IsNull(o(i).Model)) then<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.TopMargin = 0<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.BottomMargin = 0<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.LeftMargin = 0<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.RightMargin = 0<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.BaseFontHeight = fontSize<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.FontNameVariables = fontFamily<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.FontVariablesIsItalic = 1<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.FontNameFunctions = fontFamily<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.FontNameNumbers = fontFamily<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Model.FontNameText = fontFamily<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).Component.BaseFontHeight = fontSize<\/p>\n<p style=\"margin: 0; text-indent: 1.5in;\">o(i).ExtendedControlOverEmbeddedObject.update()<\/p>\n<p style=\"margin: 0; text-indent: 1in;\">endif<\/p>\n<p style=\"margin: 0; text-indent: 0.5in;\">Next i<\/p>\n<p style=\"margin: 0; text-indent: 0in;\">End Sub<\/p>\n<p>&nbsp;<\/p>\n<p>P.S. The script might be useful also when writing a thesis with a lot of chemistry inside and many Zotero references. LaTeX might not be so comfortable, and in Word one is still limited with few math fonts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working on large documents with many equations in a word processor is a torture. In my case, booklets of chemistry problems require a lot of work. For certain reason I prefer to use LibreOffice. When is\u00a0needed to reformat all equations in a document\u00a0the following macro is very useful: Sub FormulaFontSizeChanger o = ThisComponent.getEmbeddedObjects() fontSize =&hellip; <a class=\"read-more\" href=\"https:\/\/doublelayer.eu\/vilab\/2016\/08\/25\/taming-the-equations-in-libreoffice\/\">Read More<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[16,34],"class_list":["post-197","post","type-post","status-publish","format-standard","hentry","category-know-how","tag-academic-writing","tag-software"],"_links":{"self":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/comments?post=197"}],"version-history":[{"count":4,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/197\/revisions"}],"predecessor-version":[{"id":395,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/197\/revisions\/395"}],"wp:attachment":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/media?parent=197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/categories?post=197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/tags?post=197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}