LibreOffice 4.0 Math Guide - The Document Foundation

Transcription

LibreOffice 4.0Math GuideThe LibreOffice Equation Editor

CopyrightThis document is Copyright 2011–2013 by its contributors as listed below. You may distribute itand/or modify it under the terms of either the GNU General Public License(http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons AttributionLicense (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.All trademarks within this guide belong to their legitimate owners.ContributorsJean Hollis WeberHazel RussmanLaurent Balland-PoirierFeedbackPlease direct any comments or suggestions about this document entsThis guide is adapted and updated from the OpenOffice.org 3.3 Math Guide. The contributors tothat book are:Daniel CarreraPeter KupferJean Hollis WeberAgnes BelzunceIan LaurensonMichele ZarriTJ FrazierJanet M. SwisherAdditional material has been added from the German Math Handbuch for LibreOffice 3.4(translated to English by Hazel Russman). Contributors to that book are:Regina HenschelGisbert Friege (Dmaths)Christian KühlJochen SchiffersFlorian ReisingerAdditional material has been added from the French How-To Math for LibreOffice (translated toEnglish by Laurent Balland-Poirier). Contributors to that book are:Bernard SiaudFrédéric ParreninPublication date and software versionPublished 3 July 2013. Based on LibreOffice 4.0.4.Documentation for LibreOffice is available at http://www.libreoffice.org/get-help/documentation

ContentsCopyright. 2Contributors. 2Feedback. 2Acknowledgments. 2Publication date and software version. 2Preface. 6Who is this book for?. 6Where to get more help. 6What you see may be different. 7What are all these things called?. 8Using LibreOffice on a Mac. 9Who wrote this book?. 9Frequently asked questions. 9What is Math?. 11Getting started.11Creating an equation as a separate document. 11Inserting a formula into a Writer document. 12Entering a formula. 13The Elements window. 13Right-click (context) menu. 15Markup. 15Greek characters. 16Changing a formula. 18Choosing the region to alter. 18Carrying out changes. 18Formula layout. 19Brackets are your friends. 19Brackets with matrices look ugly!. 19Isolated and unpaired brackets. 20Recognizing functions in Math. 20Equations over more than one line. 21How do I add limits to my sum/integral?.21How do I write a derivative?. 22Markup characters as regular characters. 22Text in a formula. 23How do I align my equations at the equals sign?. 23Changing the appearance of formulas. 24Changing the font size. 24Changing the font. 25Adjusting spacing in formulas. 26Changing the alignment. 28LibreOffice 4.0 Math Guide3

Changing the color. 29Formulas in Writer documents. 29Numbering equations. 29Position. 31Margins. 31Text mode. 31Background, borders, and size. 31Creating a formula library. 32Fast insertion of formulas. 32Formulas in Calc, Impress, and Draw.32Graphical properties. 32Combining formulas with text. 33Formulas in charts. 34Customizations. 34Formula editor as a floating window. 34Add button to toolbar. 35Add keyboard shortcut. 35Customizing the catalog. 36Customizing operators. 38Space at the end of a formula. 38Default layout with style. 39Application to chemical formulas. 40Export and import. 40Export as MathML. 40Microsoft file formats. 42XHTML. 43Flat XML. 43Extensions. 43Dmaths – an extension for more than just faster formula input. 43Symbolic computation with CmathOOo and CmathOOoCAS.45Technical details. 45OASIS Open Document Format for Office applications.45Handling of formulas in Basic. 45Math commands - Reference. 48Unary / binary operators. 48Relations. 49Set operations. 50Functions. 51Operators. 52Attributes. 53Brackets. 54Formats. 56Others. 574LibreOffice 4.0 Math Guide

Characters – Greek. 58Characters – Special. 58Reserved words in alphabetic order. 59Index. 62LibreOffice 4.0 Math Guide5

PrefaceWho is this book for?LibreOffice Math is an equation (formula) editor. Anyone who wants to get up to speed quickly withMath will find this book valuable.If you have never used LibreOffice Math before, or you want an introduction to all of itscomponents, you might like to read Getting Started with LibreOffice 4.0 first.Where to get more helpThis book, the other LibreOffice user guides, the built-in Help system, and user support systemsassume that you are familiar with your computer and basic functions such as starting a program,opening and saving files.Help systemLibreOffice comes with an extensive Help system. This is your first line of support for usingLibreOffice.To display the full Help system, press F1 or go to Help LibreOffice Help on the main menu bar.In addition, you can choose whether to activate Tips, Extended tips, and the Help Agent by goingto Tools Options LibreOffice General on the main menu bar.If Tips are enabled, hover the mouse pointer over any of the icons to see a small box (tooltip) witha brief explanation of the icon’s function. For a more detailed explanation, select Help What'sThis? on the main menu bar and hover the pointer over the icon.Free online supportThe LibreOffice community not only develops software, but provides free, volunteer-based support.See Table 1 and this web page: http://www.libreoffice.org/get-help/Table 1: Free support for LibreOffice usersFree LibreOffice supportAsk LibreOfficeQuestions and answers from the LibreOffice ocumentationUser guides, how-tos, and other Documentation/PublicationsMailing listsFree community support is provided by a network of experienced ists/FAQsAnswers to frequently asked ernational supportAccessibility options6The LibreOffice website in your sites/International mailing listshttp://wiki.documentfoundation.org/Local Mailing ListsInformation about available accessibility ibility/LibreOffice 4.0 Math Guide

You can get comprehensive online support from the community through mailing lists and the AskLibreOffice website, http://ask.libreoffice.org/en/questions/. Other websites run by users also offerfree tips and tutorials. This forum provides community support for LibreOffice:http://en.libreofficeforum.org/This site provides support for LibreOffice, among other programs:http://forum.openoffice.org/en/forum/Paid support and trainingAlternatively, you can pay for support services. Service contracts can be purchased from a vendoror consulting firm specializing in LibreOffice.What you see may be differentLibreOffice runs on Windows, Linux, and Mac OS X operating systems, each of which has severalversions and can be customized by users (fonts, colors, themes, window managers).IllustrationsThe illustrations in this guide were taken from a variety of computers and operating systems.Therefore, some illustrations will not look exactly like what you see on your computer display.Also, some of the dialogs may be different because of the settings selected in LibreOffice. You caneither use dialogs from your computer system or dialogs provided by LibreOffice (default). Tochange to using LibreOffice dialogs if settings have been altered:1) On Linux and Windows operating systems, go to Tools Options LibreOffice Generalon the main menu bar to open the dialog for general options.2) On a Mac operating system, go to LibreOffice Preferences General on the mainmenu bar to open the dialog for general options.3) Select Use LibreOffice dialogs in Open/Save dialogs and/or, in Linux or Mac OSXoperating systems only, Print dialogs to display the LibreOffice dialogs on your computerdisplay.4) Click OK to save your settings and close the dialog.IconsThe icons used to illustrate some of the many tools available in LibreOffice may differ from theones used in this guide. The icons in this guide have been taken from a LibreOffice installation thathas been set to display the Galaxy set of icons.If you wish, you can change your LibreOffice software package to display Galaxy icons as follows:1) On Linux and Windows operating systems, go to Tools Options LibreOffice View onthe main menu bar to open the dialog for view options.2) On a Mac operating system, go to LibreOffice Preferences View on the main menubar to open the dialog for view options.3) In User interface Icon size and style select Galaxy (default) from the options available inthe drop-down list.4) Click OK to save your settings and close the dialog.NotePrefaceSome Linux operating systems, for example Ubuntu, include LibreOffice as part ofthe installation and may not include the Galaxy icon set. You should be able todownload the Galaxy icon set from the software repository for your Linux operatingsystem.7

What are all these things called?The terms used in LibreOffice for most parts of the user interface (the parts of the program you seeand use, in contrast to the behind-the-scenes code that actually makes it work) are the same as formost other programs.A dialog is a special type of window. Its purpose is to inform you of something, or request inputfrom you, or both. It provides controls for you to use to specify how to carry out an action. Thetechnical names for common controls are shown in Figure 1. In most cases we do not use thetechnical terms in this book, but it is useful to know them because the Help and other sources ofinformation often use them.Figure 1: Dialog (from Calc) showing common controls1)2)3)4)Tabbed page (not strictly speaking a control).Radio buttons (only one can be selected at a time).Checkbox (more than one can be selected at a time).Spin box (click the up and down arrows to change the number shown in the text box next toit, or type in the text box).5) Thumbnail or preview.6) Drop-down list from which to select an item.7) Push buttons.In most cases, you can interact only with the dialog (not the document itself) as long as the dialogremains open. When you close the dialog after use (usually, clicking OK or another button savesyour changes and closes the dialog), then you can again work with your document.Some dialogs can be left open as you work, so you can switch back and forth between the dialogand your document. An example of this type is the Find & Replace dialog.8LibreOffice 4.0 Math Guide

Using LibreOffice on a MacSome keystrokes and menu items are different on a Mac from those used in Windows and Linux.The table below gives some common substitutions for the instructions in this chapter. For a moredetailed list, see the application Help.Windows or LinuxMac equivalentEffectTools Options menuselectionLibreOffice PreferencesAccess setup optionsRight-clickControl clickOpens a context menuCtrl (Control) (Command)Used with other keysF5Shift F5Opens the NavigatorF11 TOpens the Styles and Formatting windowWho wrote this book?This book was written by volunteers from the LibreOffice community, as listed on the Copyrightpage. Profits from sales of the printed edition will be used to benefit the community.Frequently asked questionsHow is LibreOffice licensed?LibreOffice is distributed under the Open Source Initiative (OSI) approved Lesser GeneralPublic License (LGPL). The LGPL license is available from the LibreOffice e/May I distribute LibreOffice to anyone?Yes.How many computers may I install it on?As many as you like.May I sell it?Yes.May I use LibreOffice in my business?Yes.Is LibreOffice available in my language?LibreOffice has been translated (localized) into over 40 languages, so your language probablyis supported. Additionally, there are over 70 spelling, hyphenation, and thesaurus dictionariesavailable for languages, and dialects that do not have a localized program interface. Thedictionaries are available from the LibreOffice website at: www.libreoffice.org.How can you make it for free?LibreOffice is developed and maintained by volunteers and has the backing of severalorganizations.How can I contribute to LibreOffice?You can help with the development and user support of LibreOffice in many ways, and you donot need to be a programmer. To start, check out this tion/Preface9

May I distribute the PDF of this book, or print and sell copies?Yes, as long as you meet the requirements of one of the licenses in the copyright statement atthe beginning of this book. You do not have to request special permission. In addition, werequest that you share with the project some of the profits you make from sales of books, inconsideration of all the work we have put into producing them.10LibreOffice 4.0 Math Guide

What is Math?Math is LibreOffice’s component for writing mathematical and chemical equations. It is mostcommonly used as an equation editor for text documents, but it can also be used with other typesof documents or stand-alone. When used inside Writer, the equation is treated as an object insidethe text document.NoteThe equation editor is for writing equations in symbolic form, as in equation 1. If youwant to evaluate a numeric value, see the Calc Guide.df (x ) ln( x ) tan 1 ( x 2)dx(1)orNH3 H2 O NH 4 OH Getting startedYou can create an equation (formula) as a separate document or insert it into a document in Writeror another component of LibreOffice.Creating an equation as a separate documentTo create an equation as a separate document, open the Math component of LibreOffice using oneof these methods: On the menu bar, choose File New Formula. On the standard toolbar, click the triangle to the left of the New icon and choose Formula. From the Start Center, click Formula.An empty formula document opens (see Figure 2).Figure 2: An empty formula documentGetting started11

The upper area is the preview window, where the equation will appear during and after input. Thelower area is the equation editor, where the markup code for the equation is entered. The floatingElements window will also appear.Inserting a formula into a Writer documentTo insert a formula into a Writer document, open the document and then choose Insert Object Formula from the menu bar.The formula editor opens at the bottom of the Writer window, and the floating Elements windowappears. You will also see a small box with a gray border in your document, where the formula willbe displayed, as shown in Figure 3.Figure 3: Equation Editor, Elements window, and location of resulting equation in WriterTipIf the Elements window is missing, show it with View Elements.When you are done entering the formula, you can close the editor by pressing the Esc key or byclicking an area outside the formula in the main document. A double-click will open the editoragain, so you can edit the formula.Formulas are inserted as OLE objects. In a Writer document, the formula is anchored as acharacter, so it is embedded in the continuous text. You can, as with any other OLE object, changethe anchor and make the formula floating. In Calc, Impress, and Draw documents, formulas areembedded as floating OLE objects.If you frequently need to insert formulas, it is advisable to add the Formula button to the Standardtoolbar or create a keyboard shortcut. See “Add button to toolbar” or “Add keyboard shortcut” onpage 35.12LibreOffice 4.0 Math Guide

Entering a formulaThe equation editor uses a markup language to represent formulas. For example, %beta createsthe Greek character beta ( β ). This markup is designed to read similar to English wheneverapossible. For example, a over b produces a fraction:.bYou can enter a formula in three ways: Select a symbol from the Elements window. Right-click on the equation editor and select the symbol from the context menu. Type markup in the equation editor.The context menu and the Elements window insert the markup corresponding to a symbol. Thisprovides a convenient way to learn the LibreOffice Math markup.NoteClick on the document body to exit the formula editor.Double-click on a formula to enter the formula editor again.The Elements windowThe simplest method for entering a formula is the Elements window.Figure 4: Symbols are divided into categoriesThe Elements window is divided into two main parts. The top shows the symbol categories. Click on these to change the list of symbols. The bottom shows the symbols available in the current category.TipYou can hide or show the Elements window with View Elements.Example 1: 5 4For this example we will enter a simple formula: 5 4 . On the Elements window:1) Select the top-left button of the categories (top) section.2) Click on the multiplication symbol.Entering a formula13

Figure 5: Selecting the multiplication symbolWhen you select the multiplication symbol on the Elements window, two things happen: The equation editor shows the markup: ? times ? The body of the document shows a gray box like this: Figure 6: Result of selecting the multiplication symbolThe ? symbols shown in Figure 6 are placeholders that you can replace by other text, forexample 5 and 4. The equation will update automatically, and the result should resemble Figure 7.14TipDuring edition of a formula, reserved placeholders are indicated by squares in theformula and ? in the command window. You can navigate through theseplaceholders thanks to F4 and Shift F4.TipTo keep the equation from updating automatically, select View AutoUpdate display.To update a formula manually, press F9 or select View Update.LibreOffice 4.0 Math Guide

Figure 7: Result of entering 5 and 4 next to the times operatorRight-click (context) menuAnother way to access mathematical symbols is to right-click on the equation editor. This pops upthe menu shown in Figure 8. The items in this menu correspond to those in the Elements window,with some extra commands.Figure 8: Right-click (context) menuNoteNeither the window elements, nor the context menu contains a complete list ofcommands. For some seldom-used commands, you must always enter the markup.A complete list of commands can be found in Appendix A to this manual, page 48.MarkupYou can type the markup directly in the equation editor. For example, you can type 5 times 4 toobtain 5 4 . If you know the markup, this can be the fastest way to enter a formula.TipThe formula markup resembles the way the formula reads in English.Entering a formula15

Below is a short list of common equations and their corresponding markup.DisplayCommandDisplayCommanda ba b asqrt {a}a2a 2ana n f ( x )dxint f(x) dx ansum a na ba b infinitya ba times bx yx cdot yGreek charactersGreek characters ( α , β , γ ,θ , etc) are common in mathematical formulas. These characters arenot available in the Elements window or the right-click menu. Fortunately, the markup for Greekcharacters is simple: Type a % sign followed by the name of the character, in English. To write a lowercase character, type the name of the character in lowercase. To write an uppercase character, type the name of the character in uppercase. To write in italic, add an i between % sign and the name of the character.A complete table of Greek characters is provided on page 58. See the table below for someexamples.LowercaseUppercaseItalic lowercaseItalic uppercase%ialpha α%iALPHA Α%alpha α%ALPHA Α%beta β%BETA%gamma γ Β%GAMMA Γ%ibeta β%igamma γ%iBETA Β%iGAMMA Γ%psi ψ%PSI Ψ%ipsi ψ%iPSI Ψ%phi ϕ%PHI Φ%iphi ϕ%iPHI Φ%THETA Θ%itheta θ%theta θ%iTHETA ΘAnother way to enter Greek characters is by using the Symbols catalog window. Choose Tools Catalog. This window is shown in Figure 9. Under Symbol set, select Greek and double-click on aGreek letter from the list. The markup name of the character is shown below the list window.16LibreOffice 4.0 Math Guide

Figure 9: Symbols catalog, used for entering Greek characters and some special symbolsExample 2: π 3.14159For this example we will suppose that: We want to enter the above formula (the value of pi rounded to 5 decimal places). We know the name of the Greek character (pi). But we do not know the markup associated with the symbol.Step 1: Type % followed by the text pi. This displays the Greek character π .Step 2: Open the Elements window (View Elements).Step 3: The symbol is a relation, so we click on the Relations button.

Preface Who is this book for? LibreOffice Math is an equation (formula) editor. Anyone who wants to get up to speed quickly with Math will find this book valuable.