libreoffice-texmaths-0.43/000075540400000000000013206777055017416 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/000075540400000000000013206777051020712 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/000075540400000000000013206777051022547 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/AddonRegistry.xcu000064440400000000532713206777051026055 0ustar kkremitzkikkremitzki TexMaths %origin%/ 0 Equation 1 libreoffice-texmaths-0.43/source/texmaths/po/000075540400000000000013206777051023165 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/po/da.po000064440400000003323213206777051024114 0ustar kkremitzkikkremitzki# TexMaths, a LaTeX equation editor for LibreOffice # Copyright (C) 2012-2017 - Roland Baudin # This file is distributed under the same license as the TexMaths package msgid "" msgstr "" "Project-Id-Version: TexMaths 0.30\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-22 13:37+0100\n" "PO-Revision-Date: 2011-10-10 16:45+0100\n" "Last-Translator: Leif Lodahl \n" "Language-Team: DA \n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" msgid "About TexMaths" msgstr "Om TexMaths" msgid "About" msgstr "Om" msgid "Display application informations" msgstr "Vis programinformationer" msgid "Display application changes" msgstr "Vis programændringer" msgid "Display system informations" msgstr "Vis systeminformationer" msgid "Close" msgstr "Luk" msgid "Close window" msgstr "Luk vindue" msgid "" "You have to generate a first equation before the system log can be " "displayed..." msgstr "Du skal først generere en formel før systemloggen kan vises..." msgid "TexMaths Equations" msgstr "TexMaths Formler" msgid "Name" msgstr "" msgid "Enter equation name here (can be left blank)" msgstr "" msgid "Image Format" msgstr "Billedformat" msgid "Equation Type" msgstr "Formeltype" msgid "Font Size" msgstr "Skriftstørrelse" msgid "Set image format" msgstr "Angiv billedformat" msgid "Set image resolution" msgstr "Angiv billedopløsning" msgid "Transparency" msgstr "" msgid "Toggle image transparency" msgstr "" msgid "Set font size" msgstr "Angiv skriftstørrelse" msgid "Inline Display equation" msgstr "Inline visning af formel" msgid "Inline equation" msgstr "Inline formel" msgid "Regular LaTeX code" msgstr "Normal LaTeX kode" msgid "Help..." msgstr "Hjælp..." msgid "Display help text" msgstr "Vis hjælpetekst" msgid "Preferences..." msgstr "Indstillinger..." msgid "Set equation preferences" msgstr "Angiv indstillinger for formler" msgid "Preamble..." msgstr "Præambel..." msgid "Set LaTeX preamble" msgstr "Angiv LaTeX præambel" msgid "Generate LaTeX equation" msgstr "Generèr LaTeX formel" msgid "Increase window width" msgstr "" msgid "Decrease window width" msgstr "" msgid "Increase window height" msgstr "" msgid "Decrease window height" msgstr "" msgid "Please install the Draw component to run TexMaths!" msgstr "" msgid ": document type not supported by TexMaths" msgstr ": dokumenttype ikke understøttet af TexMaths" msgid "The selected object is not a TexMaths equation..." msgstr "Det markerede objekt er ikke en TexMaths formel..." msgid "Please unselect it and call the macro again..." msgstr "Fjern venligst markeringen og gentag funktionen" msgid "Edit equation..." msgstr "Rediger formel..." msgid "Please enter some LaTeX code..." msgstr "Indtast venligst noget LaTeX-kode..." msgid "Please save the document before using an include command..." msgstr "" msgid "Please save the document before using an input command..." msgstr "" msgid "The file " msgstr "Filen" msgid "tmpfile.tex cannot be created" msgstr "tmpfile.tex kan ikke oprettes" msgid "Please check your installation..." msgstr "Kontroller venligst din installation..." msgid "No file created in the directory:" msgstr "Ingen fil oprettet i folderen:" msgid "Script error: the dvi file was not converted to " msgstr "Skriptfejl: dvi-filen blev ikke konverteret til " msgid "Please check your system configuration..." msgstr "Kontroller venligst din systemkonfiguration..." msgid "TexMaths Help" msgstr "TexMaths Hjælp" msgid "TexMaths Preamble" msgstr "TexMaths Præambel" msgid "Default" msgstr "Standard" msgid "Load default preamble" msgstr "Indlæs standard præambel" msgid "Load" msgstr "Indlæs" msgid "Load preamble saved into the current document" msgstr "" msgid "Apply" msgstr "Tilknyt" msgid "Apply current preamble" msgstr "Tilknyt aktuel præambel" msgid "Save" msgstr "Gem" msgid "Apply current preamble and save it into the current document" msgstr "" #, fuzzy msgid "Do not use preamble for LaTeX type equations" msgstr "Generèr LaTeX formel" msgid "" "Ignore preamble when generating LaTeX type equations. Full LaTeX code must " "then be entered in the TexMaths equation dialog." msgstr "" msgid "Preamble applied and saved..." msgstr "Præambel tilknyttet og gemt..." msgid "Preamble applied..." msgstr "Præambel tilknyttet" msgid "TexMaths Preferences" msgstr "TexMaths indstillinger" msgid "Image parameters" msgstr "Billedparametre" msgid "Load default preferences" msgstr "Indlæs standardindstillinger" msgid "Load saved preferences" msgstr "Indlæs gemte indstillinger" msgid "Apply and save current preferences" msgstr "Tilknyt og gem aktuelle indstillinger" msgid "Writer font size" msgstr "Writer skriftstørrelse" msgid "Impress font size" msgstr "Impress skriftstørrelse" msgid "Draw font size" msgstr "Draw skriftstørrelse" msgid "points" msgstr "punkt" msgid "Inline display equation" msgstr "Inline visning af formel" msgid "Format" msgstr "Format" msgid "Image format" msgstr "Billedformat" msgid "Image resolution" msgstr "Billedopløsning" msgid "Preferences applied and saved..." msgstr "Indstillinger tilknyttet og gemt..." msgid "Default preferences loaded..." msgstr "Standardindstillinger indlæst..." msgid "User's preferences loaded..." msgstr "Brugers indstillinger indlæst..." msgid "TexMaths Recompile Equations" msgstr "" msgid "Run" msgstr "" msgid "Recompile TexMaths equations" msgstr "" msgid "Font size" msgstr "" msgid "Compatibility" msgstr "" msgid "Selection" msgstr "" msgid "Image transparency" msgstr "" #, fuzzy msgid "Vertical alignment for Word export" msgstr "Forbedring af kompatibilitet med Word 2000 for PNG-formler i Writer" #, fuzzy msgid "Improve vertical alignment of Writer equations for Word export" msgstr "Forbedring af kompatibilitet med Word 2000 for PNG-formler i Writer" msgid "Text font size" msgstr "" msgid "Image resolution (only for PNG images)" msgstr "" msgid "Recompile all equations" msgstr "" msgid "Recompile all equations from the document" msgstr "" msgid "Recompile selected equations" msgstr "" msgid "" "Recompile equations from the selected text area (does not process equations " "in tables, text frames, header and footer. Recompile those one by one if " "necessary)" msgstr "" msgid "Recompile equations from slide" msgstr "" msgid "Recompile equations from the current slide" msgstr "" msgid "Please wait during task execution..." msgstr "" msgid "Cancel" msgstr "" msgid "Cancel operation" msgstr "" msgid "Operation canceled!" msgstr "" msgid "Done!" msgstr "" msgid "No equation was recompiled." msgstr "" msgid "1 equation recompiled." msgstr "" msgid " equations recompiled." msgstr "" msgid "TexMaths System Configuration" msgstr "TexMaths systemkonfiguration" msgid "Equations Shortcuts" msgstr "Formel genvej" msgid "Numbered Equations Shortcut" msgstr "Nummereret formel genvej" msgid "Same shortcut for Writer, Impress and Draw" msgstr "" msgid "Use the same shortcut for Writer, Impress and Draw" msgstr "Brug samme genvej i Writer, Impress og Draw" msgid "System Paths" msgstr "Systemstier" msgid "All" msgstr "Alle" msgid "Keyboard shortcut" msgstr "Tastaturgenveje" msgid "Path of the latex program" msgstr "Sti til latexprogrammet" msgid "Path of the dvipng program" msgstr "Sti til dvipng" msgid "Path of the dvisvgm program" msgstr "Sti til dvisvgm" msgid "Save system configuration" msgstr "Gem systemkonfiguration" msgid "Numbering Level" msgstr "" msgid "Chapter level number to be included in equation numbers" msgstr "" msgid "Level number" msgstr "" msgid "Caption left alignment" msgstr "" msgid "Set equation caption alignment to left" msgstr "" msgid "Caption right alignment" msgstr "" msgid "Set equation caption alignment to right" msgstr "" msgid "Paths" msgstr "" #, fuzzy msgid "Display the Paths tab" msgstr "Vis hjælpetekst" msgid "Options" msgstr "Valgmuligheder" #, fuzzy msgid "Display the Options tab" msgstr "Vis hjælpetekst" #, fuzzy msgid "Shortcuts" msgstr "Formel genvej" #, fuzzy msgid "Display the Shortcuts tab" msgstr "Vis hjælpetekst" #, fuzzy msgid "Numbered Equations" msgstr "Nummereret formel genvej" msgid "Paragraph break before numbered equations" msgstr "Indsæt afsnit for nummereret formel" #, fuzzy msgid "Add a paragraph break before numbered equations" msgstr "Tilføj et ekstra afsnit før nummererede formler" msgid "Paragraph break after numbered equations" msgstr "Afsnit efter nummererede formler" #, fuzzy msgid "Add a paragraph break after numbered equations" msgstr "Tilføj et ekstra afsnit efter nummererede formler" #, fuzzy msgid "Equation Caption" msgstr "Formeltype" msgid "Display text before equation number (leave blank if no text desired)" msgstr "" msgid "" "The TexMaths macro uses some external programs to generate the equation " "images. Enter below the paths of the folders that contain these programs. " "Note that only one of the dvisvgm or dvipng programs is required to generate " "equation images." msgstr "" msgid "" "Ex: For a standard MiKTeX 2.9 install on Windows, enter the following path " "into the latex.exe field:" msgstr "" "Eksempel: For en standard MiKTeX 2.9 installation på Windows, skal du " "indtaste følgende sti i feltet lates:" msgid "latex.exe (mandatory)" msgstr "latex.exe (krævet)" msgid "dvipng.exe (optional)" msgstr "dvipng.exe (valgfrit)" msgid "dvisvgm.exe (optional)" msgstr "dvisvgm.exe (valgfrit)" #, fuzzy msgid "" "Ex: For a standard LaTeX install on Mac OS, enter the following path into " "the latex field:" msgstr "" "Eksempel: For en standard LaTeX installation på Linux eller MacOS, skal du " "indtaste følgende sti i feltet latex:" msgid "latex (mandatory)" msgstr "latex (krævet)" msgid "dvipng (optional)" msgstr "dvipng (valgfrit)" msgid "dvisvgm (optional)" msgstr "dvisvgm (valgfrit)" #, fuzzy msgid "" "Ex: For a standard LaTeX install on Linux, enter the following path into the " "latex field:" msgstr "" "Eksempel: For en standard LaTeX installation på Linux eller MacOS, skal du " "indtaste følgende sti i feltet latex:" msgid "Please configure first TexMaths before using it..." msgstr "Konfigurer venligst TexMaths før brug..." msgid "Can't find the external program " msgstr "Kan ikke finde det eksterne program" msgid "Please check the paths in your TexMaths system configuration..." msgstr "Kontroller venligst stien i din TexMaths systemkonfiguration..." msgid "Can't find at least one of the external programs " msgstr "Kan ikke finde mindst en af de to eksterne programmer" msgid " or " msgstr "eller" msgid "" "Shortcuts assigned to the Equations and NumberedEquations modules must be " "different!" msgstr "" #, fuzzy msgid "Please check your shortcuts..." msgstr "Kontroller venligst din installation..." msgid "Please set the latex path..." msgstr "Angiv venligst stien til latex" msgid "Please set at least one dvipng path or the dvisvgm path..." msgstr "Angiv venligst stien til enten dvipng eller dvisvgm..." msgid "The program latex.exe is not located in " msgstr "Programmet lates.exe findes ikke i " msgid "The program dvipng.exe is not located in " msgstr "Programmet dvipng.exe findes ikke i " msgid "The program dvisvgm.exe is not located in " msgstr "Programmet dvsivgm.exe findes ikke i " msgid "The program latex is not located in " msgstr "Programmet latex findes ikke i " msgid "The program dvipng is not located in " msgstr "Programmet dvipng findes ikke i " msgid "The program dvisvgm is not located in " msgstr "Programmet dvisvgm findes ikke i " #, fuzzy msgid "Only characters from A to Z are allowed for shortcuts!" msgstr "Kun karakterer fra A til Z er tilladt som genvejstaster" msgid "The key combination CTRL + " msgstr "Tastekombinationen CTRL + " msgid " is already assigned to the command " msgstr "er allerede tilknyttet til kommandoen " msgid "Do you want to set the command" msgstr "Ønsker du at angive kommandoen" msgid "Error: can't find file " msgstr "Fejl: kan ikke finde fil " msgid "Error: can't decode SVG file, please check your LaTeX code..." msgstr "" msgid "Error: please check the equation syntax..." msgstr "Fejl: kontroller venligst formelsyntaksen..." msgid "Error: the file " msgstr "Fejl: filen " msgid " doesn't exist..." msgstr "findes ikke..." msgid "Can't find " msgstr "Kan ikke finde " #~ msgid "" #~ "The TexMaths macro uses some external programs to generate the equation " #~ "images. Enter below the path of these programs. Note that only one of the " #~ "dvisvgm or dvipng programs is required to generate equation images." #~ msgstr "" #~ "TexMaths funktionerne bruger visse eksterne programmer til at generere " #~ "formelbilleder. Indtast herunder stien til disse programmer. Bemærk at " #~ "kun et af programmerne dvisvgm og dvipng er nødvendig for at generere " #~ "formelbilleder." #~ msgid "Load saved preamble" #~ msgstr "Indlæs gemt præambel" #~ msgid "Apply and save current preamble" #~ msgstr "Tilknyt og gem aktuel præambel" #~ msgid "Same shortcut for Writer, Draw & Impress" #~ msgstr "Samme genvej for Writer, Draw og Impress" #~ msgid "PNG compatibility with Word 2000" #~ msgstr "PNG-kompatibilitet med Word 2000" #~ msgid "Improve compatibility of Writer PNG equations with Word 2000" #~ msgstr "Forbedring af kompatibilitet med Word 2000 for PNG-formler i Writer" #, fuzzy #~ msgid "Caption" #~ msgstr "Valgmuligheder" #~ msgid "Can't find the batch script " #~ msgstr "Kan ikke finde batchskriptet" #~ msgid "Can't find the shell script " #~ msgstr "Kan ikke finde shellskriptet" #, fuzzy #~ msgid "Please check your configuration..." #~ msgstr "Kontroller venligst din systemkonfiguration..." #, fuzzy #~ msgid "Define system paths" #~ msgstr "Systemstier" #, fuzzy #~ msgid "Define shortcuts" #~ msgstr "Formel genvej" libreoffice-texmaths-0.43/source/texmaths/po/fr.po000064440400000004234313206777051024142 0ustar kkremitzkikkremitzki# TexMaths, a LaTeX equation editor for LibreOffice # Copyright (C) 2012-2017 - Roland Baudin # This file is distributed under the same license as the TexMaths package # Roland Baudin , 2015. # msgid "" msgstr "" "Project-Id-Version: TexMaths 0.41\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-22 13:37+0100\n" "PO-Revision-Date: 2015-12-11 16:00+0100\n" "Last-Translator: Roland Baudin \n" "Language-Team: français <>\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Gtranslator 2.91.7\n" msgid "About TexMaths" msgstr "À propos de TexMaths" msgid "About" msgstr "À propos" msgid "Display application informations" msgstr "Afficher les informations sur l'application" msgid "Display application changes" msgstr "Afficher les modifications de l'application" msgid "Display system informations" msgstr "Afficher les informations système" msgid "Close" msgstr "Fermer" msgid "Close window" msgstr "Fermer la fenêtre" msgid "" "You have to generate a first equation before the system log can be " "displayed..." msgstr "" "Vous devez d'abord générer une première équation avant de pouvoir visualiser " "les informations système..." msgid "TexMaths Equations" msgstr "Équations TexMaths" msgid "Name" msgstr "Nom" msgid "Enter equation name here (can be left blank)" msgstr "Entrer ici le nom de l'équation (peut être laissé en blanc)" msgid "Image Format" msgstr "Format d'image" msgid "Equation Type" msgstr "Type d'équation" msgid "Font Size" msgstr "Taille de police" msgid "Set image format" msgstr "Définir le format d'image" msgid "Set image resolution" msgstr "Définir la résolution d'image" msgid "Transparency" msgstr "Transparence" msgid "Toggle image transparency" msgstr "Basculer la transparence de l'image" msgid "Set font size" msgstr "Définir la taille de police" msgid "Inline Display equation" msgstr "Équation Inline Display" msgid "Inline equation" msgstr "Équation Inline" msgid "Regular LaTeX code" msgstr "Code LaTeX générique" msgid "Help..." msgstr "Aide..." msgid "Display help text" msgstr "Afficher l'aide" msgid "Preferences..." msgstr "Préférences..." msgid "Set equation preferences" msgstr "Définir les préférences des équations" msgid "Preamble..." msgstr "Préambule..." msgid "Set LaTeX preamble" msgstr "Définir le préambule LaTeX" msgid "Generate LaTeX equation" msgstr "Générer l'équation LaTeX" msgid "Increase window width" msgstr "Augmenter la largeur de la fenêtre" msgid "Decrease window width" msgstr "Réduire la largeur de la fenêtre" msgid "Increase window height" msgstr "Augmenter la hauteur de la fenêtre" msgid "Decrease window height" msgstr "Réduire la hauteur de la fenêtre" msgid "Please install the Draw component to run TexMaths!" msgstr "Veuillez installer le composant Draw pour utiliser TexMaths !" msgid ": document type not supported by TexMaths" msgstr ": type de document non pris en charge par TexMaths" msgid "The selected object is not a TexMaths equation..." msgstr "L'objet sélectionné n'est pas une équation TexMaths..." msgid "Please unselect it and call the macro again..." msgstr "Veuillez désélectionner l'objet et exécuter à nouveau la macro..." msgid "Edit equation..." msgstr "Éditer l'équation..." msgid "Please enter some LaTeX code..." msgstr "Veuillez entrer du code LateX..." msgid "Please save the document before using an include command..." msgstr "" "Veuillez enregistrer le document avant d'utiliser une commande include..." msgid "Please save the document before using an input command..." msgstr "" "Veuillez enregistrer le document avant d'utiliser une commande input..." msgid "The file " msgstr "Le fichier " msgid "tmpfile.tex cannot be created" msgstr "tmpfile.tex ne peut être créé" msgid "Please check your installation..." msgstr "Veuillez vérifier votre installation..." msgid "No file created in the directory:" msgstr "Aucun fichier n'a été créé dans le dossier :" msgid "Script error: the dvi file was not converted to " msgstr "Erreur de script : le fichier dvi n'a pas été converti en " msgid "Please check your system configuration..." msgstr "Veuillez vérifier votre configuration système..." msgid "TexMaths Help" msgstr "Aide TexMaths" msgid "TexMaths Preamble" msgstr "Préambule TexMaths" msgid "Default" msgstr "Défaut" msgid "Load default preamble" msgstr "Charger le préambule par défaut" msgid "Load" msgstr "Charger" msgid "Load preamble saved into the current document" msgstr "Charger le préambule enregistré dans le présent document" msgid "Apply" msgstr "Appliquer" msgid "Apply current preamble" msgstr "Appliquer le préambule courant" msgid "Save" msgstr "Enregistrer" msgid "Apply current preamble and save it into the current document" msgstr "Appliquer le préambule courant et le sauver dans le présent document" msgid "Do not use preamble for LaTeX type equations" msgstr "Ne pas utiliser le préambule pour les équations de type LaTeX" msgid "" "Ignore preamble when generating LaTeX type equations. Full LaTeX code must " "then be entered in the TexMaths equation dialog." msgstr "" "Ignorer le préambule lors de la génération des équations de type LaTeX. Il " "faut alors entrer du code LaTeX complet dans la fenêtre Équations TexMaths." msgid "Preamble applied and saved..." msgstr "Préambule appliqué et enregistré..." msgid "Preamble applied..." msgstr "Préambule appliqué..." msgid "TexMaths Preferences" msgstr "Préférences TexMaths" msgid "Image parameters" msgstr "Paramètres d'images" msgid "Load default preferences" msgstr "Charger les préférences par défaut" msgid "Load saved preferences" msgstr "Charger les préférences enregistrées" msgid "Apply and save current preferences" msgstr "Appliquer et enregistrer les préférences" msgid "Writer font size" msgstr "Taille de police pour Writer" msgid "Impress font size" msgstr "Taille de police pour Impress" msgid "Draw font size" msgstr "Taille de police pour Draw" msgid "points" msgstr "points" msgid "Inline display equation" msgstr "Équation Inline Display" msgid "Format" msgstr "Format" msgid "Image format" msgstr "Format d'image" msgid "Image resolution" msgstr "Résolution d'image" msgid "Preferences applied and saved..." msgstr "Préférences appliquées et enregistrées..." msgid "Default preferences loaded..." msgstr "Préférences par défaut chargées..." msgid "User's preferences loaded..." msgstr "Préférences de l'utilisateur chargées..." msgid "TexMaths Recompile Equations" msgstr "TexMaths Recompiler Équations" msgid "Run" msgstr "Exécuter" msgid "Recompile TexMaths equations" msgstr "TexMaths Recompiler Équations" msgid "Font size" msgstr "Taille de police" msgid "Compatibility" msgstr "Compatibilité" msgid "Selection" msgstr "Sélection" msgid "Image transparency" msgstr "Transparence de l'image" msgid "Vertical alignment for Word export" msgstr "Alignement vertical pour l'export vers Word" msgid "Improve vertical alignment of Writer equations for Word export" msgstr "" "Améliorer l'alignement vertical des équations sous Writer pour l'export vers " "Word" msgid "Text font size" msgstr "Taille de la police de texte" msgid "Image resolution (only for PNG images)" msgstr "Résolution d'image (images PNG seulement)" msgid "Recompile all equations" msgstr "Recompiler toutes les équations" msgid "Recompile all equations from the document" msgstr "Recompiler toutes les équations du document" msgid "Recompile selected equations" msgstr "Recompiler les équations sélectionnées" msgid "" "Recompile equations from the selected text area (does not process equations " "in tables, text frames, header and footer. Recompile those one by one if " "necessary)" msgstr "" "Recompiler les équations de la zone de texte sélectionnée (ne traite pas les " "équations des tableaux, cadres de texte, en-tête et pied de page. Recompiler " "celles-ci une par une si nécessaire)" msgid "Recompile equations from slide" msgstr "Recompiler les équations de la diapositive" msgid "Recompile equations from the current slide" msgstr "Recompiler les équations de la diapositive courante" msgid "Please wait during task execution..." msgstr "Veuillez patienter durant l'exécution de la tâche..." msgid "Cancel" msgstr "Annuler" msgid "Cancel operation" msgstr "Annuler l'opération" msgid "Operation canceled!" msgstr "Opération annulée !" msgid "Done!" msgstr "Terminé !" msgid "No equation was recompiled." msgstr "Aucune équation n'a été recompilée." msgid "1 equation recompiled." msgstr "1 équation recompilée." msgid " equations recompiled." msgstr " équations recompilées." msgid "TexMaths System Configuration" msgstr "Configuration système TexMaths" msgid "Equations Shortcuts" msgstr "Raccourcis Équations" msgid "Numbered Equations Shortcut" msgstr "Raccourci Équations numérotées" msgid "Same shortcut for Writer, Impress and Draw" msgstr "Même raccourci pour Writer, Impress et Draw" msgid "Use the same shortcut for Writer, Impress and Draw" msgstr "Utiliser le même raccourci pour Writer, Impress et Draw" msgid "System Paths" msgstr "Chemins système" msgid "All" msgstr "Tous" msgid "Keyboard shortcut" msgstr "Raccourci clavier" msgid "Path of the latex program" msgstr "Chemin du programme latex" msgid "Path of the dvipng program" msgstr "Chemin du programme dvipng" msgid "Path of the dvisvgm program" msgstr "Chemin du programme dvisvgm" msgid "Save system configuration" msgstr "Enregistrer la configuration système" msgid "Numbering Level" msgstr "Niveau de numérotation" msgid "Chapter level number to be included in equation numbers" msgstr "Niveau de chapitre à inclure dans les numéros d'équations" msgid "Level number" msgstr "Niveau de chapitre" msgid "Caption left alignment" msgstr "Légende alignée à gauche" msgid "Set equation caption alignment to left" msgstr "Positionner l'alignement de la légende à gauche" msgid "Caption right alignment" msgstr "Légende alignée à droite" msgid "Set equation caption alignment to right" msgstr "Positionner l'alignement de la légende à droite" msgid "Paths" msgstr "Chemins" msgid "Display the Paths tab" msgstr "Afficher l'onglet Chemins" msgid "Options" msgstr "Options" msgid "Display the Options tab" msgstr "Afficher l'onglet Options" msgid "Shortcuts" msgstr "Raccourcis" msgid "Display the Shortcuts tab" msgstr "Afficher l'onglet Raccourcis" msgid "Numbered Equations" msgstr "Équations numérotées" msgid "Paragraph break before numbered equations" msgstr "Saut de paragraphe avant les équations numérotées" msgid "Add a paragraph break before numbered equations" msgstr "Insérer un saut de paragraphe avant les équations numérotées" msgid "Paragraph break after numbered equations" msgstr "Saut de paragraphe après les équations numérotées" msgid "Add a paragraph break after numbered equations" msgstr "Insérer un saut de paragraphe après les équations numérotées" msgid "Equation Caption" msgstr "Légende d'équation" msgid "Display text before equation number (leave blank if no text desired)" msgstr "" "Texte à afficher devant les numéros d'équations (laisser en blanc si pas de " "texte désiré)" msgid "" "The TexMaths macro uses some external programs to generate the equation " "images. Enter below the paths of the folders that contain these programs. " "Note that only one of the dvisvgm or dvipng programs is required to generate " "equation images." msgstr "" "La macro TexMaths utilise certains programmes externes pour générer les " "images d'équations. Entrer ci-dessous les chemins des dossiers contenant ces " "programmes. Notez qu'un seul des deux programmes dvisvgm ou dvipng est " "nécessaire pour générer les images d'équations." msgid "" "Ex: For a standard MiKTeX 2.9 install on Windows, enter the following path " "into the latex.exe field:" msgstr "" "Ex : Pour une installation standard de MiKTeX 2.9 sous Windows, entrer le " "chemin suivant dans le champ latex.exe :" msgid "latex.exe (mandatory)" msgstr "latex.exe (requis)" msgid "dvipng.exe (optional)" msgstr "dvipng.exe (optionnel)" msgid "dvisvgm.exe (optional)" msgstr "dvisvgm.exe (optionnel)" msgid "" "Ex: For a standard LaTeX install on Mac OS, enter the following path into " "the latex field:" msgstr "" "Ex : Pour une installation standard de LaTeX sous Mac OS, entrer le chemin " "suivant dans le champ latex :" msgid "latex (mandatory)" msgstr "latex (requis)" msgid "dvipng (optional)" msgstr "dvipng (optionnel)" msgid "dvisvgm (optional)" msgstr "dvisvgm (optionnel)" msgid "" "Ex: For a standard LaTeX install on Linux, enter the following path into the " "latex field:" msgstr "" "Ex : Pour une installation standard de LaTeX sous Linux, entrer le chemin " "suivant dans le champ latex :" msgid "Please configure first TexMaths before using it..." msgstr "Veuillez d'abord configurer TexMaths avant de l'utiliser..." msgid "Can't find the external program " msgstr "Ne peut trouver le programe externe " msgid "Please check the paths in your TexMaths system configuration..." msgstr "" "Veuillez vérifier les chemins dans votre configuration système TexMaths..." msgid "Can't find at least one of the external programs " msgstr "Ne peut trouver au moins un des programmes externes " msgid " or " msgstr " ou " msgid "" "Shortcuts assigned to the Equations and NumberedEquations modules must be " "different!" msgstr "" "Les raccourcis assignés aux modules Équations et Équations numérotées " "doivent être différents!" msgid "Please check your shortcuts..." msgstr "Veuillez vérifier vos raccourcis..." msgid "Please set the latex path..." msgstr "Veuillez définir le chemin de latex..." msgid "Please set at least one dvipng path or the dvisvgm path..." msgstr "Veuillez définir au moins le chemin de dvipng ou celui de dvisvgm..." msgid "The program latex.exe is not located in " msgstr "Le programme latex.exe ne se trouve pas dans" msgid "The program dvipng.exe is not located in " msgstr "Le programme dvipng.exe ne se trouve pas dans " msgid "The program dvisvgm.exe is not located in " msgstr "Le programme dvisvgm.exe ne se trouve pas dans " msgid "The program latex is not located in " msgstr "Le programme latex ne se trouve pas dans " msgid "The program dvipng is not located in " msgstr "Le programme dvipng ne se trouve pas dans " msgid "The program dvisvgm is not located in " msgstr "Le programme dvisvgm ne se trouve pas dans " msgid "Only characters from A to Z are allowed for shortcuts!" msgstr "Seuls les caractères de A à Z sont autorisés pour les raccourcis!" msgid "The key combination CTRL + " msgstr "La combinaison de touches CTRL + " msgid " is already assigned to the command " msgstr " est déjà affectée à la commande " msgid "Do you want to set the command" msgstr "Voulez vous définir la commande" msgid "Error: can't find file " msgstr "Erreur : ne peut trouver " msgid "Error: can't decode SVG file, please check your LaTeX code..." msgstr "" "Erreur : le fichier SVG ne peut être décodé, veuillez vérifier votre code " "LaTeX..." msgid "Error: please check the equation syntax..." msgstr "Erreur : veuillez vérifier la syntaxe de l'équation..." msgid "Error: the file " msgstr "Erreur : le fichier " msgid " doesn't exist..." msgstr " n'existe pas..." msgid "Can't find " msgstr "Ne peut trouver " #~ msgid "" #~ "Recompile equations from the selected text area (does not work for " #~ "equations in tables, text frames, header and footer. Recompile those " #~ "equations one by one if necessary)" #~ msgstr "" #~ "Recompiler les équations de la zone de texte sélectionnée (ne traite pas " #~ "les équations des tableaux, cadres de texte, en-tête et pied de page. " #~ "Recompiler ces équations une par une si nécessaire)" #~ msgid "" #~ "Recompile equations from the selected text area (does not work for " #~ "equations in tables, header, footer and text frames)" #~ msgstr "" #~ "Recompiler les équations de la zone de texte sélectionnée (ne fonctionne " #~ "pas pour les équations situées dans les tableaux, cadres de texte, en-" #~ "tête et pied de page)" #~ msgid "Recompile equations from the selected text area" #~ msgstr "Recompiler les équations de la zone de texte sélectionnée" #~ msgid "TexMaths Recompile All" #~ msgstr "Recompiler les équations TexMaths" #~ msgid "Recompile all TexMaths equations" #~ msgstr "Recompiler toutes les équations TexMaths" #~ msgid "" #~ "The TexMaths macro uses some external programs to generate the equation " #~ "images. Enter below the path of these programs. Note that only one of the " #~ "dvisvgm or dvipng programs is required to generate equation images." #~ msgstr "" #~ "La macro TexMaths utilise certains programmes externes pour générer les " #~ "images d'équations. Entrer ci-dessous le chemin de ces programmes. Notez " #~ "qu'un seul des deux programmes dvisvgm ou dvipng est nécessaire pour " #~ "générer les images d'équations." #~ msgid "Please save the document before using an \\include command..." #~ msgstr "" #~ "Veuillez enregistrer le document avant d'utiliser une commande " #~ "\\include..." #~ msgid "Please save the document before using an \\input command..." #~ msgstr "" #~ "Veuillez enregistrer le document avant d'utiliser une commande \\input..." libreoffice-texmaths-0.43/source/texmaths/po/xgettextbas000075540400000000065113206777051025457 0ustar kkremitzkikkremitzki#!/bin/sh # xgettextbas: extract strings from starbasic files (.xba). Need xgettext # Original author : Pierre Chef if [ -z "$1" ]; then echo "Usage : $0 file.xba > file.pot" exit 1 fi grep '_(\s*".*"\s*)' $* | sed 's/"/"/g' | sed -r 's/_\(("[^"]*")\)/gettext\(\1\);/g' | sed "s/'/'/g" | sed "s/>/>/g" | sed "s/</, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-22 13:37+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" msgid "About TexMaths" msgstr "" msgid "About" msgstr "" msgid "Display application informations" msgstr "" msgid "Display application changes" msgstr "" msgid "Display system informations" msgstr "" msgid "Close" msgstr "" msgid "Close window" msgstr "" msgid "" "You have to generate a first equation before the system log can be " "displayed..." msgstr "" msgid "TexMaths Equations" msgstr "" msgid "Name" msgstr "" msgid "Enter equation name here (can be left blank)" msgstr "" msgid "Image Format" msgstr "" msgid "Equation Type" msgstr "" msgid "Font Size" msgstr "" msgid "Set image format" msgstr "" msgid "Set image resolution" msgstr "" msgid "Transparency" msgstr "" msgid "Toggle image transparency" msgstr "" msgid "Set font size" msgstr "" msgid "Inline Display equation" msgstr "" msgid "Inline equation" msgstr "" msgid "Regular LaTeX code" msgstr "" msgid "Help..." msgstr "" msgid "Display help text" msgstr "" msgid "Preferences..." msgstr "" msgid "Set equation preferences" msgstr "" msgid "Preamble..." msgstr "" msgid "Set LaTeX preamble" msgstr "" msgid "Generate LaTeX equation" msgstr "" msgid "Increase window width" msgstr "" msgid "Decrease window width" msgstr "" msgid "Increase window height" msgstr "" msgid "Decrease window height" msgstr "" msgid "Please install the Draw component to run TexMaths!" msgstr "" msgid ": document type not supported by TexMaths" msgstr "" msgid "The selected object is not a TexMaths equation..." msgstr "" msgid "Please unselect it and call the macro again..." msgstr "" msgid "Edit equation..." msgstr "" msgid "Please enter some LaTeX code..." msgstr "" msgid "Please save the document before using an include command..." msgstr "" msgid "Please save the document before using an input command..." msgstr "" msgid "The file " msgstr "" msgid "tmpfile.tex cannot be created" msgstr "" msgid "Please check your installation..." msgstr "" msgid "No file created in the directory:" msgstr "" msgid "Script error: the dvi file was not converted to " msgstr "" msgid "Please check your system configuration..." msgstr "" msgid "TexMaths Help" msgstr "" msgid "TexMaths Preamble" msgstr "" msgid "Default" msgstr "" msgid "Load default preamble" msgstr "" msgid "Load" msgstr "" msgid "Load preamble saved into the current document" msgstr "" msgid "Apply" msgstr "" msgid "Apply current preamble" msgstr "" msgid "Save" msgstr "" msgid "Apply current preamble and save it into the current document" msgstr "" msgid "Do not use preamble for LaTeX type equations" msgstr "" msgid "" "Ignore preamble when generating LaTeX type equations. Full LaTeX code must " "then be entered in the TexMaths equation dialog." msgstr "" msgid "Preamble applied and saved..." msgstr "" msgid "Preamble applied..." msgstr "" msgid "TexMaths Preferences" msgstr "" msgid "Image parameters" msgstr "" msgid "Load default preferences" msgstr "" msgid "Load saved preferences" msgstr "" msgid "Apply and save current preferences" msgstr "" msgid "Writer font size" msgstr "" msgid "Impress font size" msgstr "" msgid "Draw font size" msgstr "" msgid "points" msgstr "" msgid "Inline display equation" msgstr "" msgid "Format" msgstr "" msgid "Image format" msgstr "" msgid "Image resolution" msgstr "" msgid "Preferences applied and saved..." msgstr "" msgid "Default preferences loaded..." msgstr "" msgid "User's preferences loaded..." msgstr "" msgid "TexMaths Recompile Equations" msgstr "" msgid "Run" msgstr "" msgid "Recompile TexMaths equations" msgstr "" msgid "Font size" msgstr "" msgid "Compatibility" msgstr "" msgid "Selection" msgstr "" msgid "Image transparency" msgstr "" msgid "Vertical alignment for Word export" msgstr "" msgid "Improve vertical alignment of Writer equations for Word export" msgstr "" msgid "Text font size" msgstr "" msgid "Image resolution (only for PNG images)" msgstr "" msgid "Recompile all equations" msgstr "" msgid "Recompile all equations from the document" msgstr "" msgid "Recompile selected equations" msgstr "" msgid "" "Recompile equations from the selected text area (does not process equations " "in tables, text frames, header and footer. Recompile those one by one if " "necessary)" msgstr "" msgid "Recompile equations from slide" msgstr "" msgid "Recompile equations from the current slide" msgstr "" msgid "Please wait during task execution..." msgstr "" msgid "Cancel" msgstr "" msgid "Cancel operation" msgstr "" msgid "Operation canceled!" msgstr "" msgid "Done!" msgstr "" msgid "No equation was recompiled." msgstr "" msgid "1 equation recompiled." msgstr "" msgid " equations recompiled." msgstr "" msgid "TexMaths System Configuration" msgstr "" msgid "Equations Shortcuts" msgstr "" msgid "Numbered Equations Shortcut" msgstr "" msgid "Same shortcut for Writer, Impress and Draw" msgstr "" msgid "Use the same shortcut for Writer, Impress and Draw" msgstr "" msgid "System Paths" msgstr "" msgid "All" msgstr "" msgid "Keyboard shortcut" msgstr "" msgid "Path of the latex program" msgstr "" msgid "Path of the dvipng program" msgstr "" msgid "Path of the dvisvgm program" msgstr "" msgid "Save system configuration" msgstr "" msgid "Numbering Level" msgstr "" msgid "Chapter level number to be included in equation numbers" msgstr "" msgid "Level number" msgstr "" msgid "Caption left alignment" msgstr "" msgid "Set equation caption alignment to left" msgstr "" msgid "Caption right alignment" msgstr "" msgid "Set equation caption alignment to right" msgstr "" msgid "Paths" msgstr "" msgid "Display the Paths tab" msgstr "" msgid "Options" msgstr "" msgid "Display the Options tab" msgstr "" msgid "Shortcuts" msgstr "" msgid "Display the Shortcuts tab" msgstr "" msgid "Numbered Equations" msgstr "" msgid "Paragraph break before numbered equations" msgstr "" msgid "Add a paragraph break before numbered equations" msgstr "" msgid "Paragraph break after numbered equations" msgstr "" msgid "Add a paragraph break after numbered equations" msgstr "" msgid "Equation Caption" msgstr "" msgid "Display text before equation number (leave blank if no text desired)" msgstr "" msgid "" "The TexMaths macro uses some external programs to generate the equation " "images. Enter below the paths of the folders that contain these programs. " "Note that only one of the dvisvgm or dvipng programs is required to generate " "equation images." msgstr "" msgid "" "Ex: For a standard MiKTeX 2.9 install on Windows, enter the following path " "into the latex.exe field:" msgstr "" msgid "latex.exe (mandatory)" msgstr "" msgid "dvipng.exe (optional)" msgstr "" msgid "dvisvgm.exe (optional)" msgstr "" msgid "" "Ex: For a standard LaTeX install on Mac OS, enter the following path into " "the latex field:" msgstr "" msgid "latex (mandatory)" msgstr "" msgid "dvipng (optional)" msgstr "" msgid "dvisvgm (optional)" msgstr "" msgid "" "Ex: For a standard LaTeX install on Linux, enter the following path into the " "latex field:" msgstr "" msgid "Please configure first TexMaths before using it..." msgstr "" msgid "Can't find the external program " msgstr "" msgid "Please check the paths in your TexMaths system configuration..." msgstr "" msgid "Can't find at least one of the external programs " msgstr "" msgid " or " msgstr "" msgid "" "Shortcuts assigned to the Equations and NumberedEquations modules must be " "different!" msgstr "" msgid "Please check your shortcuts..." msgstr "" msgid "Please set the latex path..." msgstr "" msgid "Please set at least one dvipng path or the dvisvgm path..." msgstr "" msgid "The program latex.exe is not located in " msgstr "" msgid "The program dvipng.exe is not located in " msgstr "" msgid "The program dvisvgm.exe is not located in " msgstr "" msgid "The program latex is not located in " msgstr "" msgid "The program dvipng is not located in " msgstr "" msgid "The program dvisvgm is not located in " msgstr "" msgid "Only characters from A to Z are allowed for shortcuts!" msgstr "" msgid "The key combination CTRL + " msgstr "" msgid " is already assigned to the command " msgstr "" msgid "Do you want to set the command" msgstr "" msgid "Error: can't find file " msgstr "" msgid "Error: can't decode SVG file, please check your LaTeX code..." msgstr "" msgid "Error: please check the equation syntax..." msgstr "" msgid "Error: the file " msgstr "" msgid " doesn't exist..." msgstr "" msgid "Can't find " msgstr "" libreoffice-texmaths-0.43/source/texmaths/po/de.po000064440400000003327313206777051024125 0ustar kkremitzkikkremitzki# TexMaths, a LaTeX equation editor for LibreOffice # Copyright (C) 2012-2017 - Roland Baudin # This file is distributed under the same license as the TexMaths package. # Lars Kapp , 2014. # msgid "" msgstr "" "Project-Id-Version: TexMaths 0.41\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-22 13:37+0100\n" "PO-Revision-Date: 2014-06-22 13:00+1\n" "Last-Translator: Lars Kapp \n" "Language-Team: German \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" msgid "About TexMaths" msgstr "Über TexMaths" msgid "About" msgstr "Über" msgid "Display application informations" msgstr "Anwendungsinformationen anzeigen" msgid "Display application changes" msgstr "Anwendungsänderungen anzeigen" msgid "Display system informations" msgstr "Systeminformationen anzeigen" msgid "Close" msgstr "Schließen" msgid "Close window" msgstr "Fenster schließen" msgid "" "You have to generate a first equation before the system log can be " "displayed..." msgstr "" "Sie müssen eine erste Gleichung erstellen, bevor das System-Log angezeigt " "werden kann" msgid "TexMaths Equations" msgstr "TexMath Gleichung" msgid "Name" msgstr "" msgid "Enter equation name here (can be left blank)" msgstr "" msgid "Image Format" msgstr "Bildformat" msgid "Equation Type" msgstr "Gleichungsart" msgid "Font Size" msgstr "Schriftgröße" msgid "Set image format" msgstr "Bildformat einstellen" msgid "Set image resolution" msgstr "Bildauflösung einstellen" msgid "Transparency" msgstr "Transparenz" msgid "Toggle image transparency" msgstr "Bildtransparenz wechseln" msgid "Set font size" msgstr "Schriftgröße einstellen" msgid "Inline Display equation" msgstr "Inline Display Gleichung" msgid "Inline equation" msgstr "Inline Gleichung" msgid "Regular LaTeX code" msgstr "Regulärer Latex Code" msgid "Help..." msgstr "Hilfe" msgid "Display help text" msgstr "Hilfetext anzeigen" msgid "Preferences..." msgstr "Einstellungen" msgid "Set equation preferences" msgstr "Gleichungseinstellungen ändern" msgid "Preamble..." msgstr "Präambel..." msgid "Set LaTeX preamble" msgstr "LaTeX Präambel einstellen" msgid "Generate LaTeX equation" msgstr "LaTeX Gleichung erstellen" msgid "Increase window width" msgstr "Fensterbreite erhöhen" msgid "Decrease window width" msgstr "Fensterbreite verringern" msgid "Increase window height" msgstr "Fensterhöhe vergrößern" msgid "Decrease window height" msgstr "Fensterhöhe verringern" msgid "Please install the Draw component to run TexMaths!" msgstr "Bitte installieren Sie Draw-Komponente, damit TexMaths funktioniert!" msgid ": document type not supported by TexMaths" msgstr ": Dokumententyp wird von TexMaths nicht unterstützt" msgid "The selected object is not a TexMaths equation..." msgstr "Das gewählte Objekt ist keine TexMaths-Gleichung" msgid "Please unselect it and call the macro again..." msgstr "Bitte deselektieren und das Makro erneut aufrufen" msgid "Edit equation..." msgstr "Gleichung bearbeiten" msgid "Please enter some LaTeX code..." msgstr "Bitte geben Sie etwas LaTeX Code ein" msgid "Please save the document before using an include command..." msgstr "" msgid "Please save the document before using an input command..." msgstr "" msgid "The file " msgstr "Die Datei " msgid "tmpfile.tex cannot be created" msgstr "tmpfile.tex kann nicht erstellt werden" msgid "Please check your installation..." msgstr "Bitte prüfen Sie ihre Installation" msgid "No file created in the directory:" msgstr "Keine Datei erzeugt im Ordner:" msgid "Script error: the dvi file was not converted to " msgstr "Skript-Fehler: Die dvi-Datei wurde umgewandelt in " msgid "Please check your system configuration..." msgstr "Bitte prüfen Sie ihre Systemeinstellung..." msgid "TexMaths Help" msgstr "TexMaths Hilfe" msgid "TexMaths Preamble" msgstr "TexMaths Präambel" msgid "Default" msgstr "Standard" msgid "Load default preamble" msgstr "Lade Standard-Präambel" msgid "Load" msgstr "Laden" msgid "Load preamble saved into the current document" msgstr "Lade Präambel, die in das aktuelle Dokument gespeichert wurde" msgid "Apply" msgstr "Anwenden" msgid "Apply current preamble" msgstr "Aktuelle Präambel anwenden" msgid "Save" msgstr "Speichern" msgid "Apply current preamble and save it into the current document" msgstr "Aktuelle Präambel anwenden und in das aktuelle Dokument speichern" msgid "Do not use preamble for LaTeX type equations" msgstr "" msgid "" "Ignore preamble when generating LaTeX type equations. Full LaTeX code must " "then be entered in the TexMaths equation dialog." msgstr "" msgid "Preamble applied and saved..." msgstr "Präambel angewendet und gespeichert..." msgid "Preamble applied..." msgstr "Präambel angewendet..." msgid "TexMaths Preferences" msgstr "TexMath Einstellungen" msgid "Image parameters" msgstr "Bildparameter" msgid "Load default preferences" msgstr "Lade Standardeinstellungen" msgid "Load saved preferences" msgstr "Lade gespeicherte Einstellungen" msgid "Apply and save current preferences" msgstr "Aktuelle Einstellungen anwenden und speichern" msgid "Writer font size" msgstr "Writer Schriftgröße" msgid "Impress font size" msgstr "Impress Schriftgröße" msgid "Draw font size" msgstr "Draw Schriftgröße" msgid "points" msgstr "Punkte" msgid "Inline display equation" msgstr "Inline Display Gleichung" msgid "Format" msgstr "Format" msgid "Image format" msgstr "Bildformat" msgid "Image resolution" msgstr "Bildauflösung" msgid "Preferences applied and saved..." msgstr "Einstellungen angewendet und gespeichert..." msgid "Default preferences loaded..." msgstr "Standard Einstellung geladen..." msgid "User's preferences loaded..." msgstr "Benutzereinstellungen geladen..." msgid "TexMaths Recompile Equations" msgstr "" msgid "Run" msgstr "" msgid "Recompile TexMaths equations" msgstr "" msgid "Font size" msgstr "" msgid "Compatibility" msgstr "Kompatibilität" msgid "Selection" msgstr "" msgid "Image transparency" msgstr "" msgid "Vertical alignment for Word export" msgstr "Vertikale Ausrichtung für Word Export" msgid "Improve vertical alignment of Writer equations for Word export" msgstr "" "Verbessere vertikale Ausrichtung von Writer Gleichungen für Word Export" msgid "Text font size" msgstr "" msgid "Image resolution (only for PNG images)" msgstr "" msgid "Recompile all equations" msgstr "" msgid "Recompile all equations from the document" msgstr "" msgid "Recompile selected equations" msgstr "" msgid "" "Recompile equations from the selected text area (does not process equations " "in tables, text frames, header and footer. Recompile those one by one if " "necessary)" msgstr "" msgid "Recompile equations from slide" msgstr "" msgid "Recompile equations from the current slide" msgstr "" msgid "Please wait during task execution..." msgstr "" msgid "Cancel" msgstr "" msgid "Cancel operation" msgstr "" msgid "Operation canceled!" msgstr "" msgid "Done!" msgstr "" msgid "No equation was recompiled." msgstr "" msgid "1 equation recompiled." msgstr "" msgid " equations recompiled." msgstr "" msgid "TexMaths System Configuration" msgstr "TexMaths Systemeinstellungen" msgid "Equations Shortcuts" msgstr "Gleichungsvorlagen" msgid "Numbered Equations Shortcut" msgstr "Tastenkürzel für nummerierte Gleichungen" msgid "Same shortcut for Writer, Impress and Draw" msgstr "" msgid "Use the same shortcut for Writer, Impress and Draw" msgstr "" msgid "System Paths" msgstr "Systempfad" msgid "All" msgstr "Alle" msgid "Keyboard shortcut" msgstr "Tastenkürzel" msgid "Path of the latex program" msgstr "Pfad zum latex Programm" msgid "Path of the dvipng program" msgstr "Pfad zum dvipng Programm" msgid "Path of the dvisvgm program" msgstr "Pfad zum dvisvgm Programm" msgid "Save system configuration" msgstr "Speichere Systemeinstellungen" msgid "Numbering Level" msgstr "Nummerierungsebene" msgid "Chapter level number to be included in equation numbers" msgstr "Kapitelnummer soll in Gleichungsnummer eingefügt werden" msgid "Level number" msgstr "Ebenennummer" msgid "Caption left alignment" msgstr "" msgid "Set equation caption alignment to left" msgstr "" msgid "Caption right alignment" msgstr "" msgid "Set equation caption alignment to right" msgstr "" msgid "Paths" msgstr "Pfade" msgid "Display the Paths tab" msgstr "Pfad-Tab anzeigen" msgid "Options" msgstr "Optionen" msgid "Display the Options tab" msgstr "Option-Tab anzeigen" msgid "Shortcuts" msgstr "Tastenkürzel" msgid "Display the Shortcuts tab" msgstr "Tastenkürzel-Tab anzeigen" msgid "Numbered Equations" msgstr "Nummerierte Gleichungen" msgid "Paragraph break before numbered equations" msgstr "Absatzumbruch vor nummerierten Gleichungen" msgid "Add a paragraph break before numbered equations" msgstr "Füge einen Absatzumbruch vor nummerierten Gleichungen ein" msgid "Paragraph break after numbered equations" msgstr "Absatzumbruch nach nummerierten Gleichungen" msgid "Add a paragraph break after numbered equations" msgstr "Füge einen Absatzumbruch nach nummerierten Gleichungen ein" msgid "Equation Caption" msgstr "Gleichungsüberschrift" msgid "Display text before equation number (leave blank if no text desired)" msgstr "" "Text vor Gleichungsnummer anzeigen (frei lassen, wenn kein Text gewünscht " "ist)" msgid "" "The TexMaths macro uses some external programs to generate the equation " "images. Enter below the paths of the folders that contain these programs. " "Note that only one of the dvisvgm or dvipng programs is required to generate " "equation images." msgstr "" msgid "" "Ex: For a standard MiKTeX 2.9 install on Windows, enter the following path " "into the latex.exe field:" msgstr "" "Bsp.: Für eine normale MiKTeX 2.9 Installation unter Windows, geben Sie den " "folgenden Pfad in das latex.exe Feld ein:" msgid "latex.exe (mandatory)" msgstr "latex.exe (erforderlich)" msgid "dvipng.exe (optional)" msgstr "dvipng.exe (optional)" msgid "dvisvgm.exe (optional)" msgstr "dvisvgm.exe (optional)" msgid "" "Ex: For a standard LaTeX install on Mac OS, enter the following path into " "the latex field:" msgstr "" "Bsp.: Fr eine normale LaTeX Installation unter Mac OS, geben Sie den " "folgenden Pfad in das latex Feld ein:" msgid "latex (mandatory)" msgstr "latex.exe (erforderlich)" msgid "dvipng (optional)" msgstr "dvipng (optional)" msgid "dvisvgm (optional)" msgstr "dvisvgm (optional)" msgid "" "Ex: For a standard LaTeX install on Linux, enter the following path into the " "latex field:" msgstr "" "Bsp.: Für eine normale LaTeX Installation unter Linux, geben Sie den " "folgenden Pfad in das latex-Feld ein:" msgid "Please configure first TexMaths before using it..." msgstr "Bitte konfigurieren Sie zuerst TexMaths, bevor Sie es benutzen..." msgid "Can't find the external program " msgstr "Kann das externe Programm nicht finden " msgid "Please check the paths in your TexMaths system configuration..." msgstr "Bitte prüfen Sie den Pfad in ihrer TexMaths Systemeinstellung..." msgid "Can't find at least one of the external programs " msgstr "Kann mindestens eines der externen Programme nicht finden " msgid " or " msgstr " oder " msgid "" "Shortcuts assigned to the Equations and NumberedEquations modules must be " "different!" msgstr "" "Tastenkürzel für die Gleichungs- und nummerierten Gleichungs-Module muss " "unterschiedlich sein!" msgid "Please check your shortcuts..." msgstr "Bitte berprfen Sei ihre Tastenkürzel" msgid "Please set the latex path..." msgstr "Bitte geben Sie einen latex-Pfad an..." msgid "Please set at least one dvipng path or the dvisvgm path..." msgstr "Bitte geben Sie mindestens einen dvipng oder dvisvgm Pfad an..." msgid "The program latex.exe is not located in " msgstr "Das Programm latex.exe wird nicht gefunden in " msgid "The program dvipng.exe is not located in " msgstr "Das Programm dvipng.exe wird nicht gefunden in " msgid "The program dvisvgm.exe is not located in " msgstr "Das Programm dvisvgm.exe wird nicht gefunden in " msgid "The program latex is not located in " msgstr "Das Programm latex wird nicht gefunden in " msgid "The program dvipng is not located in " msgstr "Das Programm dvipng wird nicht gefunden in " msgid "The program dvisvgm is not located in " msgstr "Das Programm dvisvgm. wird nicht gefunden in " msgid "Only characters from A to Z are allowed for shortcuts!" msgstr "Es sind nur Buchstaben von A bis Z für Tastenkürzel erlaubt" msgid "The key combination CTRL + " msgstr "Die Tastenkombination STRG + " msgid " is already assigned to the command " msgstr " ist bereits zugeordnet zum Befehl " msgid "Do you want to set the command" msgstr "Möchten Sie den Befehl festlegen" msgid "Error: can't find file " msgstr "Fehler: Datei kann nicht gefunden werden: " msgid "Error: can't decode SVG file, please check your LaTeX code..." msgstr "" msgid "Error: please check the equation syntax..." msgstr "Fehler: Bitte prüfen Sie die Gleichungssyntax..." msgid "Error: the file " msgstr "Fehler: Die Datei " msgid " doesn't exist..." msgstr " existiert nicht..." msgid "Can't find " msgstr "Unauffindbar " #~ msgid "" #~ "The TexMaths macro uses some external programs to generate the equation " #~ "images. Enter below the path of these programs. Note that only one of the " #~ "dvisvgm or dvipng programs is required to generate equation images." #~ msgstr "" #~ "Das TexMaths Makro verwendet einige externe Programme, um " #~ "Gleichungenbilder zu erzeugen. Geben Sie die Pfade zu diesen Programmen " #~ "unten ein. Beachten Sie, dass nur eines der Programme dvisvgm oder dvipng " #~ "notwendig ist, um Gleichungsbilder zu erzeugen. " #~ msgid "Load saved preamble" #~ msgstr "Lade gespeicherte Prambel" #~ msgid "Apply and save current preamble" #~ msgstr "Aktuelle Prambel anwenden und speichern" libreoffice-texmaths-0.43/source/texmaths/po/es.po000064440400000003331713206777051024143 0ustar kkremitzkikkremitzki# TexMaths, un editor LaTeX para LibreOffice # Copyright (C) 2012-2017 - Roland Baudin # Este archivo se distribuye bajo la misma licencia que el paquete TexMaths # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-22 13:37+0100\n" "PO-Revision-Date: 2012-05-04 HO:MI+ZONE\n" "Last-Translator: Luis Jaime Salazar Ramírez \n" "Language-Team: Español \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" msgid "About TexMaths" msgstr "Acerca de TexMaths" msgid "About" msgstr "Acerca de" msgid "Display application informations" msgstr "Mostrar información de la aplicación" msgid "Display application changes" msgstr "Mostrar cambios en la aplicación" msgid "Display system informations" msgstr "Mostrar informaciones del sistema" msgid "Close" msgstr "Cerrar" msgid "Close window" msgstr "Cerrar ventana" msgid "" "You have to generate a first equation before the system log can be " "displayed..." msgstr "" "Usted ha generado la primera ecuación antes de que el 'log' del sistema se " "pueda mostrar..." msgid "TexMaths Equations" msgstr "Ecuaciones TexMaths" msgid "Name" msgstr "" msgid "Enter equation name here (can be left blank)" msgstr "" msgid "Image Format" msgstr "Formato de Imagen" msgid "Equation Type" msgstr "Tipo de Ecuación" msgid "Font Size" msgstr "Tamaño de la fuente" msgid "Set image format" msgstr "Seleccione el formato de imagen" msgid "Set image resolution" msgstr "Seleccione la resolución de la imagen" msgid "Transparency" msgstr "" msgid "Toggle image transparency" msgstr "" msgid "Set font size" msgstr "Seleccione el tamaño de la fuente" msgid "Inline Display equation" msgstr "Ecuación en línea, formato 'Display'" msgid "Inline equation" msgstr "Ecuación en línea" msgid "Regular LaTeX code" msgstr "Código regular LaTeX" msgid "Help..." msgstr "Ayuda..." msgid "Display help text" msgstr "Muestre el texto de ayuda" msgid "Preferences..." msgstr "Preferencias" msgid "Set equation preferences" msgstr "Seleccione las preferencias de ayuda" msgid "Preamble..." msgstr "Preámbulo..." msgid "Set LaTeX preamble" msgstr "Seleccione el preámbulo LaTeX" msgid "Generate LaTeX equation" msgstr "Generar la ecuación LaTeX" msgid "Increase window width" msgstr "Aumentar el ancho de la ventana" msgid "Decrease window width" msgstr "Decrementar el ancho de la ventana" msgid "Increase window height" msgstr "Incrementar la altura de la ventana" msgid "Decrease window height" msgstr "Decrementar la altura de la ventana" msgid "Please install the Draw component to run TexMaths!" msgstr "" msgid ": document type not supported by TexMaths" msgstr ": tipo de documento no soportado por TexMaths" msgid "The selected object is not a TexMaths equation..." msgstr "El objeto seleccionado no es una ecuación TexMaths..." msgid "Please unselect it and call the macro again..." msgstr "Por favor desmárquelo y llame el macro nuevamente..." msgid "Edit equation..." msgstr "Editar ecuación..." msgid "Please enter some LaTeX code..." msgstr "Por favor escriba algún código LaTeX..." msgid "Please save the document before using an include command..." msgstr "" msgid "Please save the document before using an input command..." msgstr "" msgid "The file " msgstr "El archivo" msgid "tmpfile.tex cannot be created" msgstr "tmpfile.tex no puede ser creado" msgid "Please check your installation..." msgstr "Por favor revise su instalación..." msgid "No file created in the directory:" msgstr "Ningún archivo creado en el directorio:" msgid "Script error: the dvi file was not converted to " msgstr "Error en el script: el archivo dvi no se pudo convertir a" msgid "Please check your system configuration..." msgstr "Por favor revise su configuración de sistema..." msgid "TexMaths Help" msgstr "Ayuda de TexMaths" msgid "TexMaths Preamble" msgstr "Preámbulo TexMaths" msgid "Default" msgstr "Por defecto" msgid "Load default preamble" msgstr "Cargar el preámbulo por defecto" msgid "Load" msgstr "Cargar" msgid "Load preamble saved into the current document" msgstr "" msgid "Apply" msgstr "Aplicar" msgid "Apply current preamble" msgstr "Aplicar el actual preámbulo" msgid "Save" msgstr "Guardar" msgid "Apply current preamble and save it into the current document" msgstr "" #, fuzzy msgid "Do not use preamble for LaTeX type equations" msgstr "Generar la ecuación LaTeX" msgid "" "Ignore preamble when generating LaTeX type equations. Full LaTeX code must " "then be entered in the TexMaths equation dialog." msgstr "" msgid "Preamble applied and saved..." msgstr "Preámbulo aplicado y guardado..." msgid "Preamble applied..." msgstr "Preámbulo aplicado..." msgid "TexMaths Preferences" msgstr "Preferencias TexMaths" msgid "Image parameters" msgstr "Parámetros de imagen" msgid "Load default preferences" msgstr "Cargar las preferencias por defecto" msgid "Load saved preferences" msgstr "Cargar preferencias guardadas" msgid "Apply and save current preferences" msgstr "Aplicar y guardar las preferencias actuales" msgid "Writer font size" msgstr "Tamaño de la fuente 'Writer'" msgid "Impress font size" msgstr "Tamaño de la fuente 'Impress'" msgid "Draw font size" msgstr "Tamaño de la fuente 'Draw'" msgid "points" msgstr "puntos" msgid "Inline display equation" msgstr "Mostrar ecuación en línea" msgid "Format" msgstr "Formato" msgid "Image format" msgstr "Formato de imagen" msgid "Image resolution" msgstr "Resolución de imagen" msgid "Preferences applied and saved..." msgstr "Preferencias aplicadas y gardadas..." msgid "Default preferences loaded..." msgstr "Preferencias por defecto cargadas..." msgid "User's preferences loaded..." msgstr "Preferencias del usuario cargadas..." msgid "TexMaths Recompile Equations" msgstr "" msgid "Run" msgstr "" msgid "Recompile TexMaths equations" msgstr "" msgid "Font size" msgstr "" msgid "Compatibility" msgstr "" msgid "Selection" msgstr "" msgid "Image transparency" msgstr "" msgid "Vertical alignment for Word export" msgstr "" msgid "Improve vertical alignment of Writer equations for Word export" msgstr "" msgid "Text font size" msgstr "" msgid "Image resolution (only for PNG images)" msgstr "" msgid "Recompile all equations" msgstr "" msgid "Recompile all equations from the document" msgstr "" msgid "Recompile selected equations" msgstr "" msgid "" "Recompile equations from the selected text area (does not process equations " "in tables, text frames, header and footer. Recompile those one by one if " "necessary)" msgstr "" msgid "Recompile equations from slide" msgstr "" msgid "Recompile equations from the current slide" msgstr "" msgid "Please wait during task execution..." msgstr "" msgid "Cancel" msgstr "" msgid "Cancel operation" msgstr "" msgid "Operation canceled!" msgstr "" msgid "Done!" msgstr "" msgid "No equation was recompiled." msgstr "" msgid "1 equation recompiled." msgstr "" msgid " equations recompiled." msgstr "" msgid "TexMaths System Configuration" msgstr "Configuración del sistema TexMaths" msgid "Equations Shortcuts" msgstr "Atajos para ecuaciones" msgid "Numbered Equations Shortcut" msgstr "Atajos para ecuaciones numeradas" msgid "Same shortcut for Writer, Impress and Draw" msgstr "" msgid "Use the same shortcut for Writer, Impress and Draw" msgstr "" msgid "System Paths" msgstr "Rutas del sistema" msgid "All" msgstr "Todo" msgid "Keyboard shortcut" msgstr "Atajos de teclado" msgid "Path of the latex program" msgstr "Ruta del programa LaTeX" msgid "Path of the dvipng program" msgstr "Ruta del programa dvipng" msgid "Path of the dvisvgm program" msgstr "Ruta del programa dvisvgm" msgid "Save system configuration" msgstr "Guardar la configuración del sistema" msgid "Numbering Level" msgstr "Nivel de numeración" msgid "Chapter level number to be included in equation numbers" msgstr "" "Nivel de numeración del capítulo para ser incluido en los números de las " "ecuaciones" msgid "Level number" msgstr "Número de nivel" msgid "Caption left alignment" msgstr "" msgid "Set equation caption alignment to left" msgstr "" msgid "Caption right alignment" msgstr "" msgid "Set equation caption alignment to right" msgstr "" msgid "Paths" msgstr "Rutas" msgid "Display the Paths tab" msgstr "Mostrar la pestaña de rutas" msgid "Options" msgstr "Opciones" msgid "Display the Options tab" msgstr "Mostrar la pestaña de opciones" msgid "Shortcuts" msgstr "Atajos" msgid "Display the Shortcuts tab" msgstr "Mostrar la pestaña de atajos" msgid "Numbered Equations" msgstr "Ecuaciones numeradas" msgid "Paragraph break before numbered equations" msgstr "Ruptura de párrafo antes de las ecuaciones numeradas" msgid "Add a paragraph break before numbered equations" msgstr "Adicionar una ruptura de párrafo antes de las ecuaciones numeradas" msgid "Paragraph break after numbered equations" msgstr "Ruptura de párrafo después de las ecuaciones numeradas" msgid "Add a paragraph break after numbered equations" msgstr "Adicionar una ruptura de párrafo después de las ecuaciones numeradas" msgid "Equation Caption" msgstr "Etiqueta de la ecuación" msgid "Display text before equation number (leave blank if no text desired)" msgstr "" "Mostrar texto antes de la ecuación numerada (deje en blanco si no desea " "alguno)" msgid "" "The TexMaths macro uses some external programs to generate the equation " "images. Enter below the paths of the folders that contain these programs. " "Note that only one of the dvisvgm or dvipng programs is required to generate " "equation images." msgstr "" msgid "" "Ex: For a standard MiKTeX 2.9 install on Windows, enter the following path " "into the latex.exe field:" msgstr "" "Ejemplo: para una instalación estándar MiKTeX 2.9 sobre Windows, escriba " "lasiguiente ruta dentro del campo latex.exe: " msgid "latex.exe (mandatory)" msgstr "latex.exe (requerido)" msgid "dvipng.exe (optional)" msgstr "dvipng.exe (opcional)" msgid "dvisvgm.exe (optional)" msgstr "dvisvgm.exe (opcional)" msgid "" "Ex: For a standard LaTeX install on Mac OS, enter the following path into " "the latex field:" msgstr "" "Ejemplo: para una instalación LaTeX estándar sobre Mac OS, escriba la " "siguiente ruta en el campo latex:" msgid "latex (mandatory)" msgstr "latex (requerido)" msgid "dvipng (optional)" msgstr "dvipng (opciona)" msgid "dvisvgm (optional)" msgstr "dvisvgm (opcional)" msgid "" "Ex: For a standard LaTeX install on Linux, enter the following path into the " "latex field:" msgstr "" "Ejemplo: para una instalación LaTeX estándar sobre Linux, escriba la " "siguiente ruta en el campo latex:" msgid "Please configure first TexMaths before using it..." msgstr "Por favor primero configure TexMaths antes de usarlo..." msgid "Can't find the external program " msgstr "No es posible encontrar el programa externo " msgid "Please check the paths in your TexMaths system configuration..." msgstr "" "Por favor revise las rutas en la configuración de su sistema TexMaths..." msgid "Can't find at least one of the external programs " msgstr "No es posible encontrar por lo menos uno de los programas " msgid " or " msgstr " o " msgid "" "Shortcuts assigned to the Equations and NumberedEquations modules must be " "different!" msgstr "" "¡Los atajos asignados a los módulos de ecuaciones y ecuaciones numeradas " "deben ser distintos!" msgid "Please check your shortcuts..." msgstr "Por favor revise sus atajos..." msgid "Please set the latex path..." msgstr "Por favor Seleccione la ruta del latex..." msgid "Please set at least one dvipng path or the dvisvgm path..." msgstr "Por favor Seleccione al menos una de las rutas: dvipng o dvisvgm..." msgid "The program latex.exe is not located in " msgstr "El progrma latex.exe no se ha localizado en " msgid "The program dvipng.exe is not located in " msgstr "El programa dvipng.exe no se ha localizado en " msgid "The program dvisvgm.exe is not located in " msgstr "El programa dvisvgm.exe no se ha econtrado en " msgid "The program latex is not located in " msgstr "El programa latex no se ha encontrado en " msgid "The program dvipng is not located in " msgstr "El programa dvipng no se ha encontrado en " msgid "The program dvisvgm is not located in " msgstr "El programa dvisvgm no se ha encontrado en" msgid "Only characters from A to Z are allowed for shortcuts!" msgstr "¡Para los atajos, soló se permiten caracteres de la A a la Z!" msgid "The key combination CTRL + " msgstr "La combinación de teclas CTRL + " msgid " is already assigned to the command " msgstr " ya está asignada al comando " msgid "Do you want to set the command" msgstr "¿Desea modificar el comando?" msgid "Error: can't find file " msgstr "Error: no se encuentra el archivo " msgid "Error: can't decode SVG file, please check your LaTeX code..." msgstr "" msgid "Error: please check the equation syntax..." msgstr "Error: por favor revise la sintaxis de la ecuación..." msgid "Error: the file " msgstr "Error: el archivo " msgid " doesn't exist..." msgstr " no existe..." msgid "Can't find " msgstr "No se encuentra " #~ msgid "" #~ "The TexMaths macro uses some external programs to generate the equation " #~ "images. Enter below the path of these programs. Note that only one of the " #~ "dvisvgm or dvipng programs is required to generate equation images." #~ msgstr "" #~ "El macro TexMaths usa algunos programas externos para generar las " #~ "imagenes de las ecuaciones. Registre abajo las rutas de esos programas. " #~ "Note que sólamente uno de los programas dvisvgm o dvipng son requeridos " #~ "para gnerar las imagenes de las ecuaciones" #~ msgid "Load saved preamble" #~ msgstr "Cargar preámbulo guardado" #~ msgid "Apply and save current preamble" #~ msgstr "Aplicar y guardar el actual preámbulo" libreoffice-texmaths-0.43/source/texmaths/TexMaths/000075540400000000000013206777051024304 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsEquations_Dlg.xba000064440400000004577713206777051031240 0ustar kkremitzkikkremitzki ' ' TexMathsEquations_Dlg ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to create and manage the TexMaths Equation dialog ' Force variable declaration Option Explicit ' Dialog declaration Private oDlgMain as Variant ' Create and display dialog Sub TexMathsDialog( sEqSize as String, sEqType as String, sEqCode as String, sEqFormat as String, sEqDPI as String, sEqTransp as String, sEqName as String) ' Load the library TexMaths DialogLibraries.LoadLibrary( "TexMaths" ) ' Create the dialog object oDlgMain = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsEquations_GUI") ) ' Dialog strings for translation oDlgMain.setTitle( _("TexMaths Equations") ) oDlgMain.getControl("EquationNameLabel").Model.Label = _("Name") oDlgMain.getControl("EquationNameText").Model.HelpText = _("Enter equation name here (can be left blank)") oDlgMain.getControl("EquationNameText").setText(sEqName) oDlgMain.getControl("ImageformatFrame").Model.Label = _("Image Format") oDlgMain.getControl("EquationtypeFrame").Model.Label = _("Equation Type") oDlgMain.getControl("FontsizeFrame").Model.Label = _("Font Size") oDlgMain.getControl("Format").Model.HelpText = _("Set image format") oDlgMain.getControl("GraphicDPI").Model.HelpText = _("Set image resolution") oDlgMain.getControl("Transparency").Model.Label = _("Transparency") oDlgMain.getControl("Transparency").Model.HelpText = _("Toggle image transparency") oDlgMain.getControl("Size").Model.HelpText = _("Set font size") oDlgMain.getControl("TypeDisplay").Model.HelpText = _("Inline Display equation") oDlgMain.getControl("TypeInline").Model.HelpText = _("Inline equation") oDlgMain.getControl("TypeLatex").Model.HelpText = _("Regular LaTeX code") oDlgMain.getControl("HelpButton").Model.Label = _("Help...") oDlgMain.getControl("HelpButton").Model.HelpText = _("Display help text") oDlgMain.getControl("PreferencesButton").Model.Label = _("Preferences...") oDlgMain.getControl("PreferencesButton").Model.HelpText = _("Set equation preferences") oDlgMain.getControl("PreambleButton").Model.Label = _("Preamble...") oDlgMain.getControl("PreambleButton").Model.HelpText = _("Set LaTeX preamble") oDlgMain.getControl("LatexButton").Model.HelpText = _("Generate LaTeX equation") oDlgMain.getControl("IncWidthButton").Model.HelpText = _("Increase window width") oDlgMain.getControl("DecWidthButton").Model.HelpText = _("Decrease window width") oDlgMain.getControl("IncHeightButton").Model.HelpText = _("Increase window height") oDlgMain.getControl("DecHeightButton").Model.HelpText = _("Decrease window height") ' Arrow icons for resize buttons oDlgMain.getControl("IncWidthButton").Model.ImageURL = glb_sPkgPath & "icons/right.png" oDlgMain.getControl("DecWidthButton").Model.ImageURL = glb_sPkgPath & "icons/left.png" oDlgMain.getControl("DecHeightButton").Model.ImageURL = glb_sPkgPath & "icons/up.png" oDlgMain.getControl("IncHeightButton").Model.ImageURL = glb_sPkgPath & "icons/down.png" ' Define list values oDlgMain.getControl("Format").addItems(Array("png","svg"),0) oDlgMain.getControl("GraphicDPI").addItems(Array("72","96","120","150","200","300","600","1200"),0) oDlgMain.getControl("Size").addItems(Array("6","7","8","9","10","10.5","11","12","13","14","15","16","18","20","22","24","26","28","32","36","40","44","48","54","60","66","72","80","88","96"),0) ' Set the actual values oDlgMain.getControl("Size").setText(sEqSize) If sEqType = "display" Then oDlgMain.getControl("TypeDisplay").setState(1) If sEqType = "inline" Then oDlgMain.getControl("TypeInline").setState(1) If sEqType = "latex" Then oDlgMain.getControl("TypeLatex").setState(1) ' Set text values oDlgMain.getControl("LatexCode").setText(sEqCode) oDlgMain.getControl("LogString").setText( glb_sStatus ) oDlgMain.getControl("Format").setText(sEqFormat) oDlgMain.getControl("GraphicDPI").setText(sEqDPI) ' Set transparency If sEqTransp = "TRUE" Then oDlgMain.getControl("Transparency").setState(1) Else oDlgMain.getControl("Transparency").setState(0) End If ' Get the dvipng and dvisvgm paths saved in the registry Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' Transitional code ' Window size unit has changed, so we reinit the sizes ' and position at first run, otherwise the window will be too big If oSystemInfo.NewSizeUnit = "" Then oSystemInfo.PositionX = "127" oSystemInfo.PositionY = "85" oSystemInfo.Width = "306" oSystemInfo.Height = "250" oSystemInfo.NewSizeUnit = "1" oSystemInfo.commitChanges() End If ' End of transitional code ' Disable png and force svg if dvipng path is empty If oSystemInfo.DvipngPath = "" Then glb_sFormat = "svg" sEqFormat = glb_sFormat oDlgMain.getControl("Format").setText("svg") oDlgMain.getControl("Format").setEnable(FALSE) End If ' Disable svg and force png if dvisvgm path is empty If oSystemInfo.DvisvgmPath = "" Then glb_sFormat = "png" sEqFormat = glb_sFormat oDlgMain.getControl("Format").setText("png") oDlgMain.getControl("Format").setEnable(FALSE) End If ' Disable dpi if svg image format If sEqFormat = "svg" Then oDlgMain.getControl("GraphicDPI").setEnable(FALSE) Else oDlgMain.getControl("GraphicDPI").setEnable(TRUE) End If ' Set window position and size If oSystemInfo.PositionX <> "" Then oDlgMain.Model.PositionX = oSystemInfo.PositionX If oSystemInfo.PositionY <> "" Then oDlgMain.Model.PositionY = oSystemInfo.PositionY If oSystemInfo.Width <> "" Then ResizeWidth(oSystemInfo.Width) If oSystemInfo.Height <> "" Then ResizeHeight(oSystemInfo.Height) ' Execute dialog oDlgMain.Execute() ' Save window position and size SavePosSize() End Sub ' Set image format and enable or disable dpi according to the image format Sub Format_Mod() If oDlgMain.getControl("Format").getText() = "svg" Then oDlgMain.getControl("GraphicDPI").setEnable(FALSE) Else oDlgMain.getControl("GraphicDPI").setEnable(TRUE) End If End Sub ' Set dpi value Sub DPI_Mod() glb_sGraphicDPI = oDlgMain.getControl("GraphicDPI").getText() End Sub ' Set image transparency Sub Trans_Mod() If oDlgMain.getControl("Transparency").getState() Then If GetDocumentType(ThisComponent) = "swriter" Then ' Writer document glb_sWriterTransparency = "TRUE" End If If GetDocumentType(ThisComponent) = "simpress" Then ' Impress document glb_sImpressTransparency = "TRUE" End If If GetDocumentType(ThisComponent) = "sdraw" Then ' Draw document glb_sDrawTransparency = "TRUE" End If Else If GetDocumentType(ThisComponent) = "swriter" Then ' Writer document glb_sWriterTransparency = "FALSE" End If If GetDocumentType(ThisComponent) = "simpress" Then ' Impress document glb_sImpressTransparency = "FALSE" End If If GetDocumentType(ThisComponent) = "sdraw" Then ' Draw document glb_sDrawTransparency = "FALSE" End If End If End Sub ' Latex button clicked Sub LatexButton_Clicked() Dim sEqCode as String, sEqType as String, iEqSize as Integer Dim sEqFormat as String, sEqDPI as String, sEqTransp as String, sEqName as String ' Get the general information used to compile the equation ' Get the Latex code, the type of equation and the size of font sEqCode = oDlgMain.getControl("LatexCode").getText() sEqFormat = oDlgMain.getControl("Format").getText() sEqDPI = oDlgMain.getControl("GraphicDPI").getText() If oDlgMain.getControl("Transparency").getState() Then sEqTransp = "TRUE" Else sEqTransp = "FALSE" End If iEqSize = oDlgMain.getControl("Size").getText() If oDlgMain.getControl("TypeDisplay").getState() Then sEqType = "display" If oDlgMain.getControl("TypeInline").getState() Then sEqType = "inline" If oDlgMain.getControl("TypeLatex").getState() Then sEqType = "latex" sEqName = oDlgMain.getControl("EquationNameText").getText() ' Create the latex equation and insert it MakeEquation(iEqSize , sEqType , sEqCode, sEqFormat, sEqDPI, sEqTransp, sEqName) End Sub ' Help button clicked Sub HelpButton_Clicked() glb_sStatus = "" oDlgMain.getControl("LogString").setText( glb_sStatus ) HelpDialog() oDlgMain.getControl("LogString").setText( glb_sStatus ) End Sub ' Prefs button clicked Sub PrefsButton_Clicked() glb_sStatus = "" oDlgMain.getControl("LogString").setText( glb_sStatus ) PrefsDialog() oDlgMain.getControl("LogString").setText( glb_sStatus ) End Sub ' Preamble button clicked Sub PreambleButton_Clicked() glb_sStatus = "" oDlgMain.getControl("LogString").setText( glb_sStatus ) PreambleDialog() oDlgMain.getControl("LogString").setText( glb_sStatus ) End Sub ' Resize window width Sub ResizeWidth(Width as Integer) Dim x as Integer, w as Integer Dim w1 as Integer, w2 as Integer, w3 as Integer, w4 as Integer, w5 as Integer Dim w6 as Integer, w7 as Integer, w8 as Integer, w9 as Integer, w10 as Integer Dim w11 as Integer, w12 as Integer, w13 as Integer, w14 as Integer, w15 as Integer Dim w16 as Integer, w17 as Integer w = oDlgMain.Model.Width w1 = w - oDlgMain.GetControl("LatexCode").Model.Width - oDlgMain.GetControl("LatexCode").Model.PositionX w2 = w - oDlgMain.GetControl("ImageformatFrame").Model.PositionX w3 = w - oDlgMain.GetControl("FontsizeFrame").Model.PositionX w4 = w - oDlgMain.GetControl("EquationtypeFrame").Model.PositionX w5 = w - oDlgMain.GetControl("Format").Model.PositionX w6 = w - oDlgMain.GetControl("GraphicDPI").Model.PositionX w7 = w - oDlgMain.GetControl("DpiLabel").Model.PositionX w8 = w - oDlgMain.GetControl("Size").Model.PositionX w9 = w - oDlgMain.GetControl("PtsLabel").Model.PositionX w10 = w - oDlgMain.GetControl("TypeDisplay").Model.PositionX w11 = w - oDlgMain.GetControl("TypeInline").Model.PositionX w12 = w - oDlgMain.GetControl("TypeLatex").Model.PositionX w13 = w - oDlgMain.GetControl("HelpButton").Model.PositionX w14 = w - oDlgMain.GetControl("PreferencesButton").Model.PositionX w15 = w - oDlgMain.GetControl("PreambleButton").Model.PositionX w16 = w - oDlgMain.GetControl("LatexButton").Model.PositionX w17 = w - oDlgMain.GetControl("Transparency").Model.PositionX ' Set window width oDlgMain.Model.Width = Width ' Compute widget margins ' Compute and set new texfield width w = oDlgMain.Model.Width - oDlgMain.GetControl("LatexCode").Model.PositionX - w1 oDlgMain.GetControl("LatexCode").Model.Width = w ' Compute and set other widget positions w = oDlgMain.Model.Width x = w - w2 oDlgMain.GetControl("ImageformatFrame").Model.PositionX = x x = w - w3 oDlgMain.GetControl("FontsizeFrame").Model.PositionX = x x = w - w4 oDlgMain.GetControl("EquationtypeFrame").Model.PositionX = x x = w - w5 oDlgMain.GetControl("Format").Model.PositionX = x x = w - w6 oDlgMain.GetControl("GraphicDPI").Model.PositionX = x x = w - w7 oDlgMain.GetControl("DpiLabel").Model.PositionX = x x = w - w8 oDlgMain.GetControl("Size").Model.PositionX = x x = w - w9 oDlgMain.GetControl("PtsLabel").Model.PositionX = x x = w - w10 oDlgMain.GetControl("TypeDisplay").Model.PositionX = x x = w - w11 oDlgMain.GetControl("TypeInline").Model.PositionX = x x = w - w12 oDlgMain.GetControl("TypeLatex").Model.PositionX = x x = w - w13 oDlgMain.GetControl("HelpButton").Model.PositionX = x x = w - w14 oDlgMain.GetControl("PreferencesButton").Model.PositionX = x x = w - w15 oDlgMain.GetControl("PreambleButton").Model.PositionX = x x = w - w16 oDlgMain.GetControl("LatexButton").Model.PositionX = x x = w - w17 oDlgMain.GetControl("Transparency").Model.PositionX = x End Sub ' Resize window height Sub ResizeHeight(Height as Integer) Dim y as Integer, h as Integer Dim h1 as Integer, h2 as Integer, h3 as Integer, h4 as Integer, h5 as Integer Dim h6 as Integer ' Compute widget margins h = oDlgMain.Model.Height h1 = h - oDlgMain.GetControl("LatexCode").Model.Height - oDlgMain.GetControl("LatexCode").Model.PositionY h2 = h - oDlgMain.GetControl("HelpButton").Model.PositionY h3 = h - oDlgMain.GetControl("PreferencesButton").Model.PositionY h4 = h - oDlgMain.GetControl("PreambleButton").Model.PositionY h5 = h - oDlgMain.GetControl("LatexButton").Model.PositionY h6 = h - oDlgMain.GetControl("LogString").Model.PositionY ' Set window height oDlgMain.Model.Height = Height ' Compute and set new textfield height h = oDlgMain.Model.Height - oDlgMain.GetControl("LatexCode").Model.PositionY - h1 oDlgMain.GetControl("LatexCode").Model.Height = h ' Compute and set other widget positions h = oDlgMain.Model.Height y = h - h2 oDlgMain.GetControl("HelpButton").Model.PositionY = y y = h - h3 oDlgMain.GetControl("PreferencesButton").Model.PositionY = y y = h - h4 oDlgMain.GetControl("PreambleButton").Model.PositionY = y y = h - h5 oDlgMain.GetControl("LatexButton").Model.PositionY = y y = h - h6 oDlgMain.GetControl("LogString").Model.PositionY = y End Sub ' Increase width button clicked Sub IncreaseWidthButton_Clicked() Dim rw as Double Dim NewWidth as Integer ' Compute new width NewWidth = oDlgMain.Model.Width + DLG_STEP_SIZE ' Resize ResizeWidth(NewWidth) ' Save window position and size SavePosSize() End Sub ' Decrease width button clicked Sub DecreaseWidthButton_Clicked() Dim rw as Double Dim NewWidth as Integer ' Compute new width NewWidth = oDlgMain.Model.Width - DLG_STEP_SIZE ' Keep the width above a minimum value If NewWidth < DLG_MIN_WIDTH Then Exit Sub End If ' Resize ResizeWidth(NewWidth) ' Save window position and size SavePosSize() End Sub ' Increase height button clicked Sub IncreaseHeightButton_Clicked() Dim rh as Double Dim NewHeight as Integer ' Compute new width NewHeight = oDlgMain.Model.Height + DLG_STEP_SIZE ' Resize ResizeHeight(NewHeight) ' Save window position and size SavePosSize() End Sub ' Decrease height button clicked Sub DecreaseHeightButton_Clicked() Dim rh as Double Dim NewHeight as Integer ' Compute new width NewHeight = oDlgMain.Model.Height - DLG_STEP_SIZE ' Keep the height above a minimum value If NewHeight < DLG_MIN_HEIGHT Then Exit Sub End If ' Resize ResizeHeight(NewHeight) ' Save window position and size SavePosSize() End Sub ' Save window position and size Sub SavePosSize Dim oSystemInfo as Variant ' Save window position and size oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' Workaround for a bug that sometimes occurs where model positions are not updated ' We use the window positions to update the model positions ' convX and convY are conversion factors between twips and map appfont Dim Pos As New com.sun.star.awt.Rectangle Dim convX as Double, convY as Double Pos = oDlgMain.GetPosSize() If oDlgMain.Model.Width = 0 Then oDlgMain.Model.Width = DLG_MIN_WIDTH End if if oDlgMain.Model.Height = 0 Then oDlgMain.Model.Height = DLG_MIN_HEIGHT End if convX = Pos.Width / oDlgMain.Model.Width convY = Pos.Height / oDlgMain.Model.Height ' Sometimes convX or convY are equal to zero If convX <> 0 and convY <> 0 Then oDlgMain.Model.PositionX = Pos.X / convX oDlgMain.Model.PositionY = Pos.Y / convY End If ' End of workaround oSystemInfo.PositionX = oDlgMain.Model.PositionX oSystemInfo.PositionY = oDlgMain.Model.PositionY oSystemInfo.Width = oDlgMain.Model.Width oSystemInfo.Height = oDlgMain.Model.Height oSystemInfo.commitChanges() End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsPrefs_GUI.xdl000064440400000001632413206777051030264 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsRecompileEquations.xba000064440400000006452113206777051032276 0ustar kkremitzkikkremitzki ' ' TexMathsRecompileEquations ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to recompile TexMaths equations ' Force variable declaration Option Explicit ' Dialog declaration Private oDlgRecompileEquations as Variant Private oDlgWait as Variant Private oL as Variant Private closed as Boolean Sub Main ' The Draw component is required If ComponentInstalled( "Draw" ) = FALSE Then MsgBox( _("Please install the Draw component to run TexMaths!") ) Exit Sub End If ' Initialize object to null to allow testing if it was created oDlgMain = null ' Set TexMaths configuration SetConfig() ' Check program paths CheckProgramPaths() ' Exit if configuration was not saved Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess("/ooo.ext.texmaths.Registry/SystemInfo", TRUE) If oSystemInfo.ConfigSaved = "" Then Exit Sub ' Get Word vertical alignment compatibility option If oSystemInfo.WordVertAlign = "TRUE" Then glb_WordVertAlign = TRUE Else glb_WordVertAlign = FALSE ' Display dialog RecompileEquationsDialog() End Sub ' Create and display dialog Sub RecompileEquationsDialog() ' Load the library TexMaths DialogLibraries.LoadLibrary( "TexMaths" ) ' Create the dialog object oDlgRecompileEquations = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsRecompileEquations_GUI") ) ' Dialog strings for translation oDlgRecompileEquations.setTitle( _("TexMaths Recompile Equations") ) oDlgRecompileEquations.getControl("HelpButton").Model.Label = _("Help...") oDlgRecompileEquations.getControl("HelpButton").Model.HelpText = _("Display help text") oDlgRecompileEquations.getControl("PreambleButton").Model.Label = _("Preamble...") oDlgRecompileEquations.getControl("PreambleButton").Model.HelpText = _("Set LaTeX preamble") oDlgRecompileEquations.getControl("RunButton").Model.Label = _("Run") oDlgRecompileEquations.getControl("RunButton").Model.HelpText = _("Recompile TexMaths equations") oDlgRecompileEquations.getControl("FontFrame").Model.Label = _("Font size") oDlgRecompileEquations.getControl("ImageFrame").Model.Label = _("Image parameters") oDlgRecompileEquations.getControl("CompatFrame").Model.Label = _("Compatibility") oDlgRecompileEquations.getControl("SelectionFrame").Model.Label = _("Selection") oDlgRecompileEquations.getControl("PointLabel").Model.Label = _("points") oDlgRecompileEquations.getControl("FormatLabel").Model.Label = _("Format") oDlgRecompileEquations.getControl("Transparency").Model.Label = _("Transparency") oDlgRecompileEquations.getControl("Transparency").Model.HelpText = _("Image transparency") oDlgRecompileEquations.getControl("VertAlign").Model.Label = _("Vertical alignment for Word export") oDlgRecompileEquations.getControl("VertAlign").Model.HelpText = _("Improve vertical alignment of Writer equations for Word export") oDlgRecompileEquations.getControl("FontSize").Model.HelpText = _("Text font size") oDlgRecompileEquations.getControl("Format").Model.HelpText = _("Image format") oDlgRecompileEquations.getControl("GraphicDPI").Model.HelpText = _("Image resolution (only for PNG images)") ' Set the combo box values oDlgRecompileEquations.getControl("Format").addItems(Array("---","png","svg"),0) oDlgRecompileEquations.getControl("GraphicDPI").addItems(Array("---","72","96","120","150","200","300","600","1200"),0) oDlgRecompileEquations.getControl("FontSize").addItems(Array("---","6","7","8","9","10","10.5","11","12","13","14","15","16","18","20","22","24","26","28","32","36","40","44","48","54","60","66","72","80","88","96"),0) ' Set the radio button labels oDlgRecompileEquations.getControl("RecompAllRadio").Model.Label = _("Recompile all equations") oDlgRecompileEquations.getControl("RecompAllRadio").Model.HelpText = _("Recompile all equations from the document") If GetDocumentType(ThisComponent) = "swriter" Then oDlgRecompileEquations.getControl("RecompSelRadio").Model.Label = _("Recompile selected equations") oDlgRecompileEquations.getControl("RecompSelRadio").Model.HelpText = _("Recompile equations from the selected text area (does not process equations in tables, text frames, header and footer. Recompile those one by one if necessary)") Else oDlgRecompileEquations.getControl("RecompSelRadio").Model.Label = _("Recompile equations from slide") oDlgRecompileEquations.getControl("RecompSelRadio").Model.HelpText = _("Recompile equations from the current slide") End If ' Set dialog values SetRecompileEquationsDialogValues(FALSE) ' Show the dialog window oDlgRecompileEquations.Execute() End Sub ' Set dialog values Sub SetRecompileEquationsDialogValues(ForceDefault as Boolean) ' Read saved or default prefs If FileExists(glb_sUserPath & "TexMaths.cfg" ) Then If ForceDefault = FALSE Then ReadPrefsFile() Else DefaultPrefs() Else DefaultPrefs() End If ' Image parameters oDlgRecompileEquations.getControl("Format").setText(glb_sFormat) oDlgRecompileEquations.getControl("GraphicDPI").setText(glb_sGraphicDPI) ' Font size depends on the document type ' Get the current document and controller Dim oDoc as Variant, oDocCtrl as Variant oDoc = ThisComponent oDocCtrl = oDoc.getCurrentController() ' Test if we are in Writer, Impress or Draw and set the default user preferences If GetDocumentType(oDoc) = "swriter" Then If glb_sWriterTransparency = "TRUE" Then oDlgRecompileEquations.getControl("Transparency").setState(1) Else oDlgRecompileEquations.getControl("Transparency").setState(0) End If oDlgRecompileEquations.getControl("FontSize").setText(glb_sWriterSize) If glb_WordVertAlign = TRUE Then oDlgRecompileEquations.getControl("VertAlign").setState(1) Else oDlgRecompileEquations.getControl("VertAlign").setState(0) End If ElseIf GetDocumentType(oDoc) = "simpress" Then If glb_sImpressTransparency = "TRUE" Then oDlgRecompileEquations.getControl("Transparency").setState(1) Else oDlgRecompileEquations.getControl("Transparency").setState(0) End If oDlgRecompileEquations.getControl("FontSize").setText(glb_sImpressSize) oDlgRecompileEquations.getControl("VertAlign").setEnable(FALSE) ElseIf GetDocumentType(oDoc) = "sdraw" Then If glb_sDrawTransparency = "TRUE" Then oDlgRecompileEquations.getControl("Transparency").setState(1) Else oDlgRecompileEquations.getControl("Transparency").setState(0) End If oDlgRecompileEquations.getControl("FontSize").setText(glb_sDrawSize) oDlgRecompileEquations.getControl("VertAlign").setEnable(FALSE) Else MsgBox GetDocumentType(oDoc) & _(": document type not supported by TexMaths") Exit Sub End If ' Get the dvipng and dvisvgm paths saved in the registry Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' Disable svg and force png if dvisvgm path is empty If oSystemInfo.DvipngPath = "" Then glb_sFormat = "svg" oDlgRecompileEquations.getControl("Format").setText("svg") oDlgRecompileEquations.getControl("Format").setEnable(FALSE) End If ' Disable svg and force png if dvisvgm path is empty If oSystemInfo.DvisvgmPath = "" Then glb_sFormat = "png" oDlgRecompileEquations.getControl("Format").setText("png") oDlgRecompileEquations.getControl("Format").setEnable(FALSE) End If ' Disable dpi if svg file format If glb_sFormat = "svg" Then oDlgRecompileEquations.getControl("GraphicDPI").setEnable(FALSE) Else oDlgRecompileEquations.getControl("GraphicDPI").setEnable(TRUE) End If ' Selection buttons oDlgRecompileEquations.getControl("RecompSelRadio").setState(1) oDlgRecompileEquations.getControl("RecompAllRadio").setState(0) End Sub ' Display Wait dialog Sub WaitDialog() ' Load the library TexMaths DialogLibraries.LoadLibrary("TexMaths") ' Create the dialog object oDlgWait = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsWait_GUI") ) ' Window listener oL = createUnoListener("WaitWindow_","com.sun.star.awt.XTopWindowListener") oDlgWait.addTopWindowListener(oL) ' Dialog strings for translation oDlgWait.setTitle( _("TexMaths Recompile Equations") ) oDlgWait.getControl("Label1").Model.Label = _("Please wait during task execution...") oDlgWait.getControl("CancelButton").Model.Label = _("Cancel") oDlgWait.getControl("CancelButton").Model.HelpText = _("Cancel operation") ' Center dialog on window Dim ParentSize as Variant Dim Xpos as Integer, YPos as integer ParentSize = StarDesktop.CurrentFrame.ComponentWindow.Size XPos = (ParentSize.Width/2) - (oDlgWait.Size.Width/2) YPos = (ParentSize.Height/2) - (oDlgWait.Size.Width/2) oDlgWait.setPosSize(XPos, YPos, 0, 0, com.sun.star.awt.PosSize.POS) ' Show the dialog window oDlgWait.setvisible(true) ' Loop for non modal dialog closed = FALSE ' Allows seeing the message Wait 500 End Sub ' Close non modal dialog and cancel operation Sub CloseWait() oDlgWait.setVisible(false) closed = TRUE End Sub ' It's recommended to implement all unneeded methods, called by a listener, as empty routines ' including "disposing" from parent-interface com.sun.star.lang.XEventListener 'Is invoked when a window is activated Sub WaitWindow_windowActivated(oEv as Variant) End Sub 'Is invoked when a window is de-activated Sub WaitWindow_windowDeactivated(oEv) End Sub 'Invoked when a window has been opened Sub WaitWindow_windowOpened(oEv as Variant) End Sub 'Close window using the menu bar close button 'Invoked when a window is in the process of being closed Sub WaitWindow_windowClosing(oEv as Variant) oDlgWait.setVisible(false) closed = TRUE End Sub ' Is invoked when a window has been closed Sub WaitWindow_windowClosed(oEv as Variant) End Sub ' Is invoked when a window is iconified Sub WaitWindow_windowMinimized(oEv as Variant) End Sub ' Is invoked when a window is de-iconified Sub WaitWindow_windowNormalized(oEv as Variant) End Sub Sub WaitWindow_disposing(oEv as Variant) End Sub ' Set image format and enable or disable dpi according to the image format Sub Format_Mod() glb_sFormat = oDlgRecompileEquations.getControl("Format").getText() If glb_sFormat = "svg" Then oDlgRecompileEquations.getControl("GraphicDPI").setEnable(FALSE) Else oDlgRecompileEquations.getControl("GraphicDPI").setEnable(TRUE) End If End Sub ' Preamble button clicked Sub PreambleButton_Clicked() PreambleDialog() End Sub ' This macro recompiles every TexMath equation a Writer, Impress or Draw document Sub RecompileEquations ' Get the current document, controller and dispatcher Dim oDoc as Variant, oDocCtrl as Variant, oDispatcher as Variant oDoc = ThisComponent oDocCtrl = oDoc.getCurrentController() oDispatcher = createUnoService( "com.sun.star.frame.DispatchHelper" ) ' Get image format, graphic DPI and transparency Dim sEqFormat as String, sEqDPI as String, sEqTransp as String glb_sFormat = oDlgRecompileEquations.getControl("Format").getText() sEqFormat = glb_sFormat glb_sGraphicDPI = oDlgRecompileEquations.getControl("GraphicDPI").getText() sEqDPI = glb_sGraphicDPI ' Get font size, depending on the document type Dim sFontSize as String, sEqSize as String If GetDocumentType(oDoc) = "swriter" Then If oDlgRecompileEquations.getControl("Transparency").getState() = 1 Then glb_sWriterTransparency = "TRUE" ElseIf oDlgRecompileEquations.getControl("Transparency").getState() = 0 Then glb_sWriterTransparency = "FALSE" Else glb_sWriterTransparency = "" End If sEqTransp = glb_sWriterTransparency glb_sWriterSize = oDlgRecompileEquations.getControl("FontSize").getText() ' We are in a Writer doc, set default preferences sFontSize = glb_sWriterSize ElseIf GetDocumentType(oDoc) = "simpress" Then If oDlgRecompileEquations.getControl("Transparency").getState() = 1 Then glb_sImpressTransparency = "TRUE" ElseIf oDlgRecompileEquations.getControl("Transparency").getState() = 0 Then glb_sImpressTransparency = "FALSE" Else glb_sImpressTransparency = "" End If sEqTransp = glb_sImpressTransparency glb_sImpressSize = oDlgRecompileEquations.getControl("FontSize").getText() ' We are in an Impress doc, set default preferences sFontSize = glb_sImpressSize ' Trick to focus on the slides oDispatcher.executeDispatch(oDocCtrl.getFrame(), ".uno:SlideSorterMultiPaneGUI", "", 0, Array()) wait 10 ' Doesn't work without this oDispatcher.executeDispatch(oDocCtrl.getFrame(), ".uno:NormalMultiPaneGUI", "", 0, Array()) wait 10 ' Doesn't work without this ElseIf GetDocumentType(oDoc) = "sdraw" Then If oDlgRecompileEquations.getControl("Transparency").getState() = 1 Then glb_sDrawTransparency = "TRUE" ElseIf oDlgRecompileEquations.getControl("Transparency").getState() = 0 Then glb_sDrawTransparency = "FALSE" Else glb_sDrawTransparency = "" End If sEqTransp = glb_sDrawTransparency glb_sDrawSize = oDlgRecompileEquations.getControl("FontSize").getText() ' We are in a Drawr doc, set default preferences sFontSize = glb_sDrawSize ' Trick to focus on the draw pages oDispatcher.executeDispatch(oDocCtrl.getFrame(), ".uno:LeftPaneDraw", "", 0, Array()) wait 10 oDispatcher.executeDispatch(oDocCtrl.getFrame(), ".uno:LeftPaneDraw", "", 0, Array()) wait 10 Else MsgBox GetDocumentType(oDoc) & _(": document type not supported by TexMaths") Exit Sub End If ' Close the dialog oDlgRecompileEquations.endExecute() ' Display wait dialog WaitDialog() ' Convert equations Dim oSlide as Variant Dim oShape as Variant Dim numSlides as Integer, numForms as Integer, i as Integer, j as Integer, k as Integer Dim sDlgArg as String Dim sArray() as String Dim docType as Integer Dim sEqType as String, sEqLatexCode as String, sEqName as String ' No TexMaths dialog here Dialog = FALSE Dim count as Long count = 0 ' We are in a Writer document If GetDocumentType(oDoc) = "swriter" Then Dim oText as Variant, oSels as Variant, oSelection as Variant Dim sel as Boolean, skip as Boolean ' Get main text oText = oDoc.getText() ' Get selections oSels = oDoc.CurrentSelection() ' Is there any selected in the document ? ' If not, then we will recompile all equations sel = IsAnythingSelected(oDoc) ' Only proceed if something selected or recompile all requested If oDlgRecompileEquations.getControl("RecompAllRadio").getState() Or sel = TRUE Then ' Selections are text ranges If oSels.getImplementationName() = "SwXTextRanges" Then ' Get draw page oSlide = oDoc.getDrawPage() If oSlide.hasElements() Then ' Loop through graphic elements For j = (oSlide.getCount() - 1) To 0 Step -1 If closed = TRUE Then MsgBox ( _("Operation canceled!") , 0, _("TexMaths Recompile Equations") ) Exit Sub End If oShape = oSlide.getByIndex(j) sDlgArg = ReadAttributes(oShape) If sDlgArg = "" Then GoTo NextWriterShape End If ' By default, skip all graphics skip = TRUE ' Get graphic object text anchor Dim oAnchor as Variant oAnchor = oShape.anchor ' Anchor exists If Not isNull(oAnchor) Then ' Graphic object is anchored to the main text If EqualUnoObjects(oText, oAnchor.Text) = TRUE Then ' Loop over the selections For k = 0 to oSels.getCount()-1 ' Get selection oSelection = oSels.getByIndex(k) ' Selection is a text range If oSelection.getImplementationName() = "SwXTextRange" Then ' Some text is selected If len(oSelection.getString()) > 0 Then ' Selection is not in a header, a footer, a table nor in a text frame, ' => we can't test if anchor text is out of selection (this is a LibreOffice bug) If Not ( oSelection.ParaStyleName = "Header" Or oSelection.ParaStyleName = "Footer" ) _ And isEmpty(oSelection.TextTable) And isEmpty(oSelection.TextFrame) Then ' Anchor text is within the selection If oText.compareRegionStarts(oAnchor, oSelection) <= -1 And oText.compareRegionEnds(oAnchor, oSelection) <> -1 Then ' Don't skip this one ! skip = FALSE End If End If End If End If Next ' Loop over the selections End If End If ' Skip this graphic object (only if recompile selection) If oDlgRecompileEquations.getControl("RecompSelRadio").getState() And sel = TRUE And skip = TRUE Then GoTo NextWriterShape End If sArray()=Split(sDlgArg,"§") ' Pre v0.39 equation If Ubound(sArray) = 2 Then If sFontSize = "---" Then sEqSize=sArray(0) Else sEqSize=sFontSize End If sEqType=sArray(1) sEqLatexCode=sArray(2) ElseIf Ubound(sArray) = 5 Then If sFontSize = "---" Then sEqSize=sArray(0) Else sEqSize=sFontSize End If sEqType=sArray(1) sEqLatexCode=sArray(2) If glb_sFormat = "---" Then sEqFormat=sArray(3) End If If glb_sGraphicDPI = "---" Then sEqDPI=sArray(4) End If If glb_sWriterTransparency = "" Then sEqTransp=sArray(5) End If sEqName="" ElseIf Ubound(sArray) = 6 Then If sFontSize = "---" Then sEqSize=sArray(0) Else sEqSize=sFontSize End If sEqType=sArray(1) sEqLatexCode=sArray(2) If glb_sFormat = "---" Then sEqFormat=sArray(3) End If If glb_sGraphicDPI = "---" Then sEqDPI=sArray(4) End If If glb_sWriterTransparency = "" Then sEqTransp=sArray(5) End If sEqName=sArray(6) Else GoTo NextWriterShape End If ' Select image oDocCtrl.select(oShape) ' We are in edit equation mode EditEquation = TRUE ' Get image position oShapePosition = oShape.position() ' Call the core macro MakeEquation(sEqSize, sEqType, sEqLatexCode, sEqFormat, sEqDPI, sEqTransp, sEqName) count = count +1 NextWriterShape: Next ' Loop over the graphic elements End If End If End If ' We are in an Impress or Draw document ElseIf GetDocumentType(oDoc) = "simpress" Or GetDocumentType(oDoc) = "sdraw" Then ' Current slide number Dim numCurrentSlide as Integer numCurrentSlide = oDoc.CurrentController.CurrentPage.number -1 ' Number of draw pages of the document numSlides = oDoc.getDrawPages().getCount() ' Go through draw pages For i = 0 to numSlides - 1 ' Process only the current page if requested If ( oDlgRecompileEquations.getControl("RecompSelRadio").getState() And i = numCurrentSlide ) _ Or ( oDlgRecompileEquations.getControl("RecompAllRadio").getState() ) Then ' Get draw page oSlide = oDoc.drawPages(i) If oSlide.hasElements() Then ' Go through graphic elements For j = (oSlide.getCount() - 1) To 0 Step -1 If closed = TRUE Then MsgBox ( _("Operation canceled!") , 0, _("TexMaths Recompile Equations") ) Exit Sub End If oShape = oSlide.getByIndex(j) sDlgArg = ReadAttributes(oShape) If sDlgArg = "" Then GoTo NextImpressShape End If sArray()=Split(sDlgArg,"§") ' Pre v0.39 equation If Ubound(sArray) = 2 Then If sFontSize = "---" Then sEqSize=sArray(0) Else sEqSize=sFontSize End If sEqType=sArray(1) sEqLatexCode=sArray(2) ElseIf Ubound(sArray) = 5 Then If sFontSize = "---" Then sEqSize=sArray(0) Else sEqSize=sFontSize End If sEqType=sArray(1) sEqLatexCode=sArray(2) If glb_sFormat = "---" Then sEqFormat=sArray(3) End If If glb_sGraphicDPI = "---" Then sEqDPI=sArray(4) End If If glb_sImpressTransparency = "" Then sEqTransp=sArray(5) End If sEqName="" ElseIf Ubound(sArray) = 6 Then If sFontSize = "---" Then sEqSize=sArray(0) Else sEqSize=sFontSize End If sEqType=sArray(1) sEqLatexCode=sArray(2) If glb_sFormat = "---" Then sEqFormat=sArray(3) End If If glb_sGraphicDPI = "---" Then sEqDPI=sArray(4) End If If glb_sImpressTransparency = "" Then sEqTransp=sArray(5) End If sEqName=sArray(6) Else GoTo NextImpressShape End If ' Select image oDocCtrl.select(oShape) ' We are in edit equation mode EditEquation = TRUE ' Get image position oShapePosition = oShape.position() ' Call the core macro MakeEquation(sEqSize, sEqType, sEqLatexCode, sEqFormat, sEqDPI, sEqTransp, sEqName) ' Increment counter count = count +1 NextImpressShape: Next End If End If Next Else MsgBox GetDocumentType(oDoc) & _(": document type not supported by TexMaths") Exit Sub End If ' Close wait dialog and display a done message oDlgWait.setvisible(FALSE) If count = 0 Then MsgBox (_("Done!") & chr(10) & _("No equation was recompiled.") & chr(10) & chr(10), 0, _("TexMaths Recompile Equations") ) ElseIf count = 1 Then MsgBox (_("Done!") & chr(10) & _("1 equation recompiled.") & chr(10) & chr(10), 0, _("TexMaths Recompile Equations") ) ElseIf count > 1 Then MsgBox (_("Done!") & chr(10) & CStr(count) & _(" equations recompiled.") & chr(10) & chr(10), 0, _("TexMaths Recompile Equations") ) End If End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsPrefs.xba000064440400000002101313206777051027532 0ustar kkremitzkikkremitzki ' ' TexMathsPrefs ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros related to main preferences ' Force variable declaration Option Explicit ' Set user, temp and package paths Sub DefaultSysConfig() ' Service to access the user's paths information Dim aService as Variant, oFileAccess as Variant aService = CreateUnoService("com.sun.star.util.PathSubstitution") oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") ' User path and temp path glb_sUserPath = aService.substituteVariables("$(user)", TRUE) & "/TexMaths/" glb_sTmpPath = aService.substituteVariables("$(user)", TRUE) & "/TexMaths/tmp/" ' Create the user directory if it doesn't exist If Not oFileAccess.exists(glb_sUserPath) Then MkDir(glb_sUserPath) If Not oFileAccess.exists(glb_sTmpPath) Then MkDir(glb_sTmpPath) ' Get the package path Const sPrefix = "vnd.sun.star.expand:" Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) glb_sPkgPath = Mid( oSystemInfo.PackageDir , len(sPrefix)+1) ' Get the default context Dim oContext as Variant, oMacroExpander as Variant oContext = getProcessServiceManager().DefaultContext oMacroExpander = oContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander") glb_sPkgPath = oMacroExpander.ExpandMacros(glb_sPkgPath) End Sub ' Set default preferences Sub DefaultPrefs() ' Latex preferences glb_sWriterSize = "12" glb_sImpressSize = "28" glb_sDrawSize = "14" glb_sWriterEqType = "display" glb_sImpressEqType = "display" glb_sDrawEqType = "display" ' Image preferences glb_sFormat = "svg" ' Force default to png if the dvisvgm path is empty Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) If oSystemInfo.DvisvgmPath = "" Then glb_sFormat = "png" End If glb_sGraphicDPI = "600" glb_sWriterTransparency = "FALSE" glb_sImpressTransparency = "FALSE" glb_sDrawTransparency = "FALSE" glb_sStatus = _("Default preferences loaded...") End Sub ' Return a string with the current preferences ' to be written to the preferences file Function Preferences() as String Preferences() = _ "GraphicDPI=" & glb_sGraphicDPI & chr(10) &_ "FileFormat=" & glb_sFormat & chr(10) &_ "WriterTransparency=" & glb_sWriterTransparency & chr(10) &_ "ImpressTransparency=" & glb_sImpressTransparency & chr(10) &_ "DrawTransparency=" & glb_sDrawTransparency & chr(10) &_ "WriterCharSize=" & glb_sWriterSize & chr(10) &_ "WriterEquationType=" & glb_sWriterEqType & chr(10) &_ "ImpressCharSize=" & glb_sImpressSize & chr(10) &_ "ImpressEquationType=" & glb_sImpressEqType & chr(10) &_ "DrawCharSize=" & glb_sDrawSize & chr(10) &_ "DrawEquationType=" & glb_sDrawEqType & chr(10) End Function ' Read the user's preferences file ' Call the routine for data parsing Sub ReadPrefsFile() Dim iNumber as Integer Dim sLine,sPrefs as String sPrefs = "" iNumber = Freefile Open glb_sUserPath & "TexMaths.cfg" For Input As iNumber While Not EOF(iNumber) Line Input #iNumber, sLine If sLine <> "" Then sPrefs = sPrefs & chr(10) & sLine Wend Close #iNumber ReadPreferencesFrom( sPrefs ) glb_sStatus = _("User's preferences loaded...") End Sub ' This fonction parses the preferences from string sPrefs Sub ReadPreferencesFrom( sPrefs as String ) Dim i as Integer, ii as Integer Dim sLine() as String, sArguments() as String If StringNotContains( sPrefs , chr(10)) Then Exit Sub sLine() = Split( sPrefs , chr(10)) ii = 0 For i = 0 to UBound(sLine) If Not StringNotContains(sLine(i),"=") Then sArguments() = Split(sLine(i),"=") Select Case sArguments(0) Case "ScriptPath" Dim sScriptPath as String sScriptPath = CheckPath(ConvertToURL(sArguments(1))) Case "GraphicDPI" glb_sGraphicDPI = sArguments(1) Case "FileFormat" glb_sFormat = sArguments(1) Case "WriterTransparency" glb_sWriterTransparency = sArguments(1) Case "ImpressTransparency" glb_sImpressTransparency = sArguments(1) Case "DrawTransparency" glb_sDrawTransparency = sArguments(1) Case "WriterCharSize" glb_sWriterSize = sArguments(1) Case "WriterEquationType" glb_sWriterEqType = sArguments(1) Case "ImpressCharSize" glb_sImpressSize = sArguments(1) Case "ImpressEquationType" glb_sImpressEqType = sArguments(1) Case "DrawCharSize" glb_sDrawSize = sArguments(1) Case "DrawEquationType" glb_sDrawEqType = sArguments(1) End Select End If ii = ii + 1 + Len(sLine(i)) If Len(sPrefs) < ii Then Exit For Next End Sub ' Set default preamble Sub DefaultPreamble() ' Set the preamble to default value glb_sPreamble = "\usepackage{amsmath}" & chr(10) &_ "\usepackage{amssymb}" & chr(10) &_ "\usepackage[usenames]{color}" & chr(10) &_ chr(10) &_ "% Uncomment this line for sans-serif font" & chr(10) &_ "%\everymath{\mathsf{\xdef\mysf{\mathgroup\the\mathgroup\relax}}\mysf}" & chr(10) &_ chr(10) &_ "% Uncomment these lines for colored equations" & chr(10) &_ "% Caution! Background color breaks transparency!" & chr(10) &_ "%\definecolor{fgcolor}{RGB}{0,0,255}" & chr(10) &_ "%\definecolor{bgcolor}{RGB}{255,0,0}" & chr(10) &_ "%\pagecolor{bgcolor}\color{fgcolor}" &_ chr(10) ' Default ignore preamble state glb_bIgnorePreamble = FALSE End Sub ' Read preamble - Return 1 if a preamble was found, else return 0 Function ReadPreamble() as Integer ' Read the preamble from a UserDefinedProperties property Dim oDoc as Variant, oProperties as Variant oDoc = ThisComponent oProperties = oDoc.DocumentProperties.UserDefinedProperties ' No stored LaTeX preamble If Not oProperties.PropertySetInfo.hasPropertyByName("TexMathsPreamble") Then ReadPreamble() = 0 Exit Function ' Read stored LaTeX preamble Else ' Decode the stored preamble string to restore the newline characters (workaround for an LO bug) glb_sPreamble = DecodeNewline( oProperties.getPropertyValue("TexMathsPreamble") ) ' Set the ignore preamble state If oProperties.PropertySetInfo.hasPropertyByName("TexMathsIgnorePreamble") Then If oProperties.getPropertyValue("TexMathsIgnorePreamble") = "TRUE" Then glb_bIgnorePreamble = TRUE Else glb_bIgnorePreamble = FALSE End If End If ReadPreamble() = 1 End If End Function libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsEquations.xba000064440400000007642613206777051030445 0ustar kkremitzkikkremitzki ' ' TexMathsEquations ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to create the LaTeX equation ' Force variable declaration Option Explicit ' Global constants Global Const DLG_MIN_HEIGHT = 250 Global Const DLG_MIN_WIDTH = 200 Global Const DLG_STEP_SIZE = 5 Global Const ANCHOR_TO_PARA = 0 Global Const ANCHOR_TO_CHAR = 1 Global Const ANCHOR_TO_PAGE = 2 Global Const ANCHOR_AT_CHAR = 4 ' Global preferences variables Global glb_sUserPath as String, glb_sTmpPath as String, glb_sPkgPath as String Global glb_sPreamble as String, glb_sFormat as String Global glb_bIgnorePreamble as Boolean Global glb_sWriterSize as String, glb_sWriterEqType as String Global glb_sImpressSize as String, glb_sImpressEqType as String Global glb_sDrawSize as String, glb_sDrawEqType as String Global glb_sGraphicDPI as String Global glb_sWriterTransparency as String Global glb_sImpressTransparency as String Global glb_sDrawTransparency as String Global glb_sStatus as String Global glb_WordVertAlign as Boolean ' Global translation variables Global glb_PoFileRead as Integer Global glb_MsgId(0) as String Global glb_MsgStr(0) as String ' Variables related to the edit equation mode Public oShapePosition as Variant Public EditEquation as Boolean, Dialog as Boolean ' Main subroutine Sub Main ' The Draw component is required If ComponentInstalled( "Draw" ) = FALSE Then MsgBox( _("Please install the Draw component to run TexMaths!") ) Exit Sub End If ' Initialize object to null to allow testing if it was created oDlgMain = null ' Set TexMaths configuration SetConfig() ' Check program paths CheckProgramPaths() ' Exit if configuration was not saved Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess("/ooo.ext.texmaths.Registry/SystemInfo", TRUE) If oSystemInfo.ConfigSaved = "" Then Exit Sub ' Get Word vertical alignment compatibility option If oSystemInfo.WordVertAlign = "TRUE" Then glb_WordVertAlign = TRUE Else glb_WordVertAlign = FALSE ' Get the current document and controller Dim oDoc as Variant, oDocCtrl as Variant oDoc = ThisComponent oDocCtrl = oDoc.getCurrentController() ' Test if we are in Writer, Impress or Draw and set the default user preferences Dim sEqSize as String, sEqType as String, sEqLatexCode as String, sEqFormat as String, sEqDPI as String, sEqTransp as String, sEqName as String ' Default image format, graphic DPI and transparency sEqFormat = glb_sFormat sEqDPI = glb_sGraphicDPI If GetDocumentType(oDoc) = "swriter" Then ' Get equation transparency sEqTransp = glb_sWriterTransparency ' If we are in Writer preview mode, just silently exit If oDoc.getCurrentController.getFrame.LayoutManager.isElementVisible ( "private:resource/toolbar/previewobjectbar" ) Then Exit Sub ' We are in a Writer doc, set default preferences sEqSize = glb_sWriterSize sEqType = glb_sWriterEqType sEqLatexCode = "" ElseIf GetDocumentType(oDoc) = "simpress" Then ' Get equation transparency sEqTransp = glb_sImpressTransparency ' We are in an Impress doc, set default preferences sEqSize = glb_sImpressSize sEqType = glb_sImpressEqType sEqLatexCode = "" ElseIf GetDocumentType(oDoc) = "sdraw" Then ' Get equation transparency sEqTransp = glb_sDrawTransparency ' We are in an Draw doc, set default preferences sEqSize = glb_sDrawSize sEqType = glb_sDrawEqType sEqLatexCode = "" Else MsgBox GetDocumentType(oDoc) & _(": document type not supported by TexMaths") Exit Sub End If ' If there is something selected, then we are in the edit equation mode ' and we have to get the equation attributes (font size, equation type, LaTeX code) EditEquation = FALSE Dialog = TRUE If Not isEmpty(oDocCtrl.selection()) Then Dim sDlgArg as String Dim sArray() as String Dim oSelection as Variant, oShape as Variant oSelection = oDocCtrl.getSelection() ' We are in a Writer document If GetDocumentType(oDoc) = "swriter" Then ' For Writer, check if the selected objet is a SwXTextGraphicObject If oSelection.getImplementationName() = "SwXTextGraphicObject" Then oShape = oSelection sDlgArg = ReadAttributes(oShape) If sDlgArg = "" Then MsgBox _("The selected object is not a TexMaths equation...") & chr(10) &_ _("Please unselect it and call the macro again...") Exit Sub End If EditEquation = TRUE sArray()=Split(sDlgArg,"§") ' Pre v0.39 equation If Ubound(sArray) = 2 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) ElseIf Ubound(sArray) = 5 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) sEqFormat=sArray(3) sEqDPI=sArray(4) sEqTransp=sArray(5) sEqName="" ElseIf Ubound(sArray) = 6 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) sEqFormat=sArray(3) sEqDPI=sArray(4) sEqTransp=sArray(5) sEqName=sArray(6) Else MsgBox _("The selected object is not a TexMaths equation...") & chr(10) &_ _("Please unselect it and call the macro again...") Exit Sub End If glb_sStatus = _("Edit equation...") TexMathsDialog(sEqSize, sEqType, sEqLatexCode, sEqFormat, sEqDPI, sEqTransp, sEqName) Exit Sub ' Selected objet is a SvxShapeCollection ElseIf oSelection.getImplementationName() = "com.sun.star.drawing.SvxShapeCollection" Then oShape = oSelection.getByIndex(0) sDlgArg = ReadAttributes(oShape) If sDlgArg = "" Then MsgBox _("The selected object is not a TexMaths equation...") & chr(10) &_ _("Please unselect it and call the macro again...") Exit Sub End If EditEquation = TRUE sArray()=Split(sDlgArg,"§") ' Pre v0.39 equation If Ubound(sArray) = 2 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) ElseIf Ubound(sArray) = 5 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) sEqFormat=sArray(3) sEqDPI=sArray(4) sEqTransp=sArray(5) sEqName="" ElseIf Ubound(sArray) = 6 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) sEqFormat=sArray(3) sEqDPI=sArray(4) sEqTransp=sArray(5) sEqName=sArray(6) Else MsgBox _("The selected object is not a TexMaths equation...") & chr(10) &_ _("Please unselect it and call the macro again...") Exit Sub End If glb_sStatus = _("Edit equation...") TexMathsDialog(sEqSize, sEqType, sEqLatexCode, sEqFormat, sEqDPI, sEqTransp, sEqName) Exit Sub ' Selected object is Text ElseIf oSelection.supportsService("com.sun.star.text.TextRanges") Then ' Call MakeEquation without dialog box Dim oSel as Variant oSel = oSelection.getByIndex(0) If oSel.supportsService("com.sun.star.text.TextRange") And oSel.String <> "" Then Dialog = FALSE ' Find if we allow an extra CR in MakeEquation Dim oViewCursor as Variant Dim oCursor as Variant oViewCursor = oDocCtrl.ViewCursor oCursor = GetLeftMostCursor(oSel) oViewCursor.gotoRange(oCursor, FALSE) oCursor = GetRightMostCursor(oSel) oViewCursor.gotoRange(oCursor, TRUE) ' Generate LaTeX equation MakeEquation(CInt(sEqSize), sEqType, oSel.String, sEqFormat, sEqDPI, sEqTransp, "") Exit Sub End If End If ' We are in an Impress or Draw document ElseIf GetDocumentType(oDoc) = "simpress" Or GetDocumentType(oDoc) = "sdraw" Then ' For Impress or Draw, check if the selected object is in a SvxShapeCollection If oSelection.getImplementationName() = "com.sun.star.drawing.SvxShapeCollection" Then oShape = oSelection.getByIndex(0) sDlgArg = ReadAttributes(oShape) If sDlgArg = "" Then MsgBox _("The selected object is not a TexMaths equation...") & chr(10) &_ _("Please unselect it and call the macro again...") Exit Sub End If oShapePosition = oShape.position() EditEquation = TRUE sArray()=Split(sDlgArg,"§") ' Pre v0.39 equation If Ubound(sArray) = 2 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) ElseIf Ubound(sArray) = 5 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) sEqFormat=sArray(3) sEqDPI=sArray(4) sEqTransp=sArray(5) sEqName="" ElseIf Ubound(sArray) = 6 Then sEqSize=sArray(0) sEqType=sArray(1) sEqLatexCode=sArray(2) sEqFormat=sArray(3) sEqDPI=sArray(4) sEqTransp=sArray(5) sEqName=sArray(6) Else MsgBox _("The selected object is not a TexMaths equation...") & chr(10) &_ _("Please unselect it and call the macro again...") Exit Sub End If glb_sStatus = _("Edit equation...") TexMathsDialog(sEqSize, sEqType, sEqLatexCode, sEqFormat, sEqDPI, sEqTransp, sEqName) Exit Sub ' Selected object is text within a frame ElseIf oSelection.getImplementationName() = "SvxUnoTextCursor" Then MsgBox _("The selected object is not a TexMaths equation...") & chr(10) &_ _("Please unselect it and call the macro again...") Exit Sub End If End If End If ' Open the dialog box with the default options TexMathsDialog(sEqSize, sEqType, sEqLatexCode, sEqFormat, sEqDPI, sEqTransp, sEqName) End Sub ' Set configuration Sub SetConfig ' Initialise state string glb_sStatus = "" ' Set default system configuration (pkg, user and tmp paths) DefaultSysConfig() ' Set default equation preferences (image format, equation type, font size) DefaultPrefs() ' Apply saved config if it exists If FileExists(glb_sUserPath & "TexMaths.cfg" ) Then ReadPrefsFile() ' Set default preamble DefaultPreamble() ' Try to read a stored LaTeX preamble ReadPreamble() End Sub ' This is the core macro! It is called by the dialog box ' with the sEqCode, sEqType, iEqSize, sEqFormat, sEqDPI and sEqTransp variables ' It makes the image and inserts it in the document Sub MakeEquation(iEqSize as Integer, sEqType as String, sEqCode as String, sEqFormat as String, sEqDPI as String, sEqTransp as String, sEqName as String) Dim iNumber as Integer Dim cURL as String, sShellArg as String, sMsg as String, sLatexCode as String, sShellCommand as String Dim sVersion as String ' LibreOffice (or OpenOffice) major version sVersion = Left(GetLOVersion(),1) ' Save initial clipboard content because it will be lost when pasting the image If Not (getGUIType() = 1 And sVersion = "5") Then ' Doesn't work on Windows with Libreoffice 5.x Dim sClipContent as String sClipContent = ClipboardToText() End If ' We first test if there is LateX code If sEqCode = "" Then MsgBox _("Please enter some LaTeX code...") Exit Sub End If ' Some environments only work in LaTeX mode If IsPrefixString("\begin{align",sEqCode) Or IsPrefixString("\begin{eqnarray",sEqCode) Or IsPrefixString("\begin{gather",sEqCode) _ Or isPrefixString("\begin{flalign",sEqCode) Or IsPrefixString("\begin{multline",sEqCode) Or IsPrefixString("\begin{minted",sEqCode) Then sEqType = "latex" ' Don't do this if the object is not defined If Not isNull(oDlgMain) Then End If End If ' Check if the LaTeX code has any dependencies that can be fulfilled easily by copying files from source dir to tmp dir ' We check for include and input (with .tex files) and usepackage (with .sty files) ' Note that we search in the preamble and in the latex code (we concatenate the two) ' Patch by Daniel Fett ' Document URL Dim sUrl as String sUrl = ThisComponent.getURL() ' Open service file and an output stream Dim oFileAccess as Variant, oTextStream as Variant oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") oTextStream = createUnoService("com.sun.star.io.TextOutputStream") Dim sPotentialFile as String Dim sFilePath as String Dim aSplittedURL() as String Dim sCurrentDir as String aSplittedURL = split(sUrl, "/") For Each sPotentialFile in FindInLatexCommand(glb_sPreamble & sEqCode, "include") ' Document not saved If (sUrl = "") Then MsgBox _("Please save the document before using an \include command...") Exit Sub End If ' When using an \include command, the equation type must be set to "latex" sEqType = "latex" If Not isNull(oDlgMain) Then ' Don't do this if the object is not defined oDlgMain.getControl("TypeLatex").setState(1) End If ' Copy tex file to the tmp directory sCurrentDir = Left(sUrl, Len(sUrl) - Len(aSplittedUrl(UBound(aSplittedUrl)))) sFilePath = sCurrentDir & "/" & sPotentialFile & ".tex" If oFileAccess.exists(sFilePath) Then oFileAccess.copy(sFilePath, ConvertToURL( glb_sTmpPath & sPotentialFile & ".tex")) End If Next For Each sPotentialFile in FindInLatexCommand(glb_sPreamble & sEqCode, "input") ' Document not saved If (sUrl = "") Then MsgBox _("Please save the document before using an \input command...") Exit Sub End If ' Copy tex file to the tmp directory sCurrentDir = Left(sUrl, Len(sUrl) - Len(aSplittedUrl(UBound(aSplittedUrl)))) sFilePath = sCurrentDir & "/" & sPotentialFile & ".tex" If oFileAccess.exists(sFilePath) Then oFileAccess.copy(sFilePath, ConvertToURL( glb_sTmpPath & sPotentialFile & ".tex")) End If Next For Each sPotentialFile in FindInLatexCommand(glb_sPreamble & sEqCode, "usepackage") ' Document not saved If (sUrl = "") Then sFilePath = ConvertToURL( glb_sTmpPath & sPotentialFile & ".sty") ' Path of sty file in tmp dir If oFileAccess.exists(sFilePath) Then oFileAccess.kill(sFilePath) End If ' Other possible solution 'MsgBox _("Please save the document before using an \usepackage command...") 'Exit Sub Else sCurrentDir = Left(sUrl, Len(sUrl) - Len(aSplittedUrl(UBound(aSplittedUrl)))) sFilePath = sCurrentDir & "/" & sPotentialFile & ".sty" If oFileAccess.exists(sFilePath) Then oFileAccess.copy(sFilePath, ConvertToURL( glb_sTmpPath & sPotentialFile & ".sty")) End If End If Next ' Build the LaTeX code, depending on the selected mode If sEqType = "inline" Then sLatexCode = "\newsavebox{\eqbox}" & chr(10) &_ "\newlength{\width}" & chr(10) &_ "\newlength{\height}" & chr(10) &_ "\newlength{\depth}" & chr(10) & chr(10) &_ "\begin{lrbox}{\eqbox}" & chr(10) &_ "{$ " & sEqCode & " $}" & chr(10) &_ "\end{lrbox}" & chr(10) & chr(10) &_ "\settowidth {\width} {\usebox{\eqbox}}" & chr(10) &_ "\settoheight{\height} {\usebox{\eqbox}}" & chr(10) &_ "\settodepth {\depth} {\usebox{\eqbox}}" & chr(10) &_ "\newwrite\file" & chr(10) &_ "\immediate\openout\file=\jobname.bsl" & chr(10) &_ "\immediate\write\file{Depth = \the\depth}" & chr(10) &_ "\immediate\write\file{Height = \the\height}" & chr(10) &_ "\addtolength{\height} {\depth}" & chr(10) &_ "\immediate\write\file{TotalHeight = \the\height}" & chr(10) &_ "\immediate\write\file{Width = \the\width}" & chr(10) &_ "\closeout\file" & chr(10) &_ "\begin{document}" & chr(10) &_ "\usebox{\eqbox}" & chr(10) &_ "\end{document}" & chr(10) ElseIf sEqType = "display" Then sLatexCode = "\newsavebox{\eqbox}" & chr(10) &_ "\newlength{\width}" & chr(10) &_ "\newlength{\height}" & chr(10) &_ "\newlength{\depth}" & chr(10) & chr(10) &_ "\begin{lrbox}{\eqbox}" & chr(10) &_ "{$\displaystyle " & sEqCode & " $}" & chr(10) &_ "\end{lrbox}" & chr(10) & chr(10) &_ "\settowidth {\width} {\usebox{\eqbox}}" & chr(10) &_ "\settoheight{\height} {\usebox{\eqbox}}" & chr(10) &_ "\settodepth {\depth} {\usebox{\eqbox}}" & chr(10) &_ "\newwrite\file" & chr(10) &_ "\immediate\openout\file=\jobname.bsl" & chr(10) &_ "\immediate\write\file{Depth = \the\depth}" & chr(10) &_ "\immediate\write\file{Height = \the\height}" & chr(10) &_ "\addtolength{\height} {\depth}" & chr(10) &_ "\immediate\write\file{TotalHeight = \the\height}" & chr(10) &_ "\immediate\write\file{Width = \the\width}" & chr(10) &_ "\closeout\file" & chr(10) &_ "\begin{document}" & chr(10) &_ "\usebox{\eqbox}" & chr(10) &_ "\end{document}" & chr(10) ElseIf sEqType = "latex" Then sLatexCode = sEqCode End If ' Create the LaTeX file with the LatexCode cURL = ConvertToURL( glb_sTmpPath & "tmpfile.tex" ) If oFileAccess.exists( cURL ) Then oFileAccess.kill( cURL ) oTextStream.setOutputStream(oFileAccess.openFileWrite(cURL)) If sEqType = "latex" Then If glb_bIgnorePreamble Then oTextStream.writeString(sLatexCode) Else oTextStream.writeString( _ "\documentclass[10pt]{article}" & chr(10) &_ glb_sPreamble & chr(10) & chr(10) &_ "\pagestyle{empty}" & chr(10) &_ "\begin{document}" & chr(10) &_ sLatexCode & chr(10) &_ "\end{document}" ) End If Else oTextStream.writeString( _ "\documentclass[10pt]{article}" & chr(10) &_ glb_sPreamble & chr(10) & chr(10) &_ "\pagestyle{empty}" & chr(10) &_ sLatexCode ) End If ' Close the file oTextStream.closeOutput() ' Test the existence of the LaTeX file... If CheckFile( glb_sTmpPath & "tmpfile.tex" , _ _("The file ") & ConvertFromURL(glb_sTmpPath) & _("tmpfile.tex cannot be created") & chr(10) & _ _("Please check your installation...") ) Then ConfigDialog() Exit Sub End If ' Windows If getGUIType() = 1 Then sShellCommand = GetScriptPath() sShellArg = sEqFormat & " " & sEqDPI & " " & sEqTransp & " " & winPath(glb_sTmpPath) ' Linux or Mac OS X Else sShellCommand = "/bin/bash" sShellArg = "'" & ConvertFromURL(GetScriptPath()) & "' " & sEqFormat &_ " " & sEqDPI & " " & sEqTransp & " '" & ConvertFromURL(glb_sTmpPath) & "'" End If ' Remove Latex output file cURL = ConvertToURL( glb_sTmpPath & "tmpfile.out" ) If oFileAccess.exists( cURL ) Then oFileAccess.kill( cURL ) ' Call the script Shell(sShellCommand, 2, sShellArg, TRUE) ' Check the result If Not FileExists(glb_sTmpPath & "tmpfile.dvi") _ and Not FileExists(glb_sTmpPath & "tmpfile.out") Then MsgBox ( _("No file created in the directory:") & _ chr(10) & ConvertFromURL(glb_sTmpPath) ) Exit Sub ElseIf Not FileExists(glb_sTmpPath & "tmpfile.dvi") _ and FileExists(glb_sTmpPath & "tmpfile.out") Then ' Latex error PrintFile("tmpfile.out") Exit Sub ElseIf CheckFile(glb_sTmpPath & "tmpfile." & sEqFormat,_ _("Script error: the dvi file was not converted to ") & sEqFormat & "! " & chr(10) & chr(10) &_ _("Please check your system configuration...") ) Then Exit Sub End If ' Image size is 0 If FileExists(glb_sTmpPath & "tmpfile.bsl") Then If GetVertShift() = 0 Then Exit Sub End If ' If we arrive here, the compilation succeeded. We can close the dialog 'If Dialog Then 'oDlgMain.endExecute() 'SavePosSize() 'End If ' Create the Controller and dispatcher for current document Dim ret as Boolean Dim oDoc as Variant, oDocCtrl as Variant, oDispatcher as Variant, oGraphic as Variant, oShapeSize as Variant oDoc = ThisComponent oDocCtrl = oDoc.getCurrentController() oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper") ' ================== Current document is a Writer document ================== If GetDocumentType(oDoc) = "swriter" Then Dim oViewCursor as Variant, oCursor as Variant Dim AnchorType as Integer ' If there is already an equation image, remove it If EditEquation Then ' Select image (ensuring compatibility with previous TexMaths versions) Dim oSelection as Variant On Error Goto SelectionError oSelection = oDocCtrl.getSelection().GetByIndex(0) ' Get selected image anchor Dim oAnchor as Variant oAnchor = oSelection.getAnchor() AnchorType = oSelection.AnchorType ' Delete the selected image 'oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:Delete", "", 0, Array()) ' Does not work properly ' Delete the selected image oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:Escape", "", 0, Array()) oDoc.drawPage.remove(oSelection) End If ' Set vertical alignement to middle when Word compatibility is requested If glb_WordVertAlign = TRUE Then dim args4(0) as new com.sun.star.beans.PropertyValue args4(0).Name = "VerticalParagraphAlignment" args4(0).Value = 3 oDispatcher.executeDispatch(oDocCtrl.Frame, ".uno:VerticalParagraphAlignment", "", 0, args4()) End If ' Set text cursor position to the view cursor position oViewCursor = oDocCtrl.ViewCursor oCursor = oViewCursor.Text.createTextCursorByRange(oViewCursor) oCursor.gotoRange(oViewCursor,FALSE) ' Trick used to ensure the image is located at the cursor position ' => set the paragraph alignment to left, then insert the equation, ' then restore the paragraph alignment Dim iParaAdjust as Integer iParaAdjust = oViewCursor.ParaAdjust oViewCursor.ParaAdjust = 0 ' LEFT aligned ' Import the new image into the clipboard ret = ImportGraphicIntoClipboard(ConvertToURL( glb_sTmpPath & "tmpfile."& sEqFormat), sEqFormat, sEqDPI, sEqTransp) If ret = FALSE Then Exit Sub ' Paste image to the current document oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:Paste", "", 0, Array()) ' Select image oGraphic = oDocCtrl.getSelection().GetByIndex(0) ' Set the graphic object name oGraphic.Name = sEqname ' Scale image oShapeSize = oGraphic.Size oShapeSize.Width = oShapeSize.Width * (iEqSize / 10) oShapeSize.Height = oShapeSize.Height * (iEqSize / 10) oGraphic.Size = oShapeSize ' In edit mode, anchor the image as it was If EditEquation Then Select Case AnchorType Case ANCHOR_TO_PARA oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:SetAnchorToPara", "", 0, Array()) oGraphic.setPosition(oImgPosition) Case ANCHOR_TO_CHAR oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:SetAnchorToChar", "", 0, Array()) ' Don't position image in this case Case ANCHOR_TO_PAGE oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:SetAnchorToPage", "", 0, Array()) oGraphic.setPosition(oImgPosition) Case ANCHOR_AT_CHAR oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:SetAnchorAtChar", "", 0, Array()) oGraphic.setPosition(oImgPosition) End Select ' New equations are anchored to char Else AnchorType = ANCHOR_TO_CHAR oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:SetAnchorToChar", "", 0, Array()) End If ' Set some image properties oGraphic.TopMargin = 0 oGraphic.BottomMargin = 0 oGraphic.VertOrient = 0 ' Adjust vertical position for Inline or Display equations when image is anchored to char If AnchorType = ANCHOR_TO_CHAR and ( sEqtype = "inline" or sEqType = "display" ) Then ' Get vertical shift coefficient Dim coef as Double coef = getVertShift() ' Adjust the vertical position to the baseline oGraphic.VertOrientPosition = - coef * oShapeSize.Height End If ' Set image attributes (size, type LaTeX code) for further editing SetAttributes( oGraphic, iEqSize, sEqType, sEqCode, sEqFormat, sEqDPI, sEqTransp, sEqName ) ' Deselect image oDispatcher.executeDispatch(oDocCtrl.Frame, ".uno:Escape", "", 0, Array()) ' Reposition the view cursor oViewCursor.gotoRange(oCursor, FALSE) ' Restore the paragraph alignment oViewCursor.ParaAdjust = iParaAdjust ' ================== Current document is an Impress or Draw document ================== ElseIf GetDocumentType(oDoc) = "simpress" or GetDocumentType(oDoc) = "sdraw" Then ' Edit equation: remove old image If EditEquation Then ' Fill in reference to original shape (used to keep animations and Z index) Dim oOriginalShape as Variant Dim oOriginalShapeZOrder as Long oOriginalShape = oDocCtrl.getSelection().getByIndex(0) oOriginalShapeZOrder = oOriginalShape.ZOrder oDispatcher.executeDispatch(oDocCtrl.Frame,".uno:Cut","", 0, Array() ) End If ' Import the new image to the clipboard ret = ImportGraphicIntoClipboard(ConvertToURL( glb_sTmpPath & "tmpfile." & sEqFormat), sEqFormat, sEqDPI, sEqTransp) If ret = FALSE Then Exit Sub ' Paste image to the current document oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:Paste", "", 0, Array()) ' Select image oGraphic = oDocCtrl.getSelection().getByIndex(0) ' Set the graphic object name oGraphic.Name = sEqname ' Edit equation: set its position equal to the previous one If EditEquation Then oGraphic.setPosition(oShapePosition) ' New equation: Position the image at the center of the visible area Else Dim oPosition as Variant oPosition = createUnoStruct( "com.sun.star.awt.Point" ) oPosition.X = oDocCtrl.VisibleArea.X + oDocCtrl.VisibleArea.Width / 2 - (oGraphic.Size.Width*iEqSize/10) / 2 oPosition.Y = oDocCtrl.VisibleArea.Y + oDocCtrl.VisibleArea.Height / 2 - (oGraphic.Size.Height* iEqSize/10) / 2 oGraphic.setPosition(oPosition) End If ' Scale the image oShapeSize = oGraphic.Size oShapeSize.Width = oShapeSize.Width * iEqSize / 10 oShapeSize.Height = oShapeSize.Height * iEqSize / 10 oGraphic.Size = oShapeSize ' Set image attributes (size, type LaTeX code) for further editing SetAttributes( oGraphic, iEqSize, sEqType, sEqCode, sEqFormat, sEqDPI, sEqTransp, sEqName) ' Trick to allow undoing the equation insertion oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:Cut", "", 0, Array()) oDispatcher.executeDispatch( oDocCtrl.Frame, ".uno:Paste", "", 0, Array()) ' Select image oGraphic = oDocCtrl.getSelection().getByIndex(0) ' Edit equation: transfer animations from old shape to new shape If EditEquation and GetDocumentType(oDoc) = "simpress" Then TransferAnimations(oDocCtrl.getCurrentPage(), oOriginalShape, oGraphic) TransferAnimations(oDocCtrl.getCurrentPage(), oOriginalShape, oGraphic) End If ' Preserve Z index of equation If EditEquation Then oGraphic.ZOrder = oOriginalShapeZOrder End If End If ' If Writer is installed, restore initial clipboard content If Not (getGUIType() = 1 And sVersion = "5") Then ' Doesn't work on Windows with Libreoffice 5.x If ComponentInstalled( "Writer" ) Then TextToClipboard(sClipContent) End If End If ' Close the TexMaths dialog If Dialog Then oDlgMain.endExecute() SavePosSize() End If Exit Sub ' To ensure compatibility with previous TexMaths versions SelectionError: oSelection = oDocCtrl.getSelection Resume Next End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsTools.xba000064440400000011636213206777051027567 0ustar kkremitzkikkremitzki ' ' TexMathsTools ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Various general macros ' Force variable declaration Option Explicit ' Get the script directory path depending on the system ' On Windows we use a non standard place due to a bug in LibreOffice ' where it is not possible to execute a batch file when the path name contains spaces Function GetScriptDir() as String If getGUIType() = 1 Then ' Windows GetScriptDir() = Environ("HOMEDRIVE") & "\" & "texmaths-" & RemoveSpaces( Environ( "USERNAME" ) & "\" ) Else ' Linux or MacOSX GetScriptDir() = glb_sUserPath End If End Function ' Get TexMaths version Function GetVersion() as String Dim str as String ' Get TexMaths version from the package path str = Right(glb_sPkgPath, 17) GetVersion() = Mid(str, 9, 4) End Function ' Get LibreOffice version Function GetLOVersion() as String Dim aConfigProvider as Variant Dim oNode as Variant Dim args(0) as new com.sun.star.beans.PropertyValue aConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider") args(0).Name = "nodepath" args(0).Value = "/org.openoffice.Setup/Product" oNode = aConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args()) getLOVersion = oNode.getbyname("ooSetupVersion") End Function ' Get the script file path depending on the system Function GetScriptPath() as String If getGUIType() = 1 Then ' Windows GetScriptPath() = GetScriptDir() & "TexMaths-" & GetVersion() & ".bat" Else ' Linux or MacOSX GetScriptPath() = GetScriptDir() & "TexMaths-" & GetVersion() & ".sh" End If End Function ' Execute the Unix command 'uname' and return the result into a string ' On Mac OS X, this should return the string "Darwin" Function GetUname() as String Dim sMsg as String, sFilePath as String ' Execute the uname command sFilePath = ConvertFromURL(glb_sTmpPath) & "tmpuname.txt" Shell( "bash -c", 2, "'" & "uname > " & """" & sFilePath & """" & "'", TRUE ) ' File does not exist If Not FileExists( sFilePath ) Then MsgBox _("Error: can't find file ") & sFilePath Exit Function End If ' Read first line of file sMsg = "" Dim iNumber as Integer Dim sLine as String iNumber = Freefile Open sFilePath For Input As iNumber If Not EOF(iNumber) Then Line Input #iNumber, sLine sMsg = sLine End If Close #iNumber ' Output the result GetUname() = sMsg End Function ' Remove spaces in string Function RemoveSpaces( ByVal str As String ) As String Dim result as String Dim c as String Dim i as Integer result = "" For i = 1 To Len( str ) c = Mid( str, i, 1 ) If c <> " " Then result = result & c EndIf Next RemoveSpaces() = result End Function ' Replace newline characters (chr(10)) with "§" Function EncodeNewline( ByVal str As String ) As String Dim result as String Dim c as String Dim i as Integer result = "" For i = 1 To Len( str ) c = Mid( str, i, 1 ) If c = chr(10) Then c = "§" EndIf result = result & c Next EncodeNewline() = result End Function ' Replace "§" characters with newline (chr(10)) Function DecodeNewline( ByVal str As String ) As String Dim result as String Dim c as String Dim i as Integer result = "" For i = 1 To Len( str ) c = Mid( str, i, 1 ) If c = "§" Then c = chr(10) EndIf result = result & c Next DecodeNewline() = result End Function ' Read program path from the system path Function ReadPgmPath(pgm as String) as String Dim sMsg as String, sFilePath as String ' Windows If getGUIType() = 1 Then ' Create the batch file "which.bat" if it doesn't exist yet ' This batch file is used to find if a program is in the system path If Not FileExists( GetScriptDir() & "which.bat" ) Then Dim cURL as String, str as String ' Open service file and an output stream Dim oFileAccess as Variant, oTextStream as Variant oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") oTextStream = createUnoService("com.sun.star.io.TextOutputStream") ' Generate the "which.bat" script in the appropriate directory cURL = ConvertToURL( GetScriptDir() & "which.bat" ) str = "@echo off" & chr(10) &_ "@for %%e in (%PATHEXT%) do @for %%i in (%~n1%%e) do @if NOT ""%%~$PATH:i""=="""" echo %%~$PATH:i" & chr(10) oTextStream.setOutputStream(oFileAccess.openFileWrite(cURL)) oTextStream.writeString( str ) oTextStream.closeOutput() End If ' File path sFilePath = GetScriptDir() & "tmppath.txt" ' Execute the which command Shell( "cmd.exe /c", 2, "'" & GetScriptDir() & "which.bat " & pgm & "> " & sFilePath & "'", TRUE ) ' Linux or MacOSX Else ' File path sFilePath = ConvertFromURL(glb_sTmpPath) & "tmppath.txt" ' Execute the which command Shell( "bash -c", 2, "'" & "which " & pgm & "> " & """" & sFilePath & """" & "'", TRUE ) End If ' File does not exist If Not FileExists( sFilePath ) Then MsgBox _("Error: can't find file ") & sFilePath Exit Function End If ' Read first line of file sMsg = "" Dim iNumber as Integer Dim sLine as String iNumber = Freefile Open sFilePath For Input As iNumber If Not EOF(iNumber) Then Line Input #iNumber, sLine sMsg = sLine End If Close #iNumber ' Get parent directory If sMsg <> "" Then sMsg = Left( sMsg, Len(sMsg) - Len(pgm) ) ReadPgmPath() = sMsg End Function ' Read a text file ' The path variable must be terminated by a path separator Function ReadTextFile(file as String, path as String) as String Dim sMsg as String, sFilePath as String sFilePath = ConvertToURL( path & file ) If Not FileExists( sFilePath ) Then MsgBox _("Error: can't find file ") & file Exit Function End If Dim iNumber as Integer Dim sLine as String iNumber = Freefile sMsg = "" Open sFilePath For Input As iNumber While Not EOF(iNumber) Line Input #iNumber, sLine sMsg = sMsg & sLine & chr(10) Wend Close #iNumber ReadTextFile() = sMsg End Function ' Read a text file encoded in UTF-8 ' The path variable must be terminated by a path separator Function ReadTextFileUtf8( file as String , path as String) as String Dim sMsg as String, sFilePath as String sFilePath = ConvertToURL( path & file ) If Not FileExists( sFilePath ) Then MsgBox _("Error: can't find file ") & file Exit Function End If Dim oTextFile as Variant, oFileAccess as Variant, oFileStream as Variant Dim sLine As String oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") oFileStream = oFileAccess.openFileRead(sFilePath) oTextFile = createUnoService("com.sun.star.io.TextInputStream") oTextFile.InputStream = oFileStream sMsg = "" Do While Not oTextFile.IsEOF sLine = oTextFile.readLine sMsg = sMsg & sLine & chr(10) Loop oFileStream.closeInput oTextFile.closeInput ReadTextFileUtf8() = sMsg End Function ' Import graphic from URL into the clipboard ' Inspired from OOoForums DannyB's code ' Return TRUE if success, else return FALSE Function ImportGraphicIntoClipboard(cURL as String, sEqFormat as String, sEqDPI as String, sEqTransp as String) as Boolean Dim sLine as String Dim str1() as String, str2() as String Dim X as String, Y as String, W as String, H as String Dim str as String Dim cURL_ as String Dim iNumber as Integer Dim iNumber_ as Integer ' Initialize return code to success ImportGraphicIntoClipboard()= TRUE ' Copy the URL of the image file cURL_ = cURL ' If SVG image, then eventually add an opaque rectangle below the image ' to improve the selection usability If sEqFormat = "svg" Then ' URL of the output file str1 = Split(cURL, ".svg") cURL_ = str1(0) & "_.svg" ' Read and write image file at the same time iNumber = Freefile iNumber_ = Freefile+1 sLine = "" If FileExists(cURL) Then ' Get image transparency Dim opacity as String If sEqTransp = "TRUE" Then opacity = "0" Else opacity = "1" End If Open cURL For Input As iNumber Open cURL_ For Output As iNumber_ Do While not Eof(iNumber) Line Input #iNumber, sLine str1 = Split(sLine) ' Recopy the line Print #iNumber_, sLine ' Add a rectangle with appropriate opacity below the equation If str1(0) = "<svg" Then If InStr(sLine, "viewBox") = 0 Then MsgBox _("Error: can't decode SVG file, please check your LaTeX code...") ImportGraphicIntoClipboard()= FALSE Exit Function End If ' Get the rectangle coordinates and size str2 = Split(str1(3),"='") X = str2(1) Y = str1(4) W = str1(5) str2 = Split(str1(6),"'") H = str2(0) str = "<rect fill=""#ffffff"" x=""" & X & """ y=""" & Y & """ width=""" & W & """ height=""" & H & """ style=""fill-opacity:" & opacity & """/>" ' Write the rectangle Print #iNumber_, str End If Loop Close #iNumber Close #iNumber_ ' File not found Else MsgBox _("Error: can't find file ") & cURL ImportGraphicIntoClipboard()= FALSE Exit Function End If End If ' Import the graphic from URL into a new draw document Dim arg1(0) as New com.sun.star.beans.PropertyValue Dim oDrawDoc as Variant, oDrawDocCtrl as Variant arg1(0).Name = "Hidden" arg1(0).Value = TRUE oDrawDoc = StarDesktop.loadComponentFromURL( cURL_, "_blank", 0, arg1() ) oDrawDocCtrl = oDrawDoc.getCurrentController() ' Get the draw page Dim oDrawPage as Variant, oImportShape as Variant oDrawPage = oDrawDoc.DrawPages(0) ' Group shapes if SVG format because there are multiple shapes ' PNG format has only one shape, so there is no need to group If sEqFormat = "svg" Then Dim oShapes as Variant oShapes = createUnoService("com.sun.star.drawing.ShapeCollection") Dim i as Integer For i = 0 To oDrawPage.getCount()-1 oShapes.add(oDrawPage.getByIndex(i)) Next oDrawPage.group(oShapes) End If ' Get the shape oImportShape = oDrawPage(0) Dim oImageSize as Variant Dim oShapeSize as Variant oShapeSize = createUnoStruct("com.sun.star.awt.Size") ' LibreOffice (or OpenOffice) version Dim sVersion as String sVersion = Left(GetLOVersion(),3) ' If LibreOffice version >= 5.2 and SVG format, ' reduce image size to mimic the text font size If Val(sVersion) >= 5.2 And sEqFormat = "svg" Then ' Get actual image size oImageSize = oImportShape.Size() ' Set image size oShapeSize.Width = oImageSize.Width * 0.8 oShapeSize.Height = oImageSize.Height * 0.8 oImportShape.setSize(oShapeSize) End If ' If PNG format, scale the image obtained from the dvipng external program If sEqFormat = "png" Then ' Get actual image size, in pixels oImageSize = oImportShape.Graphic.SizePixel() ' Set image size oShapeSize.Width = (oImageSize.Width * 35) * (72 / Val(sEqDPI)) oShapeSize.Height = (oImageSize.Height * 35) * (72 / Val(sEqDPI)) oImportShape.setSize(oShapeSize) End If ' Copy the image to clipboard and close the draw document oDrawDocCtrl.select(oImportShape) Dim oDispatcher as Variant Dim Array() oDispatcher = createUnoService( "com.sun.star.frame.DispatchHelper" ) oDispatcher.executeDispatch( oDrawDocCtrl.Frame, ".uno:Copy", "", 0, Array() ) oDrawDoc.close(True) oDrawDoc.dispose() End Function ' Read the Latex attributes (parameters and text of the Latex equation) of the object ' Can read old TexMaths or ooolatex attributes Function ReadAttributes( oShape as Variant ) as String Dim str as String On Error Resume Next ' Check if the object is an old TexMaths equation Dim oAttributes as Variant oAttributes = oShape.UserDefinedAttributes() str = oAttributes.getByName("TexMathsArgs").Value If str <> "" Then ReadAttributes() = str Exit Function Else ' Check if the object is an ooolatex equation str = oAttributes.getByName("OOoLatexArgs").Value If str <> "" Then ReadAttributes() = str Exit Function Else ' Read the image title str = oShape.Title ' Attributes are stored in the image description If str = "TexMaths" Then ReadAttributes() = oShape.Description Exit Function End If End If ReadAttributes() = "" End If End Function ' Write the Latex attributes (parameters and text of the Latex equation) ' into the object title and description Sub SetAttributes( oShape as Variant, iEqSize as Integer, sEqType as String, sEqCode as String, sEqFormat as String, sEqDPI as String, sEqTransp as String, sEqName as String) oShape.Title = "TexMaths" oShape.Description = iEqSize & "§" & sEqType & "§" & sEqCode & "§" & sEqFormat & "§" & sEqDPI & "§" & sEqTransp & "§" & sEqName End Sub ' Get the image size from the .dat file Function GetImageSize() as com.sun.star.awt.Size Dim sFilePath as String Dim iNumber as Integer Dim sLine1 as String, sLine2 as String ' Initializations iNumber = Freefile sLine1 = "" sLine2 = "" sFilePath = glb_sTmpPath & "tmpfile.dat" ' Read the .dat file If FileExists(sFilePath) Then Open sFilePath For Input As iNumber Line Input #iNumber, sLine1 Line Input #iNumber, sLine2 Close #iNumber Dim str1() as String, str2() as String Dim height as Double, width as Double, depth as Double ' Image format is SVG If glb_sFormat = "svg" Then ' Get the image width and height in mm str1 = Split(sLine2,"(") str2 = Split(str1(1),"mm") width = Val(str2(0)) str1 = Split(sLine2,"x") str2 = Split(str1(2),"mm") height = Val(str2(0)) ' Convert image width and height to twips width = width*100 height = height*100 ' Image format is PNG Else ' Get the image depth, height and in mm str1 = Split(sLine2,"=") str2 = Split(str1(1)," ") depth = Val(str2(0)) str1 = Split(sLine2,"=") str2 = Split(str1(2)," ") height = Val(str2(0)) str1 = Split(sLine2,"=") str2 = Split(str1(3)," ") width = Val(str2(0)) ' Compute width and height (total height) in twips height = depth + height width = width*2.54/Val(glb_sGraphicDPI)*1000 height = height*2.54/Val(glb_sGraphicDPI)*1000 End If ' Return image size Dim oSize as Variant oSize = createUnoStruct("com.sun.star.awt.Size") oSize.Width = width oSize.Height = height GetImageSize() = oSize ' File not found Else MsgBox _("Error: can't find file ") & sFilePath Exit Function End If End Function ' Get the vertical shift of the image according to the baseline position ' Return 0 if an error has occurred Function GetVertShift() as Double Dim sFilePath as String Dim str1() as String, str2() as String Dim iNumber as Integer Dim sLine1 as String, sLine2 as String ' Read the file that contains depth and height iNumber = Freefile sLine1 = "" sLine2 = "" sFilePath = glb_sTmpPath & "tmpfile.bsl" If FileExists(sFilePath) Then Open sFilePath For Input As iNumber Line Input #iNumber, sLine1 Line Input #iNumber, sLine2 Close #iNumber ' Get the depth and height Dim depth as Double, height as Double str1 = Split(sLine1,"=") str2 = Split(str1(1),"pt") depth = Val(str2(0)) str1 = Split(sLine2,"=") str2 = Split(str1(1),"pt") height = Val(str2(0)) ' An error has occurred If depth + height = 0 Then MsgBox _("Error: please check the equation syntax...") GetVertShift() = 0 Else ' Compute vertical shift and return value GetVertShift() = height / (depth + height) End If ' File not found Else MsgBox _("Error: can't find file ") & sFilePath Exit Function End If End Function ' Display file on screen from temp directory Sub PrintFile(sFile as String) Dim iNumber as Integer Dim sMsg as String, sLine as String If Not FileExists(glb_sTmpPath & sFile) Then MsgBox _("Error: the file ") & glb_sTmpPath & sFile & _(" doesn't exist...") Exit Sub End If iNumber = Freefile Open glb_sTmpPath & sFile For Input As iNumber While Not EOF(iNumber) Line Input #iNumber, sLine sMsg = sMsg & sLine & chr(10) Wend Close #iNumber MsgBox(sMsg) End Sub ' Convert decimal into two digits hexadecimal number as string Function Hex2( Value as Integer) as String Dim Hex1 as String If Value = 0 Then Hex1 = "00" Exit Function End If Hex1 = Hex( Value ) If Len( Hex1 ) = 1 Then Hex1 = "0" & Hex1 Hex2() = Hex1 End Function ' Display given message in the status bar Sub DisplayStatus(msg as String) glb_sStatus = msg End Sub ' Add a slash if necessary Function CheckPath( sPath as String) as String If Right(sPath,1) = "/" Then CheckPath() = sPath Else CheckPath() = sPath & "/" End If End Function ' Check if file exists and if not, displays an error message Function CheckFile( sUrl as String, ErrorMsg as String) as Boolean If FileExists(sUrl) Then CheckFile() = FALSE Else If ErrorMsg = "TexMaths" Then _ ErrorMsg = _("Can't find ") & sUrl & chr(10) & ("Please check your installation...") MsgBox(ErrorMsg) CheckFile() = TRUE End If End Function ' Return TRUE if string "s" doesn't contains character "c" Function StringNotContains( s as String, c as String ) as Boolean StringNotContains() = TRUE If (Len(s) <> 0) Then Dim j as Integer For j = 1 to Len(s) If Mid(s,j,1) = c Then StringNotContains() = FALSE Exit For End If Next End If End Function ' Return True if cPrefixString matches the beginning of cString (case sensitive) ' The following would return true... ' IsPrefixString( "Jo", "John" ) ' IsPrefixString( "Jo", "Joseph" ) ' IsPrefixString( "Jo", "Jolly" ) ' Copyright (c) 2003-2004 Danny Brewer Function IsPrefixString( ByVal cPrefixString As String, ByVal cString As String ) As Boolean IsPrefixString() = (Left( cString, Len( cPrefixString ) ) = cPrefixString ) End Function ' Get access to the repository Function GetConfigAccess(ByVal cNodePath as String,_ ByVal bWriteAccess as Boolean,_ Optional bEnableSync,_ Optional bLazyWrite ) as Variant If IsMissing( bEnableSync ) Then bEnableSync = TRUE If IsMissing( bLazyWrite ) Then bLazyWrite = FALSE Dim oConfigProvider as Variant oConfigProvider = GetProcessServiceManager().createInstanceWithArguments(_ "com.sun.star.configuration.ConfigurationProvider",_ Array( MakePropertyValue( "enableasync", bEnableSync ) ) ) Dim cServiceName as String If bWriteAccess Then cServiceName = "com.sun.star.configuration.ConfigurationUpdateAccess" Else cServiceName = "com.sun.star.configuration.ConfigurationAccess" EndIf Dim oConfigAccess as Variant oConfigAccess = oConfigProvider.createInstanceWithArguments(_ cServiceName,_ Array( MakePropertyValue( "nodepath", cNodePath ),_ MakePropertyValue( "lazywrite", bLazyWrite ) ) ) GetConfigAccess() = oConfigAccess End Function ' Create a PropertyValue structure from name and value pair Function MakePropertyValue( Optional cName as String, Optional uValue as Variant) As com.sun.star.beans.PropertyValue ' Create structure Dim oPropertyValue as Variant oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" ) ' Set name and value pair If Not IsMissing( cName ) Then oPropertyValue.Name = cName If Not IsMissing( uValue ) Then oPropertyValue.Value = uValue ' Return structure MakePropertyValue() = oPropertyValue End Function ' On Windows, generate path as "C:\path_to_file\" Function WinPath(sPath as String) as String sPath = ConvertFromUrl(sPath) WinPath() = """" & sPath & """" End function ' Determine document type from the services that are supported ' Author Andrew Pitonyak Function GetDocumentType( oDoc as Variant) as String Dim sImpress as String, sCalc as String, sDraw as String, sBase as String, sMath as String, sWriter as String sCalc = "com.sun.star.sheet.SpreadsheetDocument" sImpress = "com.sun.star.presentation.PresentationDocument" sDraw = "com.sun.star.drawing.DrawingDocument" sBase = "com.sun.star.sdb.DatabaseDocument" sMath = "com.sun.star.formula.FormulaProperties" sWriter = "com.sun.star.text.TextDocument" On Local Error GoTo NO_DOCUMENT_TYPE If oDoc.SupportsService(sCalc) Then GetDocumentType() = "scalc" ElseIf oDoc.SupportsService(sWriter) Then GetDocumentType() = "swriter" ElseIf oDoc.SupportsService(sDraw) Then GetDocumentType() = "sdraw" ElseIf oDoc.SupportsService(sMath) Then GetDocumentType() = "smath" ElseIf oDoc.SupportsService(sImpress) Then GetDocumentType() = "simpress" ElseIf oDoc.SupportsService(sBase) Then GetDocumentType() = "sbase" End If NO_DOCUMENT_TYPE: If Err <> 0 Then GetDocumentType = "" Resume GO_ON GO_ON: End If End Function ' Get application locale ' Author : Laurent Godard ' e-mail : listes.godard@laposte.net Function GetLocale() as string Dim oSet as Variant, oConfigProvider as Variant Dim oParm(0) As New com.sun.star.beans.PropertyValue Dim sProvider as String, sAccess as String sProvider = "com.sun.star.configuration.ConfigurationProvider" sAccess = "com.sun.star.configuration.ConfigurationAccess" oConfigProvider = createUnoService(sProvider) oParm(0).Name = "nodepath" oParm(0).Value = "/org.openoffice.Setup/L10N" oSet = oConfigProvider.createInstanceWithArguments(sAccess, oParm()) Dim str as String str = oSet.getbyname("ooLocale") GetLocale() = lcase(Left(trim(str),2)) End Function ' Translation function ' Replace each string like _("string example") with its translation ' Original author : Pierre Chef, june 2009 ' Available under the terms of the WTFPL Function _(msgid as String) as String Dim i as Integer Dim sTrans as String ' Read the appropriate po file at the first time If glb_PoFileRead <> 1 then ReadPoFile(glb_sPkgPath & "po") ' Look for the corresponding translated string For i = 0 to Ubound(glb_MsgId) If glb_MsgId(i) = msgid Then sTrans = glb_MsgStr(i) Exit For End If Next i ' Return the translated string If sTrans = "" Then sTrans = msgid _() = sTrans End Function ' Read po file according to the current locale ' and construct the tables used to store translated strings ' Original author: Pierre Chef, june 2009 ' Available under the terms of the WTFPL Sub ReadPoFile(podir as string) Dim oFileAccess as Variant Dim sline as String ' Line read Dim lineLen as Integer ' Length of line read Dim msgCounter as Integer ' Message counter Dim position as Integer ' Position in a string Dim quotePos as Integer ' Position after first quotation mark Dim transType as String ' Translation type : msgid or msgstr Dim message as String ' String contained in msgid or msgstr Dim locale as String ' Locale code : fr, en, es, it, de, ... Dim pofile as String ' po file path ' Simple file access object oFileAccess = CreateUnoService("com.sun.star.ucb.SimpleFileAccess") ' The podir must be a folder If oFileAccess.isFolder(podir) Then ' Add eventually a trailing slash If right(podir,1) <> "/" then podir = podir + "/" ' Get current locale locale = GetLocale() ' Po file path pofile = podir + locale + ".po" ' File must exist If oFileAccess.exists(pofile) Then ' Open po file in the same way as ReadTextFileUtf8() ' because we may have UTF-8 characters within it Dim oTextFile as Variant, oFileStream as Variant oFileStream = oFileAccess.openFileRead(pofile) oTextFile = createUnoService("com.sun.star.io.TextInputStream") oTextFile.InputStream = oFileStream Else Exit Sub End If Else Exit Sub End If ' Initialize counter msgCounter = -1 ' Read the po file, line by line While Not oTextFile.IsEOF ' Read line sline = oTextFile.readLine lineLen=len(sline) quotePos = InStr(sline,"""")+1 If lineLen > 2 Then Select Case left(sline,1) ' Po file comment Case "#": ' Identifier Case "m": If left(sline,5) = "msgid" Then transType = "id" msgCounter = msgCounter+1 redim Preserve glb_MsgId(msgCounter) redim Preserve glb_MsgStr(msgCounter) message = mid(sline,quotePos,lineLen-quotePos) Elseif left(sline,6) = "msgstr" Then transType="str" message = mid(sline,quotePos,lineLen-quotePos) Endif ' Update tables UpdTransTables(message,msgCounter,transType) ' String (quotePos=1 obviously) Case """": ' Update tables message = mid(sline,quotePos,lineLen-quotePos) UpdTransTables(message,msgCounter,transType) ' Other : error in the po file Case Else End Select End If Wend ' End file reading loop ' Close file oFileStream.closeInput oTextFile.closeInput ' Set flag glb_PoFileRead = 1 End Sub ' Update the tables used to store translated strings ' Original author: Pierre Chef, june 2009 ' Available under the terms of the WTFPL Sub UpdTransTables(message as String, msgCounter as Integer, transType as String) If message = "" Then Exit Sub If transType = "id" Then glb_MsgId(msgCounter)= glb_MsgId(msgCounter) + message Elseif transType = "str" Then glb_MsgStr(msgcounter)= glb_MsgStr(msgcounter) + message Endif End Sub ' Put the content of the clipboard into a string ' Original author: Andrew Pitonyak Function ClipboardToText() as String On Error Goto ErrorHandler ' Enables error handling Dim oClip as Variant, oClipContents as Variant, oTypes as Variant, oConverter as Variant Dim i as Integer, iPlainLoc as Integer Dim sContent as String oClip = createUnoService( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) oConverter = createUnoService( "com.sun.star.script.Converter" ) oClipContents = oClip.getContents() oTypes = oClipContents.getTransferDataFlavors() iPlainLoc = -1 For i = LBound(oTypes) To UBound(oTypes) If oTypes(i).MimeType = "text/plain;charset=utf-16" Then iPlainLoc = i Exit For End If Next sContent = "" If iPlainLoc >= 0 Then Dim oData as Variant oData = oClipContents.getTransferData(oTypes(iPlainLoc)) sContent = oConverter.convertToSimpleType(oData, com.sun.star.uno.TypeClass.STRING) End If ClipboardToText() = sContent Exit Function ' Handle error that sometimes occurs in oClipContents.getTransferData() ErrorHandler: 'MsgBox "Error in ClipboardToText()" 'MsgBox "Error code: " + Err + Chr$(13) + Error$ ClipboardToText() = sContent End Function ' Put a string content into the clipboard ' Original author : DannyB Sub TextToClipboard( sContent As String ) Dim oDoc as Variant, oText as Variant, oCursor as Variant ' Create an empty hidden Writer document oDoc = StarDesktop.loadComponentFromURL( "private:factory/swriter", "_blank", 0, Array( MakePropertyValue( "Hidden", True ) ) ) ' Get the text of the document oText = oDoc.getText() ' Get a cursor that can move over or to any part of the text oCursor = oText.createTextCursor() ' Insert text and paragraph breaks into the text, at the cursor position oText.insertString( oCursor, sContent, False ) ' Dispatch commands Dim oFrame as Variant, oDispatcher as Variant oFrame = oDoc.CurrentController.Frame oDispatcher = createUnoService( "com.sun.star.frame.DispatchHelper" ) oDispatcher.executeDispatch(oFrame,".uno:SelectAll","",0,Array()) oDispatcher.executeDispatch(oFrame,".uno:Copy","",0,Array()) ' Close document oDoc.close( True ) End Sub ' Position the cursor at the most left position of the selection ' Author: Andrew Pitonyak ' email: andrew@pitonyak.org ' oSel is a text selection or cursor range Function GetLeftMostCursor(oSel as Variant) as Variant Dim oRange as Variant ' Right most range Dim oCursor as Variant 'Cursor at the right most range If oSel.getText().compareRegionStarts(oSel.getEnd(), oSel) >= 0 Then oRange = oSel.getEnd() Else oRange = oSel.getStart() End If oCursor = oSel.getText().CreateTextCursorByRange(oRange) oCursor.goRight(0, False) GetLeftMostCursor() = oCursor End Function ' Position the cursor at the most right position of the selection ' Author: Andrew Pitonyak ' email: andrew@pitonyak.org ' oSel is a text selection or cursor range Function GetRightMostCursor(oSel as Variant) as Variant Dim oRange as Variant ' Right most range Dim oCursor as Variant 'Cursor at the right most range If oSel.getText().compareRegionStarts(oSel.getEnd(), oSel) >= 0 Then oRange = oSel.getStart() Else oRange = oSel.getEnd() End If oCursor = oSel.getText().CreateTextCursorByRange(oRange) oCursor.goLeft(0, False) GetRightMostCursor() = oCursor End Function ' Test if a component (Writer, Draw, Impress) is installed Function ComponentInstalled( sName as String ) as Boolean Dim oModuleManager as Variant oModuleManager = CreateUnoService( "com.sun.star.frame.ModuleManager" ) ComponentInstalled() = FALSE If (sName = "Writer") and oModuleManager.hasByName( "com.sun.star.text.TextDocument" ) Then ComponentInstalled() = TRUE End If If (sName = "Impress") and oModuleManager.hasByName( "com.sun.star.presentation.PresentationDocument" ) Then ComponentInstalled() = TRUE End If If (sName = "Draw") and oModuleManager.hasByName( "com.sun.star.drawing.DrawingDocument" ) Then ComponentInstalled() = TRUE End If End Function ' Transfer animation from an old shape to a new shape in Impress mode ' Author: Daniel Fett Sub TransferAnimations(slide as Variant, original as Variant, replacement as Variant) Dim oMainSequence as Variant, oClickNodes as Variant, oClickNode as Variant, oGroupNodes as Variant Dim oGroupNode as Variant, oEffectNodes as Variant, oEffectNode as Variant, oAnimNodes as Variant, oAnimNode as Variant oMainSequence = GetMainSequence(slide) If oMainSequence = null Then ' Exit if null object Exit Sub End if oClickNodes = oMainSequence.createEnumeration() While oClickNodes.hasMoreElements() oClickNode = oClickNodes.nextElement() oGroupNodes = oClickNode.createEnumeration() While oGroupNodes.hasMoreElements() oGroupNode = oGroupNodes.nextElement() oEffectNodes = oGroupNode.createEnumeration() While oEffectNodes.hasMoreElements() oEffectNode = oEffectNodes.nextElement() oAnimNodes = oEffectNode.createEnumeration() While oAnimNodes.hasMoreElements() oAnimNode = oAnimNodes.nextElement() If EqualUnoObjects(original, oAnimNode.target) Then oAnimNode.target = replacement End If Wend Wend Wend Wend End Sub ' Get the main sequence from the given page ' Author: Daniel Fett Function GetMainSequence(oPage as Variant) as Variant Dim oMainSeq as Integer, oNodes as Variant, oNode as Variant oMainSeq = com.sun.star.presentation.EffectNodeType.MAIN_SEQUENCE ' Initialize to null GetMainSequence() = null oNodes = oPage.AnimationNode.createEnumeration() While oNodes.hasMoreElements() oNode = oNodes.nextElement() If GetNodeType(oNode) = oMainSeq Then GetMainSequence() = oNode Exit Function End If Wend End Function ' Get the type of a node ' Author: Daniel Fett Function GetNodeType(oNode as Variant) as Integer Dim oData as Variant For each oData in oNode.UserData If oData.Name = "node-type" Then GetNodeType() = oData.Value Exit Function End If Next oData End Function ' Return all strings that are contained in a given LaTeX command. ' For example, for the source code "\test{a} b c" and the command (search string) "test", it will return an array with one value, namely "a". ' Author: Daniel Fett Function FindInLatexCommand(sSourceCode as String, sCommand as String) Dim aStrings() As String Dim sSearch As String Dim iLast As Integer Dim iCommandStart As Integer iCommandStart = 1 iLast = 1 sSearch = "\" & sCommand & "{" Do While iLast <> 0 and iCommandStart <> 0 iCommandStart = InStr(iLast, sSourceCode, sSearch) If iCommandStart <> 0 Then ' We found the beginning of the command. Great, now search for the end! iLast = InStr(iCommandStart, sSourceCode, "}") Dim n as Integer n = UBound(aStrings) + 1 ' To prevent a crash in Openoffice 4.x ReDim Preserve aStrings(n) aStrings(UBound(aStrings)) = Mid(sSourceCode, iCommandStart + Len(sSearch), iLast - (iCommandStart + Len(sSearch))) End If Loop FindInLatexCommand() = aStrings End Function ' Returns TRUE if anything is selected in a Writer document ' Based on a function written by Andrew Pitonyak Function IsAnythingSelected(oDoc as Variant) As Boolean Dim oSels as Variant ' All of the selections Dim oSel as Variant ' A single selection Dim oCursor as Variant 'A temporary cursor IsAnythingSelected = False If IsNull(oDoc) Then Exit Function ' The current selection in the current controller ' If there is no current controller, it returns NULL oSels = oDoc.getCurrentSelection() If IsNull(oSels) Then Exit Function ' Text If oSels.getImplementationName() = "SwXTextRanges" Then ' I have never seen a selection count of zero If oSels.getCount() = 0 Then Exit Function ' If there are multiple selections, then assume something is selected If oSels.getCount() > 1 Then IsAnythingSelected = True Else ' If only one thing is selected, however, then check to see ' if the selection is collapsed. In other words, see if the ' end location is the same as the starting location. ' Notice that I use the text object from the selection object ' because it is safer than assuming that it is the same as the ' documents text object. oSel = oSels.getByIndex(0) oCursor = oSel.getText().CreateTextCursorByRange(oSel) If Not oCursor.IsCollapsed() Then IsAnythingSelected = True End If ' Tables, graphic elements, images, etc. Else IsAnythingSelected = True End If End Function libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsSysConfig.xba000064440400000013326013206777051030367 0ustar kkremitzkikkremitzki ' ' TexMathsSysConfig ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to create and manage the Sysconfig dialog ' Force variable declaration Option Explicit ' Dialog declaration Private oDlgSysConfig as Variant ' Main subroutine Sub Main() ' The Draw component is required If ComponentInstalled( "Draw" ) = FALSE Then MsgBox( _("Please install the Draw component to run TexMaths!") ) Exit Sub End If DefaultSysConfig() SysConfigDialog() End Sub ' Create and show the config dialog Sub SysConfigDialog() ' Load the library TexMaths DialogLibraries.LoadLibrary( "TexMaths" ) ' Create the dialog object oDlgSysConfig = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsSysConfig_GUI") ) ' Dialog strings for translation oDlgSysConfig.setTitle( _("TexMaths System Configuration") ) oDlgSysConfig.getControl("ShortcutFrame1").Model.Label = _("Equations Shortcuts") oDlgSysConfig.getControl("ShortcutFrame2").Model.Label = _("Numbered Equations Shortcut") oDlgSysConfig.getControl("SameShortcutKey").Model.Label = _("Same shortcut for Writer, Impress and Draw") oDlgSysConfig.getControl("SameShortcutKey").Model.HelpText = _("Use the same shortcut for Writer, Impress and Draw") oDlgSysConfig.getControl("SystempathsFrame").Model.Label = _("System Paths") oDlgSysConfig.getControl("AllFrame").Model.Label = _("All") oDlgSysConfig.getControl("Key1").Model.HelpText = _("Keyboard shortcut") oDlgSysConfig.getControl("Key2").Model.HelpText = _("Keyboard shortcut") oDlgSysConfig.getControl("Key3").Model.HelpText = _("Keyboard shortcut") oDlgSysConfig.getControl("Key4").Model.HelpText = _("Keyboard shortcut") oDlgSysConfig.getControl("LatexPath").Model.HelpText = _("Path of the latex program") oDlgSysConfig.getControl("DvipngPath").Model.HelpText = _("Path of the dvipng program") oDlgSysConfig.getControl("DvisvgmPath").Model.HelpText = _("Path of the dvisvgm program") oDlgSysConfig.getControl("HelpButton").Model.Label = _("Help...") oDlgSysConfig.getControl("HelpButton").Model.HelpText = _("Display help text") oDlgSysConfig.getControl("SaveButton").Model.Label = _("Save") oDlgSysConfig.getControl("SaveButton").Model.HelpText = _("Save system configuration") oDlgSysConfig.getControl("NumLevelLabel").Model.Label = _("Numbering Level") oDlgSysConfig.getControl("NumLevelLabel").Model.HelpText = _("Chapter level number to be included in equation numbers") oDlgSysConfig.getControl("NumLevel").addItems(Array("0","1","2","3","4"),0) oDlgSysConfig.getControl("NumLevel").Model.HelpText = _("Level number") oDlgSysConfig.getControl("LeftAlignRadio").Model.Label = _("Caption left alignment") oDlgSysConfig.getControl("LeftAlignRadio").Model.HelpText = _("Set equation caption alignment to left") oDlgSysConfig.getControl("RightAlignRadio").Model.Label = _("Caption right alignment") oDlgSysConfig.getControl("RightAlignRadio").Model.HelpText = _("Set equation caption alignment to right") Dim str1 as String, str2 as String str1 = _("Paths") str2 = _("Display the Paths tab") oDlgSysConfig.getControl("PathsButton1").Model.Label = str1 oDlgSysConfig.getControl("PathsButton3").Model.Label = str1 oDlgSysConfig.getControl("PathsButton2").Model.Label = str1 oDlgSysConfig.getControl("PathsButton1").Model.HelpText = str2 oDlgSysConfig.getControl("PathsButton2").Model.HelpText = str2 oDlgSysConfig.getControl("PathsButton3").Model.HelpText = str2 str1 = _("Options") str2 = _("Display the Options tab") oDlgSysConfig.getControl("OptionsButton1").Model.Label = str1 oDlgSysConfig.getControl("OptionsButton2").Model.Label = str1 oDlgSysConfig.getControl("OptionsButton3").Model.Label = str1 oDlgSysConfig.getControl("OptionsButton1").Model.HelpText = str2 oDlgSysConfig.getControl("OptionsButton2").Model.HelpText = str2 oDlgSysConfig.getControl("OptionsButton3").Model.HelpText = str2 str1 = _("Shortcuts") str2 = _("Display the Shortcuts tab") oDlgSysConfig.getControl("ShortcutsButton1").Model.Label = str1 oDlgSysConfig.getControl("ShortcutsButton2").Model.Label = str1 oDlgSysConfig.getControl("ShortcutsButton3").Model.Label = str1 oDlgSysConfig.getControl("ShortcutsButton1").Model.HelpText = str2 oDlgSysConfig.getControl("ShortcutsButton2").Model.HelpText = str2 oDlgSysConfig.getControl("ShortcutsButton3").Model.HelpText = str2 oDlgSysConfig.getControl("NumberedEquationsFrame").Model.Label = _("Numbered Equations") oDlgSysConfig.getControl("CompatibilityFrame").Model.Label = _("Compatibility") oDlgSysConfig.getControl("VertAlign").Model.Label = _("Vertical alignment for Word export") oDlgSysConfig.getControl("VertAlign").Model.HelpText = _("Improve vertical alignment of Writer equations for Word export") oDlgSysConfig.getControl("BreakBeforeNumCheck").Model.Label = _("Paragraph break before numbered equations") oDlgSysConfig.getControl("BreakBeforeNumCheck").Model.HelpText = _("Add a paragraph break before numbered equations") oDlgSysConfig.getControl("BreakAfterNumCheck").Model.Label = _("Paragraph break after numbered equations") oDlgSysConfig.getControl("BreakAfterNumCheck").Model.HelpText = _("Add a paragraph break after numbered equations") oDlgSysConfig.getControl("CaptionLabel").Model.Label = _("Equation Caption") oDlgSysConfig.getControl("CaptionTextField").Model.HelpText = _("Display text before equation number (leave blank if no text desired)") Dim msg as String msg = _("The TexMaths macro uses some external programs to generate the equation images. Enter below the paths of the folders that contain these programs. Note that only one of the dvisvgm or dvipng programs is required to generate equation images.") ' Windows If getGUIType() = 1 Then oDlgSysConfig.getControl("Description").setText( msg & chr(10) & chr(10) &_ _("Ex: For a standard MiKTeX 2.9 install on Windows, enter the following path into the latex.exe field:") & chr(10) &_ "C:\Program Files\MiKTeX 2.9\miktex\bin") oDlgSysConfig.getControl("LatexLabel").setText( _("latex.exe (mandatory)") ) oDlgSysConfig.getControl("DvipngLabel").setText( _("dvipng.exe (optional)") ) oDlgSysConfig.getControl("DvisvgmLabel").setText( _("dvisvgm.exe (optional)") ) oDlgSysConfig.getControl("CompatibilityFrame").Model.Height = 34 ' Linux or Mac OS X Else ' Mac OS X If GetUname() = "Darwin" Then oDlgSysConfig.getControl("Description").setText( msg & chr(10) & chr(10) &_ _("Ex: For a standard LaTeX install on Mac OS, enter the following path into the latex field:") & chr(10) &_ "/usr/texbin") oDlgSysConfig.getControl("LatexLabel").setText( _("latex (mandatory)") ) oDlgSysConfig.getControl("DvipngLabel").setText( _("dvipng (optional)") ) oDlgSysConfig.getControl("DvisvgmLabel").setText( _("dvisvgm (optional)") ) ' Linux Else oDlgSysConfig.getControl("Description").setText( msg & chr(10) & chr(10) &_ _("Ex: For a standard LaTeX install on Linux, enter the following path into the latex field:") & chr(10) &_ "/usr/bin") oDlgSysConfig.getControl("LatexLabel").setText( _("latex (mandatory)") ) oDlgSysConfig.getControl("DvipngLabel").setText( _("dvipng (optional)") ) oDlgSysConfig.getControl("DvisvgmLabel").setText( _("dvisvgm (optional)") ) End If End If ' Fill the path values from the registry Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess("/ooo.ext.texmaths.Registry/SystemInfo", TRUE) oDlgSysConfig.getControl("LatexPath").setText(ConvertFromURL(oSystemInfo.LatexPath)) oDlgSysConfig.getControl("DvipngPath").setText(ConvertFromURL(oSystemInfo.DvipngPath)) oDlgSysConfig.getControl("DvisvgmPath").setText(ConvertFromURL(oSystemInfo.DvisvgmPath)) ' Set the break before num and break after num options If oSystemInfo.BreakBeforeNum = "TRUE" Then oDlgSysConfig.getControl("BreakBeforeNumCheck").setState(1) Else oDlgSysConfig.getControl("BreakBeforeNumCheck").setState(0) End If If oSystemInfo.BreakAfterNum = "TRUE" Then oDlgSysConfig.getControl("BreakAfterNumCheck").setState(1) Else oDlgSysConfig.getControl("BreakAfterNumCheck").setState(0) End If ' Set the equation caption oDlgSysConfig.getControl("CaptionTextField").setText(oSystemInfo.EquationCaption) ' Set the caption alignment If oSystemInfo.CaptionLeftAlign = "TRUE" Then oDlgSysConfig.getControl("LeftAlignRadio").setState(1) oDlgSysConfig.getControl("RightAlignRadio").setState(0) Else oDlgSysConfig.getControl("LeftAlignRadio").setState(0) oDlgSysConfig.getControl("RightAlignRadio").setState(1) End If ' Set the vertical alignment compatibility option If oSystemInfo.WordVertAlign = "TRUE" Then oDlgSysConfig.getControl("VertAlign").setState(1) Else oDlgSysConfig.getControl("VertAlign").setState(0) End If ' Set the numbering level oDlgSysConfig.getControl("NumLevel").setText(oSystemInfo.NumLevel) ' Set the shortcuts Dim iKey1 as Integer, iKey2 as Integer, iKey3 as Integer, iKey4 as Integer iKey1 = oSystemInfo.EqWriterKey If iKey1 <> 0 Then oDlgSysConfig.getControl("Key1").setText(Chr(iKey1-447)) Else oDlgSysConfig.getControl("Key1").setText("") iKey2 = oSystemInfo.EqImpressKey If iKey2 <> 0 Then oDlgSysConfig.getControl("Key2").setText(Chr(iKey2-447)) Else oDlgSysConfig.getControl("Key2").setText("") iKey3 = oSystemInfo.EqDrawKey If iKey3 <> 0 Then oDlgSysConfig.getControl("Key3").setText(Chr(iKey3-447)) Else oDlgSysConfig.getControl("Key3").setText("") iKey4 = oSystemInfo.NumEqWriterKey If iKey4 <> 0 Then oDlgSysConfig.getControl("Key4").setText(Chr(iKey4-447)) Else oDlgSysConfig.getControl("Key4").setText("") ' Check if same Equations shortcuts for all apps If iKey1 = iKey2 and iKey1 = iKey3 Then oDlgSysConfig.getControl("SameShortcutKey").setState(1) SetEquationsShortcutControl(FALSE) Else oDlgSysConfig.getControl("SameShortcutKey").setState(0) SetEquationsShortcutControl(TRUE) End If ' Set the state of the tab buttons oDlgSysConfig.getControl("PathsButton1").Model.State=1 oDlgSysConfig.getControl("OptionsButton1").Model.State=0 oDlgSysConfig.getControl("ShortcutsButton1").Model.State=0 oDlgSysConfig.Model.Step = 1 ' Show the dialog window oDlgSysConfig.Execute() End Sub ' Paths tab button was pressed Sub PathsButtonPressed(oEvent as Variant) ' Change the state of the tab buttons Dim oDialog as Variant oDialog = oEvent.Source.Context.View oDialog.getControl("PathsButton1").Model.State=1 oDialog.getControl("OptionsButton1").Model.State=0 oDialog.getControl("ShortcutsButton1").Model.State=0 oDialog.Model.Step = 1 End Sub ' Options tab button was pressed Sub OptionsButtonPressed(oEvent as Variant) ' Change the state of the tab buttons Dim oDialog as Variant oDialog = oEvent.Source.Context.View oDialog.getControl("PathsButton2").Model.State=0 oDialog.getControl("OptionsButton2").Model.State=1 oDialog.getControl("ShortcutsButton2").Model.State=0 oDialog.Model.Step = 2 End Sub ' Shortcut tab button was pressed Sub ShortcutsButtonPressed(oEvent as Variant) ' Change the state of the tab buttons Dim oDialog as Variant oDialog = oEvent.Source.Context.View oDialog.getControl("PathsButton3").Model.State=0 oDialog.getControl("OptionsButton3").Model.State=0 oDialog.getControl("ShortcutsButton3").Model.State=1 oDialog.Model.Step = 3 ' Refresh items related to the shortcut check box If oDlgSysConfig.getControl("SameShortcutKey").getState() Then SetEquationsShortcutControl(FALSE) Else SetEquationsShortcutControl(TRUE) End If End Sub ' Test the existence of the different external programs in the paths saved in the registry Sub CheckProgramPaths Dim str0 as String, str1 as String, str2 as String, str3 as String, str4 as String Dim pgm1 as String, pgm2 as String, pgm3 as String Dim prevLatexPath as String, prevDvipngPath as String, prevDviSvgmPath as String Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' All systems str1 = _("Please configure first TexMaths before using it...") str2 = _("Can't find the external program ") str3 = _("Please check the paths in your TexMaths system configuration...") str4 = _("Can't find at least one of the external programs ") ' Windows If getGUIType() = 1 Then pgm1 = "latex.exe" pgm2 = "dvipng.exe" pgm3 = "dvisvgm.exe" ' Linux or MacOSX Else pgm1 = "latex" pgm2 = "dvipng" pgm3 = "dvisvgm" End If ' Initial values of the external program paths prevLatexPath = oSystemInfo.LatexPath prevDvipngPath = oSystemInfo.DvipngPath prevDvisvgmPath = oSystemInfo.DvisvgmPath ' If program paths are empty, check if programs are in the system path If oSystemInfo.LatexPath = "" Then oSystemInfo.LatexPath = ReadPgmPath( pgm1 ) If oSystemInfo.DvipngPath = "" Then oSystemInfo.DvipngPath = ReadPgmPath( pgm2 ) If oSystemInfo.DvisvgmPath = "" Then oSystemInfo.DvisvgmPath = ReadPgmPath( pgm3 ) ' If the paths changed, save the registry, recreate the script and set default preferences If oSystemInfo.LatexPath <> prevLatexPath Or oSystemInfo.DvipngPath <> prevDvipngPath Or oSystemInfo.DvisvgmPath <> prevDvisvgmPath Then oSystemInfo.commitChanges() WriteScript(oSystemInfo.LatexPath, oSystemInfo.DvipngPath, oSystemInfo.DvisvgmPath) DefaultPrefs() End If ' Latex program doesn't exist If Not FileExists(oSystemInfo.LatexPath & pgm1) Then ProgramNotFound(str2 & pgm1 & chr(10) & str3) ' Read again the registry because it may have changed oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' Both dvipng and dvisvgm programs don't exist If Not FileExists(oSystemInfo.DvipngPath & pgm2) And Not FileExists(oSystemInfo.DvisvgmPath & pgm3) Then ProgramNotFound(str4 & pgm2 & _(" or ") & pgm3 & chr(10) & str3) ' Programs still don't exist => stop If Not FileExists(oSystemInfo.LatexPath & pgm1) Or ( Not FileExists(oSystemInfo.DvipngPath & pgm2) And Not FileExists(oSystemInfo.DvisvgmPath & pgm3) ) Then Stop ' Script doesn't exist If Not FileExists(GetScriptPath()) Then WriteScript(oSystemInfo.LatexPath, oSystemInfo.DvipngPath, oSystemInfo.DvisvgmPath) ' Flag to say config was saved If oSystemInfo.ConfigSaved = "" Then oSystemInfo.ConfigSaved = "TRUE" ' Save the registry oSystemInfo.commitChanges() End Sub ' Display an appropriate 'Program not found' message ' and launch the config dialog Sub ProgramNotFound(message as String) MsgBox(message) SysConfigDialog() End Sub ' Exit dialog Sub QuitSysConfig() oDlgSysConfig.endExecute() end sub Sub SetEquationsShortcutControl( b as Boolean ) oDlgSysConfig.getControl("AllFrame").Visible = Not b oDlgSysConfig.getControl("WriterFrame").Visible = b oDlgSysConfig.getControl("ImpressFrame").Visible = b oDlgSysConfig.getControl("DrawFrame").Visible = b oDlgSysConfig.getControl("Ctrl2Label").Visible = b oDlgSysConfig.getControl("Ctrl3Label").Visible = b oDlgSysConfig.getControl("Key2").Visible = b oDlgSysConfig.getControl("Key3").Visible = b End Sub Sub SameShortcutKeyChanged() If oDlgSysConfig.getControl("SameShortcutKey").getState() Then SetEquationsShortcutControl(FALSE) Else SetEquationsShortcutControl(TRUE) End If End Sub ' Save configuration Sub SaveSysConfig() Dim sKey1 as String, sKey2 as String, sKey3 as String, sKey4 as String sKey1 = oDlgSysConfig.getControl("Key1").getText() If oDlgSysConfig.getControl("SameShortcutKey").getState() Then sKey2 = sKey1 sKey3 = sKey1 Else sKey2 = oDlgSysConfig.getControl("Key2").getText() sKey3 = oDlgSysConfig.getControl("Key3").getText() End If If sKey1 = " " or sKey1 = "" Then RemoveShortcut( "EqWriter" ) ElseIf TestKey(sKey1) <> 0 Then SetShortcut( TestKey(sKey1), sKey1, "EqWriter") Else Exit Sub End If If sKey2 = " " or sKey2 = "" Then RemoveShortcut( "EqImpress" ) ElseIf TestKey(sKey2) <> 0 Then SetShortcut( TestKey(sKey2), sKey2, "EqImpress") Else Exit Sub End If If sKey3 = " " or sKey3 = "" Then RemoveShortcut( "EqDraw" ) ElseIf TestKey(sKey3) <> 0 Then SetShortcut( TestKey(sKey3), sKey3, "EqDraw") Else Exit Sub End If sKey4 = oDlgSysConfig.getControl("Key4").getText() If sKey4 = " " or sKey4 = "" Then RemoveShortcut( "NumEqWriter" ) ElseIf TestKey(sKey4) <> 0 Then ' Check if shortcuts are equal If (TestKey(sKey4) = TestKey(sKey1)) Or (TestKey(sKey4) = TestKey(sKey2)) Or (TestKey(sKey4) = TestKey(sKey3)) Then MsgBox(_("Shortcuts assigned to the Equations and NumberedEquations modules must be different!") & chr(10) &_ _("Please check your shortcuts...") ) Exit Sub End If SetShortcut( TestKey(sKey4), sKey4, "NumEqWriter") Else Exit Sub End If ' Create the TexMaths script ' Get the variables from the sysconfig dialog Dim sLatexPath as String, sDvipngPath as String, sDvisvgmPath as String Dim oFileAccess as Variant sLatexPath = ConvertToURL(oDlgSysConfig.getControl("LatexPath").getText()) sDvipngPath = ConvertToURL(oDlgSysConfig.getControl("DvipngPath").getText()) sDvisvgmPath = ConvertToURL(oDlgSysConfig.getControl("DvisvgmPath").getText()) If sLatexPath = "" Then MsgBox _("Please set the latex path...") Exit Sub End If If sDvipngPath = "" and sDvisvgmPath = "" Then MsgBox _("Please set at least one dvipng path or the dvisvgm path...") Exit Sub End If ' Add a / at the end if necessary sLatexPath = CheckPath(sLatexPath) If sDvipngPath <> "" Then sDvipngPath = CheckPath(sDvipngPath) If sDvisvgmPath <> "" Then sDvisvgmPath = CheckPath(sDvisvgmPath) ' Windows If getGUIType() = 1 Then If CheckFile( sLatexPath & "latex.exe", _("The program latex.exe is not located in ") & ConvertFromURL(sLatexPath) ) Then Exit Sub If sDvipngPath <> "" Then If CheckFile( sDvipngPath & "dvipng.exe", _("The program dvipng.exe is not located in ") & ConvertFromURL(sDvipngPath) ) Then Exit Sub End If If sDvisvgmPath <> "" Then If CheckFile( sDvisvgmPath & "dvisvgm.exe", _("The program dvisvgm.exe is not located in ") & ConvertFromURL(sDvisvgmPath) ) Then Exit Sub End If ' Linux or MacOSX Else If CheckFile( sLatexPath & "latex", _("The program latex is not located in ") & ConvertFromURL(sLatexPath) ) Then Exit Sub If sDvipngPath <> "" Then If CheckFile(sDvipngPath & "dvipng", _("The program dvipng is not located in ") & ConvertFromURL(sDvipngPath) ) Then Exit Sub End If If sDvisvgmPath <> "" Then If CheckFile( sDvisvgmPath & "dvisvgm", _("The program dvisvgm is not located in ") & ConvertFromURL(sDvisvgmPath) ) Then Exit Sub End If End If ' Open service file and an output stream Dim cURL as String oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") cURL = ConvertToURL( GetScriptPath() ) ' Get the path saved in the registry Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) If sLatexPath <> oSystemInfo.LatexPath _ or sDvipngPath <> oSystemInfo.DvipngPath _ or sDvisvgmPath <> oSystemInfo.DvisvgmPath _ or Not oFileAccess.exists(cURL) Then WriteScript(sLatexPath, sDvipngPath, sDvisvgmPath) End If oDlgSysConfig.endExecute() ' Set vertical alignment compatibility option If oDlgSysConfig.getControl("VertAlign").getState() Then oSystemInfo.WordVertAlign = "TRUE" Else oSystemInfo.WordVertAlign = "FALSE" ' Set caption alignment If oDlgSysConfig.getControl("LeftAlignRadio").getState() Then oSystemInfo.CaptionLeftAlign = "TRUE" Else oSystemInfo.CaptionLeftAlign = "FALSE" ' Set break before num and break after num options If oDlgSysConfig.getControl("BreakBeforeNumCheck").getState() Then oSystemInfo.BreakBeforeNum = "TRUE" Else oSystemInfo.BreakBeforeNum = "FALSE" If oDlgSysConfig.getControl("BreakAfterNumCheck").getState() Then oSystemInfo.BreakAfterNum = "TRUE" Else oSystemInfo.BreakAfterNum = "FALSE" ' Set equation caption oSystemInfo.EquationCaption = oDlgSysConfig.getControl("CaptionTextField").getText() ' Set numbering level oSystemInfo.NumLevel = oDlgSysConfig.getControl("NumLevel").getText() ' Config was saved oSystemInfo.ConfigSaved = "TRUE" oSystemInfo.commitChanges() ' Set configuration in case we were called by TexMathsEquations TexMathsEquations.SetConfig() End Sub ' Test shortcut validity Function TestKey(sKey as String) as Integer If sKey = "" Then TestKey() = 0 Else Dim i as Integer i = Asc(sKey) If 96 < i and i < 123 Then TestKey() = i + 415 ElseIf 64 < i and i < 91 Then TestKey() = i + 447 ElseIf sKey <> " " Then MsgBox( _("Only characters from A to Z are allowed for shortcuts!") ) TestKey() = 0 End If End If End Function ' Add shortcut to the registry Sub SetShortcut(iKey as Integer, sKey as String, sRegId) Dim sNewCommand as String, sCommand as String, sModule as String, sDoc as String ' Retrieve the module configuration manager from central module configuration manager supplier Dim oModuleCfgMgrSupplier as Variant oModuleCfgMgrSupplier = createUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier") ' Retrieve the module configuration manager based on the registry identifier Dim oModuleCfgMgr as Variant If sRegId = "EqWriter" or sRegId = "NumEqWriter" Then ' Writer installed If ComponentInstalled( "Writer" ) Then sDoc = "Writer" oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.text.TextDocument") ' Writer not installed Else Exit Sub End If ElseIf sRegId = "EqImpress" Then ' Impress installed If ComponentInstalled( "Impress" ) Then sDoc = "Impress" oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.presentation.PresentationDocument") ' Impress not installed Else Exit Sub End If ElseIf sRegId = "EqDraw" Then ' Draw installation was already checked in Main() sDoc = "Draw" oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.drawing.DrawingDocument") End If Dim oShortcutMgr as Variant oShortcutMgr = oModuleCfgMgr.getShortcutManager Dim aKeyEvent as New com.sun.star.awt.KeyEvent With aKeyEvent .Modifiers = com.sun.star.awt.KeyModifier.MOD1 .KeyCode = iKey ' com.sun.star.awt.Key.E End With ' Get the actual command for the shortcut "iKey" On Error Resume Next sCommand = oShortcutMgr.getCommandByKeyEvent(aKeyEvent) On Error GoTo 0 ' Restore the error handler ' Set the TexMaths module name If sRegId = "NumEqWriter" Then sModule = "NumberedEquations" Else sModule = "Equations" End If ' Set the new command for the appropriate TexMaths module (Equations or NumberedEquations) sNewCommand = "vnd.sun.star.script:TexMaths.TexMaths" & sModule & ".main?language=Basic&location=application" ' Get the shortcut repository Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo" , TRUE) If len(sCommand) = 0 Then ' New command ' Restore the previous shortcut command If (sRegId = "EqWriter" And oSystemInfo.EqWriterKey > 0)_ Or (sRegId = "NumEqWriter" And oSystemInfo.NumEqWriterKey > 0)_ Or (sRegId = "EqImpress" And oSystemInfo.EqImpressKey > 0)_ Or (sRegId = "EqDraw" And oSystemInfo.EqDrawKey > 0) Then RemoveShortcut( sRegId ) End If oShortcutMgr.setKeyEvent( aKeyEvent, sNewCommand ) oShortcutMgr.store ' Store the current command If (sRegId = "EqWriter") Then oSystemInfo.EqWriterCmd = "" ElseIf (sRegId = "NumEqWriter") Then oSystemInfo.NumEqWriterCmd = "" ElseIf (sRegId = "EqImpress") Then oSystemInfo.EqImpressCmd = "" ElseIf (sRegId = "EqDraw") Then oSystemInfo.EqDrawCmd = "" End If ElseIf sCommand <> sNewCommand Then ' The key event is already used by another command Dim sMsg as String sMsg = sDoc & Chr(10) & Chr(10) sMsg = sMsg & _("The key combination CTRL + ") & sKey & _(" is already assigned to the command ") & "'" & sCommand & "'" & Chr(10) & Chr(10) sMsg = sMsg & _("Do you want to set the command") & " TexMaths" & sModule & ".main ?" Dim iMsgResult as Variant iMsgResult = MsgBox( sMsg, 1) If iMsgResult <> 1 Then Exit Sub ' Remove the previous shortcut command If (sRegId = "EqWriter" And oSystemInfo.EqWriterKey > 0)_ Or (sRegId = "NumEqWriter" And oSystemInfo.NumEqWriterKey > 0)_ Or (sRegId = "EqImpress" And oSystemInfo.EqImpressKey > 0)_ Or (sRegId = "EqDraw" And oSystemInfo.EqDrawKey > 0) Then RemoveShortcut( sRegId ) End If oShortcutMgr.removeKeyEvent(aKeyEvent) oShortcutMgr.setKeyEvent(aKeyEvent, sNewCommand ) oShortcutMgr.store ' Store the current command If sRegId = "EqWriter" Then oSystemInfo.EqWriterCmd = sCommand ElseIf sRegId = "NumEqWriter" Then oSystemInfo.NumEqWriterCmd = sCommand ElseIf sRegId = "EqImpress" Then oSystemInfo.EqImpressCmd = sCommand ElseIf sRegId = "EqDraw" Then oSystemInfo.EqDrawCmd = sCommand End If Else ' Same command ' Commmand previously set outside TexMaths => put it at spaces If (sRegId = "EqWriter" And oSystemInfo.EqWriterCmd = sCommand)_ Or (sRegId = "NumEqWriter" And oSystemInfo.NumEqWriterCmd = sCommand)_ Or (sRegId = "EqImpress" And oSystemInfo.EqImpressCmd = sCommand)_ Or (sRegId = "EqDraw" And oSystemInfo.EqDrawCmd = sCommand) Then sCommand = "" End If End if ' Save to the registry the new shortcut with the previous command If sRegId = "EqWriter" Then oSystemInfo.EqWriterKey = iKey ElseIf sRegId = "NumEqWriter" Then oSystemInfo.NumEqWriterKey = iKey ElseIf sRegId = "EqImpress" Then oSystemInfo.EqImpressKey = iKey ElseIf sRegId = "EqDraw" Then oSystemInfo.EqDrawKey = iKey End If oSystemInfo.commitChanges() End Sub ' Remove shortcut from the registry Sub RemoveShortcut(sRegId as String) Dim iKey as Integer Dim sCommand as String, sPrevCommand as String, sDoc as String ' Get the current shortcut and previous command from the registry Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo/", TRUE) If sRegId = "EqWriter" Then iKey = oSystemInfo.EqWriterKey sPrevCommand = oSystemInfo.EqWriterCmd oSystemInfo.EqWriterKey = "" oSystemInfo.EqWriterCmd = "" sDoc = "Writer" ElseIf sRegId = "NumEqWriter" Then iKey = oSystemInfo.NumEqWriterKey sPrevCommand = oSystemInfo.NumEqWriterCmd oSystemInfo.NumEqWriterKey = "" oSystemInfo.NumEqWriterCmd = "" sDoc = "Writer" ElseIf sRegId = "EqImpress" Then iKey = oSystemInfo.EqImpressKey sPrevCommand = oSystemInfo.EqImpressCmd oSystemInfo.EqImpressKey = "" oSystemInfo.EqImpressCmd = "" sDoc = "Impress" ElseIf sRegId = "EqDraw" Then iKey = oSystemInfo.EqDrawKey sPrevCommand = oSystemInfo.EqDrawCmd oSystemInfo.EqDrawKey = "" oSystemInfo.EqDrawCmd = "" sDoc = "Draw" End If ' If no shortcut defined in the registry => exit sub If iKey = 0 or iKey = "" Then Exit Sub ' Retrieve the module configuration manager from central module configuration manager supplier Dim oModuleCfgMgrSupplier as Variant oModuleCfgMgrSupplier = createUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier") ' Retrieve the module configuration manager with module identifier Dim oModuleCfgMgr as Variant If sDoc = "Writer" Then ' Writer installed If ComponentInstalled( "Writer" ) Then oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.text.TextDocument") ' Writer not installed Else Exit Sub End If ElseIf sDoc = "Impress" Then ' Impress installed If ComponentInstalled( "Impress" ) Then oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.presentation.PresentationDocument") ' Impress not installed Else Exit Sub End If ElseIf sDoc = "Draw" Then ' Draw installation was already checked in Main() oModuleCfgMgr = oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.drawing.DrawingDocument") End If Dim oShortcutMgr as Variant oShortcutMgr = oModuleCfgMgr.getShortcutManager Dim aKeyEvent as New com.sun.star.awt.KeyEvent With aKeyEvent .Modifiers = com.sun.star.awt.KeyModifier.MOD1 .KeyCode = iKey End With On Error Resume Next sCommand = oShortcutMgr.getCommandByKeyEvent(aKeyEvent) On Error GoTo 0 ' Restore the error handler ' Remove the current shortcut If len(sCommand) <> 0 Then oShortcutMgr.removeKeyEvent(aKeyEvent) oShortcutMgr.store End If ' Set the previous shortcut If len(sPrevCommand) <> 0 Then oShortcutMgr.setKeyEvent( aKeyEvent, sPrevCommand ) oShortcutMgr.store End If ' Save change in the registry oSystemInfo.commitChanges() End Sub ' Create the TexMaths script depending on the system ' Note : on Windows, the Shell() command is buggy and does not work correctly ' if the script path contains spaces. As a workaround, we put the script in a ' directory named C:\texmaths-<username_without_spaces> and we set it as a ' hidden directory Sub WriteScript(sLatexPath as String, sDvipngPath as String, sDvisvgmPath as String) Dim cURL as String, sPaths as String, sTexMaths as String Dim sDvipngCmd as String, sDvisvgmCmd as String ' Save the paths to the registry Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) oSystemInfo.LatexPath = sLatexPath oSystemInfo.DvipngPath = sDvipngPath oSystemInfo.DvisvgmPath = sDvisvgmPath oSystemInfo.commitChanges() ' Open service file and an output stream Dim oFileAccess as Variant, oTextStream as Variant oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") oTextStream = createUnoService("com.sun.star.io.TextOutputStream") ' Generate the TexMaths script in the appropriate directory cURL = ConvertToURL( GetScriptPath() ) If oFileAccess.exists( cURL ) Then oFileAccess.kill( cURL ) ' => Windows: generate a .bat script If getGUIType() = 1 Then ' Paths sPaths = "set PATH=" & ConvertFromURL(sLatexPath) & ";" & ConvertFromURL(sDvipngPath) & ";" & ConvertFromURL(sDvisvgmPath) & ";%PATH%" & chr(10) ' Script If sDvipngPath = "" Then sDvipngCmd = "" Else sDvipngCmd = "rem Conversion of the DVI file to a PNG image" & chr(10) &_ "if ""%EXT%"" == ""png"" (" & chr(10) &_ "if ""%TRANS%"" == ""TRUE"" (" & chr(10) &_ " dvipng -q -T tight -bg Transparent --width --height --depth -D %DPI% -o %FILENAME%.png %FILENAME%.dvi > %FILENAME%.dat" & chr(10) &_ ") else (" & chr(10) &_ " dvipng -q -T tight --width --height --depth -D %DPI% -o %FILENAME%.png %FILENAME%.dvi > %FILENAME%.dat" & chr(10) &_ ")" & chr(10) &_ ")" & chr(10) End If If sDvisvgmPath = "" Then sDvisvgmCmd = "" Else sDvisvgmCmd = "rem Conversion of the DVI file to a SVG image" & chr(10) &_ "if ""%EXT%"" == ""svg"" (" & chr(10) &_ " dvisvgm -n1 %FILENAME%.dvi 2> %FILENAME%.dat" & chr(10) &_ ")" & chr(10) End If sTexMaths = "@echo off" & chr(10) &_ chr(10) &_ "rem This script is part of the TexMaths package" & chr(10) &_ "rem http://roland65.free.fr/texmaths" & chr(10) &_ "rem" & chr(10) &_ "rem Roland Baudin (roland65@free.fr)" & chr(10) &_ chr(10) &_ "rem Process the options" & chr(10) &_ "set EXT=%1" & chr(10) &_ "set DPI=%2" & chr(10) &_ "set TRANS=%3" & chr(10) &_ "set TMPPATH=%4" & chr(10) &_ "set FILENAME=tmpfile" & chr(10) &_ chr(10) &_ "rem Set Paths" & chr(10) &_ sPaths & chr(10) &_ "rem Generate system log" & chr(10) &_ "call :SystemLog" & chr(10) &_ chr(10) &_ "rem Go to the tmp directory" & chr(10) &_ "if not %TMPPATH% == """" (" & chr(10) &_ " if not exist %TMPPATH% (" & chr(10) &_ " mkdir %TMPPATH%" & chr(10) &_ " )" & chr(10) &_ " cd /D %TMPPATH%" & chr(10) &_ ")" & chr(10) &_ chr(10) &_ "rem Remove old files but not the tex file" & chr(10) &_ "del /Q *.aux" & chr(10) &_ "del /Q *.bsl" & chr(10) &_ "del /Q *.dvi" & chr(10) &_ "del /Q *.log" & chr(10) &_ "del /Q *.out" & chr(10) &_ "del /Q *.dat" & chr(10) &_ "del /Q *.png" & chr(10) &_ "del /Q *.svg" & chr(10) &_ chr(10) &_ "rem Creation of the DVI file" & chr(10) &_ "latex -shell-escape -interaction=nonstopmode %FILENAME%.tex > %FILENAME%.out" & chr(10) &_ chr(10) &_ sDvisvgmCmd & chr(10) &_ sDvipngCmd & chr(10) &_ chr(10) &_ "Goto :EOF"& chr(10) &_ chr(10) &_ "rem Function used to generate system log" & chr(10) &_ ":SystemLog" & chr(10) &_ chr(10) &_ "set SYSLOG=%TMPPATH%\..\System.log" & chr(10) &_ "rem del %SYSLOG%" & chr(10) &_ "for /f ""tokens=*"" %%a in ('VER') do set VERSION=%%a" & chr(10) &_ "echo osType= %VERSION% > %SYSLOG%" & chr(10) &_ "echo. >> %SYSLOG%" & chr(10) &_ "echo PATH= %PATH% >> %SYSLOG%" & chr(10) &_ chr(10) &_ "Goto :EOF" ' => Linux or MacOSX: generate a shell script Else ' Paths sPaths = "cpu=$(uname -p)" & chr(10) &_ "mac=$(uname -m)" & chr(10) &_ "sys=$(uname -s)" & chr(10) &_ "[ ""$cpu"" = ""powerpc"" -o ""$mac"" = ""ppc"" ] && cpuType=ppc || cpuType=i386 " & chr(10) &_ "[ ""$sys"" = ""Darwin"" ] && osType=MacOSX || osType=Linux " & chr(10) &_ "UserDir=""" & ConvertFromURL(glb_sUserPath) & """" & chr(10) &_ "PkgDir=""" & ConvertFromURL(glb_sPkgPath) & """" & chr(10) &_ chr(10) &_ "PATH=""${PkgDir}bin/${osType}${cpuType}:$PATH""" & chr(10) &_ "PATH=""" & ConvertFromURL(sLatexPath) & ":" & ConvertFromURL(sDvipngPath) & ":" & ConvertFromURL(sDvisvgmPath) & ":$PATH""" & chr(10) &_ "export PATH" & chr(10) &_ chr(10) &_ "if [ ""$osType"" = ""MacOSX"" ]" & chr(10) &_ "then" & chr(10) &_ " DYLD_LIBRARY_PATH=""${PkgDir}lib/${cpuType}/""" & chr(10) &_ " export DYLD_LIBRARY_PATH" & chr(10) &_ "else" & chr(10) &_ " LD_LIBRARY_PATH=""${PkgDir}lib/${cpuType}/""" & chr(10) &_ " export LD_LIBRARY_PATH" & chr(10) &_ "fi" & chr(10) ' Script If sDvipngPath = "" Then sDvipngCmd = "" Else sDvipngCmd = "# Conversion of the DVI file to a PNG image" & chr(10) &_ "if [ -f ${filename}.dvi ]" & chr(10) &_ "then" & chr(10) &_ "if [ ""${ext}"" = ""png"" ]" & chr(10) &_ "then" & chr(10) &_ "if [ ""${Trans}"" = ""TRUE"" ]" & chr(10) &_ "then" & chr(10) &_ " dvipng -q -T tight -bg Transparent --width --height --depth -D ${dpi} -o ${filename}.png ${filename}.dvi > ${filename}.dat" & chr(10) &_ "else" & chr(10) &_ " dvipng -q -T tight --width --height --depth -D ${dpi} -o ${filename}.png ${filename}.dvi > ${filename}.dat" & chr(10) &_ "fi" & chr(10) &_ "fi" & chr(10) &_ "fi" End If If sDvisvgmPath = "" Then sDvisvgmCmd = "" Else sDvisvgmCmd = "# Conversion of the DVI file to a SVG image" & chr(10) &_ "if [ -f ${filename}.dvi ]" & chr(10) &_ "then" & chr(10) &_ "if [ ""${ext}"" = ""svg"" ]" & chr(10) &_ "then" & chr(10) &_ " dvisvgm -n1 ${filename}.dvi &> ${filename}.dat" & chr(10) &_ "fi" & chr(10) &_ "fi" End If sTexMaths = "#!/bin/bash" & chr(10) &_ "#" & chr(10) &_ "# This script is part of the TexMaths package" & chr(10) &_ "# http://roland65.free.fr/texmaths" & chr(10) &_ "#" & chr(10) &_ "# Roland Baudin (roland65@free.fr)" & chr(10) &_ chr(10) &_ "# Function used to generate system log" & chr(10) &_ "SystemLog(){" & chr(10) &_ "syslog=${UserDir}System.log" & chr(10) &_ "uname -a > $syslog" & chr(10) &_ "echo """" >> $syslog" & chr(10) &_ "echo ""osType=$osType"" >> $syslog" & chr(10) &_ "echo ""cpuType=$cpuType"" >> $syslog" & chr(10) &_ "echo """" >> $syslog" & chr(10) &_ "echo ""PATH=$PATH"" >> $syslog" & chr(10) &_ "echo """" >> $syslog" & chr(10) &_ "echo ""LD_LIBRARY_PATH=$LD_LIBRARY_PATH"" >> $syslog" & chr(10) &_ "echo ""DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"" >> $syslog" & chr(10) &_ "}" & chr(10) &_ chr(10) &_ "# Definition of PATH and binary paths" & chr(10) &_ sPaths & chr(10) &_ "# Process the options" & chr(10) &_ "ext=$1" & chr(10) &_ "dpi=$2" & chr(10) &_ "Trans=""$3""" & chr(10) &_ "tmpPath=""$4""" & chr(10) &_ "filename=tmpfile" & chr(10) &_ chr(10) &_ "# Generate system log" & chr(10) &_ "SystemLog" & chr(10) &_ chr(10) &_ "# Go to the tmp directory" & chr(10) &_ "if [ ""$tmpPath"" != """" ] " & chr(10) &_ "then" & chr(10) &_ " [ ! -d ""$tmpPath"" ] && mkdir -p ""$tmpPath""" & chr(10) &_ " cd ""$tmpPath""" & chr(10) &_ "fi" & chr(10) &_ chr(10) &_ "# Remove old files but not the tex file" & chr(10) &_ "rm ${filename}.{dvi,out,bsl,dat,log,aux,png,svg} &> /dev/null" & chr(10) &_ chr(10) &_ "# Creation of the DVI file" & chr(10) &_ "latex -shell-escape -interaction=nonstopmode ${filename}.tex > ${filename}.out" & chr(10) &_ chr(10) &_ sDvisvgmCmd & chr(10) &_ sDvipngCmd & chr(10) End if oTextStream.setOutputStream(oFileAccess.openFileWrite(cURL)) oTextStream.writeString( sTexMaths ) oTextStream.closeOutput() ' On Windows, hide the script file because it is located in C:\ and the user should not see it If getGUIType() = 1 Then SetAttr( GetScriptDir() ,2 ) ' 2 => hidden attribute End If End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsAbout.xba000064440400000001177513206777051027543 0ustar kkremitzkikkremitzki ' ' TexMathsAbout ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to create and manage the About dialog ' Force variable declaration Option Explicit Private oDlgAbout as Variant ' Main subroutine Sub About() DefaultSysConfig() AboutDialog() End Sub ' Create and show dialog Sub AboutDialog() ' Load the library TexMaths DialogLibraries.LoadLibrary("TexMaths") ' Create the dialog object oDlgAbout = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsAbout_GUI") ) ' Load package description, depending on the locale Dim sDescPath as String, sFilePath as String, sMsg as String sDescPath = "help/description." & GetLocale() sFilePath = ConvertToURL( glb_sPkgPath & sDescPath ) If Not FileExists( sFilePath ) Then sDescPath = "help/description.en" sMsg = ReadTextFileUtf8(sDescPath, glb_sPkgPath) sMsg = chr(10) & " TexMaths " & GetVersion() & chr(10) & sMsg oDlgAbout.getControl("TextField").setText(sMsg) ' Dialog strings for translation oDlgAbout.setTitle( _("About TexMaths") ) oDlgAbout.getControl("AboutButton").Model.Label = _("About") oDlgAbout.getControl("AboutButton").Model.HelpText = _("Display application informations") oDlgAbout.getControl("ChangelogButton").Model.HelpText = _("Display application changes") oDlgAbout.getControl("SystemlogButton").Model.HelpText = _("Display system informations") oDlgAbout.getControl("CloseButton").Model.Label = _("Close") oDlgAbout.getControl("CloseButton").Model.HelpText = _("Close window") ' Change button states oDlgAbout.getControl("AboutButton").Model.State=1 oDlgAbout.getControl("ChangelogButton").Model.State=0 oDlgAbout.getControl("SystemlogButton").Model.State=0 ' Show the dialog window oDlgAbout.Execute() End Sub ' Close dialog Sub CloseAbout() oDlgAbout.endExecute() End Sub ' Display about text Sub AboutButton() Dim sDescPath as String, sFilePath as String, sMsg as String sDescPath = "help/description." & GetLocale() sFilePath = ConvertToURL( glb_sPkgPath & sDescPath ) If Not FileExists( sFilePath ) Then sDescPath = "help/description.en" sMsg = ReadTextFileUtf8(sDescPath, glb_sPkgPath) sMsg = chr(10) & " TexMaths " & GetVersion() & chr(10) & sMsg oDlgAbout.getControl("TextField").setText( sMsg ) ' Change button states oDlgAbout.getControl("AboutButton").Model.State=1 oDlgAbout.getControl("ChangelogButton").Model.State=0 oDlgAbout.getControl("SystemlogButton").Model.State=0 End Sub ' Display ChangeLog Sub ChangeLogButton() Dim sMsg as String sMsg = ReadTextFile("ChangeLog", glb_sPkgPath) oDlgAbout.getControl("TextField").setText( sMsg ) ' Disable current button state oDlgAbout.getControl("AboutButton").Model.State=0 oDlgAbout.getControl("ChangelogButton").Model.State=1 oDlgAbout.getControl("SystemlogButton").Model.State=0 End Sub ' Display system log Sub SysLogButton() Dim sMsg as String If Not FileExists( glb_sUserPath & "System.log" ) Then sMsg = _("You have to generate a first equation before the system log can be displayed...") Else sMsg = ReadTextFile("System.log", glb_sUserPath) End If oDlgAbout.getControl("TextField").setText( sMsg ) ' Change button states oDlgAbout.getControl("AboutButton").Model.State=0 oDlgAbout.getControl("ChangelogButton").Model.State=0 oDlgAbout.getControl("SystemlogButton").Model.State=1 End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsRecompileEquations_GUI.xdl000064440400000001100713206777051033006 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsPrefs_Dlg.xba000064440400000004155413206777051030334 0ustar kkremitzkikkremitzki ' ' TexMathsPrefs_Dlg ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to create and manage the Preferences dialog ' Force variable declaration Option Explicit ' Dialog declaration Private oDlgPrefs as Variant ' Create and display dialog Sub PrefsDialog() ' Load the library TexMaths DialogLibraries.LoadLibrary("TexMaths") ' Create the dialog object oDlgPrefs = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsPrefs_GUI") ) ' Set the combo box values oDlgPrefs.getControl("Format").addItems(Array("png","svg"),0) oDlgPrefs.getControl("GraphicDPI").addItems(Array("72","96","120","150","200","300","600","1200"),0) oDlgPrefs.getControl("ImpressSize").addItems(Array("6","7","8","9","10","10.5","11","12","13","14","15","16","18","20","22","24","26","28","32","36","40","44","48","54","60","66","72","80","88","96"),0) oDlgPrefs.getControl("WriterSize").addItems(Array("6","7","8","9","10","10.5","11","12","13","14","15","16","18","20","22","24","26","28","32","36","40","44","48","54","60","66","72","80","88","96"),0) oDlgPrefs.getControl("DrawSize").addItems(Array("6","7","8","9","10","10.5","11","12","13","14","15","16","18","20","22","24","26","28","32","36","40","44","48","54","60","66","72","80","88","96"),0) ' Dialog strings for translation oDlgPrefs.setTitle( _("TexMaths Preferences") ) oDlgPrefs.getControl("ImageFrame").Model.Label = _("Image parameters") oDlgPrefs.getControl("DefaultButton").Model.Label = _("Default") oDlgPrefs.getControl("DefaultButton").Model.HelpText = _("Load default preferences") oDlgPrefs.getControl("LoadButton").Model.Label = _("Load") oDlgPrefs.getControl("LoadButton").Model.HelpText = _("Load saved preferences") oDlgPrefs.getControl("SaveButton").Model.Label = _("Save") oDlgPrefs.getControl("SaveButton").Model.HelpText = _("Apply and save current preferences") oDlgPrefs.getControl("WriterSize").Model.HelpText = _("Writer font size") oDlgPrefs.getControl("ImpressSize").Model.HelpText = _("Impress font size") oDlgPrefs.getControl("DrawSize").Model.HelpText = _("Draw font size") oDlgPrefs.getControl("PointsLabel1").Model.Label = _("points") oDlgPrefs.getControl("PointsLabel2").Model.Label = _("points") oDlgPrefs.getControl("PointsLabel3").Model.Label = _("points") oDlgPrefs.getControl("WriterDisplay").Model.HelpText = _("Inline display equation") oDlgPrefs.getControl("ImpressDisplay").Model.HelpText = _("Inline display equation") oDlgPrefs.getControl("DrawDisplay").Model.HelpText = _("Inline display equation") oDlgPrefs.getControl("WriterInline").Model.HelpText = _("Inline equation") oDlgPrefs.getControl("ImpressInline").Model.HelpText = _("Inline equation") oDlgPrefs.getControl("DrawInline").Model.HelpText = _("Inline equation") oDlgPrefs.getControl("WriterLatex").Model.HelpText = _("Regular LaTeX code") oDlgPrefs.getControl("ImpressLatex").Model.HelpText = _("Regular LaTeX code") oDlgPrefs.getControl("DrawLatex").Model.HelpText = _("Regular LaTeX code") oDlgPrefs.getControl("FormatLabel").Model.Label = _("Format") oDlgPrefs.getControl("Format").Model.HelpText = _("Image format") oDlgPrefs.getControl("GraphicDPI").Model.HelpText = _("Image resolution") oDlgPrefs.getControl("WriterTransparency").Model.Label = _("Transparency") oDlgPrefs.getControl("WriterTransparency").Model.HelpText = _("Toggle image transparency") oDlgPrefs.getControl("ImpressTransparency").Model.Label = _("Transparency") oDlgPrefs.getControl("ImpressTransparency").Model.HelpText = _("Toggle image transparency") oDlgPrefs.getControl("DrawTransparency").Model.Label = _("Transparency") oDlgPrefs.getControl("DrawTransparency").Model.HelpText = _("Toggle image transparency") SetPrefsDialogValues(FALSE) ' Display the dialog, this routine call does not return until the dialog is dismissed oDlgPrefs.Execute() End Sub ' Set dialog values Sub SetPrefsDialogValues(ForceDefault as Boolean) ' The load button is activated if the preferences file exists If FileExists(glb_sUserPath & "TexMaths.cfg" ) Then oDlgPrefs.getControl("LoadButton").setEnable(TRUE) If ForceDefault = FALSE Then ReadPrefsFile() Else DefaultPrefs() Else oDlgPrefs.getControl("LoadButton").setEnable(FALSE) DefaultPrefs() End If ' Image oDlgPrefs.getControl("Format").setText(glb_sFormat) oDlgPrefs.getControl("GraphicDPI").setText(glb_sGraphicDPI) ' Writer preferences If glb_sWriterTransparency = "TRUE" Then oDlgPrefs.getControl("WriterTransparency").setState(1) Else oDlgPrefs.getControl("WriterTransparency").setState(0) End If oDlgPrefs.getControl("WriterSize").setText(glb_sWriterSize) If glb_sWriterEqType = "display" Then oDlgPrefs.getControl("WriterDisplay").setState(1) If glb_sWriterEqType = "inline" Then oDlgPrefs.getControl("WriterInline").setState(1) If glb_sWriterEqType = "latex" Then oDlgPrefs.getControl("WriterLatex").setState(1) ' Impress preferences If glb_sImpressTransparency = "TRUE" Then oDlgPrefs.getControl("ImpressTransparency").setState(1) Else oDlgPrefs.getControl("ImpressTransparency").setState(0) End If oDlgPrefs.getControl("ImpressSize").setText(glb_sImpressSize) If glb_sImpressEqType = "display" Then oDlgPrefs.getControl("ImpressDisplay").setState(1) If glb_sImpressEqType = "inline" Then oDlgPrefs.getControl("ImpressInline").setState(1) If glb_sImpressEqType = "latex" Then oDlgPrefs.getControl("ImpressLatex").setState(1) ' Draw preferences If glb_sDrawTransparency = "TRUE" Then oDlgPrefs.getControl("DrawTransparency").setState(1) Else oDlgPrefs.getControl("DrawTransparency").setState(0) End If oDlgPrefs.getControl("DrawSize").setText(glb_sDrawSize) If glb_sDrawEqType = "display" Then oDlgPrefs.getControl("DrawDisplay").setState(1) If glb_sDrawEqType = "inline" Then oDlgPrefs.getControl("DrawInline").setState(1) If glb_sDrawEqType = "latex" Then oDlgPrefs.getControl("DrawLatex").setState(1) ' Get the dvipng and dvisvgm paths saved in the registry Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' Disable svg and force png if dvisvgm path is empty If oSystemInfo.DvipngPath = "" Then glb_sFormat = "svg" oDlgPrefs.getControl("Format").setText("svg") oDlgPrefs.getControl("Format").setEnable(FALSE) End If ' Disable svg and force png if dvisvgm path is empty If oSystemInfo.DvisvgmPath = "" Then glb_sFormat = "png" oDlgPrefs.getControl("Format").setText("png") oDlgPrefs.getControl("Format").setEnable(FALSE) End If ' Disable dpi if svg file format If glb_sFormat = "svg" Then oDlgPrefs.getControl("GraphicDPI").setEnable(FALSE) Else oDlgPrefs.getControl("GraphicDPI").setEnable(TRUE) End If End Sub ' Set image format and enable or disable dpi according to the image format Sub Format_Mod() glb_sFormat = oDlgPrefs.getControl("Format").getText() If glb_sFormat = "svg" Then oDlgPrefs.getControl("GraphicDPI").setEnable(FALSE) Else oDlgPrefs.getControl("GraphicDPI").setEnable(TRUE) End If End Sub ' Set image dpi Sub Dpi_Mod() glb_sGraphicDPI = oDlgPrefs.getControl("GraphicDPI").getText() End Sub ' Set image transparency in Writer Sub Trans_Mod_Writer() If oDlgPrefs.getControl("WriterTransparency").getState() Then glb_sWriterTransparency = "TRUE" Else glb_sWriterTransparency = "FALSE" End If End Sub ' Set image transparency in Impress Sub Trans_Mod_Impress() If oDlgPrefs.getControl("ImpressTransparency").getState() Then glb_sImpressTransparency = "TRUE" Else glb_sImpressTransparency = "FALSE" End If End Sub ' Set image transparency in Draw Sub Trans_Mod_Draw() If oDlgPrefs.getControl("DrawTransparency").getState() Then glb_sDrawTransparency = "TRUE" Else glb_sDrawTransparency = "FALSE" End If End Sub ' Save preferences button clicked Sub SavePrefsButton_Clicked() ' Apply preferences ApplyPrefs() ' Save preferences and close dialog SavePrefs() oDlgPrefs.endExecute() End Sub ' Load default preferences Sub DefaultPrefsButton_Clicked() ' Load default preferences SetPrefsDialogValues(TRUE) End Sub ' Load preferences Sub LoadPrefsButton_Clicked() ' We arrive here if the file exists ReadPrefsFile() SetPrefsDialogValues(FALSE) End Sub ' Apply preferences Sub ApplyPrefs() ' Set the preferences variables glb_sFormat = oDlgPrefs.getControl("Format").getText() glb_sGraphicDPI = oDlgPrefs.getControl("GraphicDPI").getText() If oDlgPrefs.getControl("WriterTransparency").getState() Then glb_sWriterTransparency = "TRUE" Else glb_sWriterTransparency = "FALSE" End If If oDlgPrefs.getControl("ImpressTransparency").getState() Then glb_sImpressTransparency = "TRUE" Else glb_sImpressTransparency = "FALSE" End If If oDlgPrefs.getControl("DrawTransparency").getState() Then glb_sDrawTransparency = "TRUE" Else glb_sDrawTransparency = "FALSE" End If If glb_sFormat = "svg" Then oDlgMain.getControl("GraphicDPI").setEnable(FALSE) Else oDlgMain.getControl("GraphicDPI").setEnable(TRUE) End If glb_sWriterSize = oDlgPrefs.getControl("WriterSize").getText() If oDlgPrefs.getControl("WriterDisplay").getState() Then glb_sWriterEqType = "display" If oDlgPrefs.getControl("WriterInline").getState() Then glb_sWriterEqType = "inline" If oDlgPrefs.getControl("WriterLatex").getState() Then glb_sWriterEqType = "latex" glb_sImpressSize = oDlgPrefs.getControl("ImpressSize").getText() If oDlgPrefs.getControl("ImpressDisplay").getState() Then glb_sImpressEqType = "display" If oDlgPrefs.getControl("ImpressInline").getState() Then glb_sImpressEqType = "inline" If oDlgPrefs.getControl("ImpressLatex").getState() Then glb_sImpressEqType = "latex" ' Draw preferences glb_sDrawSize = oDlgPrefs.getControl("DrawSize").getText() If oDlgPrefs.getControl("DrawDisplay").getState() Then glb_sDrawEqType = "display" If oDlgPrefs.getControl("DrawInline").getState() Then glb_sDrawEqType = "inline" If oDlgPrefs.getControl("DrawLatex").getState() Then glb_sDrawEqType = "latex" ' Update the fields of the main window depending on the document type oDlgMain.getControl("Format").setText(glb_sFormat) oDlgMain.getControl("GraphicDPI").setText(glb_sGraphicDPI) If GetDocumentType(ThisComponent) = "swriter" Then oDlgMain.getControl("Size").setText(glb_sWriterSize) If glb_sWriterEqType = "display" Then oDlgMain.getControl("TypeDisplay").setState(1) If glb_sWriterEqType = "inline" Then oDlgMain.getControl("TypeInline").setState(1) If glb_sWriterEqType = "latex" Then oDlgMain.getControl("TypeLatex").setState(1) If glb_sWriterTransparency = "TRUE" Then oDlgMain.getControl("Transparency").setState(1) Else oDlgMain.getControl("Transparency").setState(0) End If ElseIf GetDocumentType(ThisComponent) = "simpress" Then oDlgMain.getControl("Size").setText(glb_sImpressSize) If glb_sImpressEqType = "display" Then oDlgMain.getControl("TypeDisplay").setState(1) If glb_sImpressEqType = "inline" Then oDlgMain.getControl("TypeInline").setState(1) If glb_sImpressEqType = "latex" Then oDlgMain.getControl("TypeLatex").setState(1) If glb_sImpressTransparency = "TRUE" Then oDlgMain.getControl("Transparency").setState(1) Else oDlgMain.getControl("Transparency").setState(0) End If ElseIf GetDocumentType(ThisComponent) = "sdraw" Then oDlgMain.getControl("Size").setText(glb_sDrawSize) If glb_sDrawEqType = "display" Then oDlgMain.getControl("TypeDisplay").setState(1) If glb_sDrawEqType = "inline" Then oDlgMain.getControl("TypeInline").setState(1) If glb_sDrawEqType = "latex" Then oDlgMain.getControl("TypeLatex").setState(1) If glb_sDrawTransparency = "TRUE" Then oDlgMain.getControl("Transparency").setState(1) Else oDlgMain.getControl("Transparency").setState(0) End If Else MsgBox GetDocumentType(oDoc) & _(": document type not supported by TexMaths") Exit Sub End If ' Save into doc if necessary and update Log DisplayStatus ( _("Preferences applied and saved...") ) End Sub ' Save preferences Sub SavePrefs() ' Open service file and an output stream Dim oFileAccess as Variant, oTextStream as Variant oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess") oTextStream = createUnoService("com.sun.star.io.TextOutputStream") ' Save the general options Dim cURL as String cURL = ConvertToURL( glb_sUserPath & "TexMaths.cfg" ) If oFileAccess.exists( cURL ) Then oFileAccess.kill( cURL ) oTextStream.setOutputStream(oFileAccess.openFileWrite(cURL)) oTextStream.writeString(_ "# TexMaths config file" & chr(10) &_ "#" &chr(10) ) oTextStream.writeString( Preferences() & chr(10)) oTextStream.closeOutput() End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/dialog.xlb000064440400000000135713206777051026260 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsWait_GUI.xdl000064440400000000176513206777051030114 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsNumberedEquations.xba000064440400000002072013206777051032111 0ustar kkremitzkikkremitzki ' ' TexMathsEquationsNumbered ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macro used to create a numbered equation ' Force variable declaration Option Explicit Sub Main ' Get break before num and break after options Dim oSystemInfo as Variant Dim BreakBeforeNum as Boolean, BreakAfterNum as Boolean Dim CaptionLeftAlign as Boolean oSystemInfo = GetConfigAccess("/ooo.ext.texmaths.Registry/SystemInfo", TRUE) If oSystemInfo.BreakBeforeNum = "TRUE" Then BreakBeforeNum = TRUE Else BreakBeforeNum = FALSE If oSystemInfo.BreakAfterNum = "TRUE" Then BreakAfterNum = TRUE Else BreakAfterNum = FALSE If oSystemInfo.CaptionLeftAlign = "TRUE" Then CaptionLeftAlign = TRUE Else CaptionLeftAlign = FALSE ' Get page width and margin sizes Dim oDoc as Variant, oPageStyles as Variant, oStyle as Variant, oViewCursor as Variant, oPageStyleName as String oDoc = ThisComponent ' If we are in Writer preview mode, just silently exit If GetDocumentType(oDoc) = "swriter" Then If oDoc.getCurrentController.getFrame.LayoutManager.isElementVisible ( "private:resource/toolbar/previewobjectbar" ) Then Exit Sub End If oViewCursor = oDoc.CurrentController.getViewCursor() oPageStyleName = oViewCursor.PageStyleName oPageStyles = oDoc.StyleFamilies.getByName("PageStyles") oStyle = oPageStyles.getByName(oPageStyleName) ' Compute tab positions (middle of the page and border of the right margin) Dim pos1 as Integer, pos2 as Integer pos1 = (oStyle.Width - oStyle.LeftMargin - oStyle.RightMargin) / 2 pos2 = oStyle.Width - oStyle.LeftMargin - oStyle.RightMargin ' Get access to the document Dim oFrame as Variant Dim oDispatcher as Variant oFrame = ThisComponent.CurrentController.Frame oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper") ' Eventually insert an empty paragraph before the equation If BreakBeforeNum = TRUE Then oDispatcher.executeDispatch(oFrame, ".uno:InsertPara", "", 0, Array()) Dim sCaption as String Dim args1(0) as new com.sun.star.beans.PropertyValue Dim args2(1) as new com.sun.star.beans.PropertyValue Dim args3(5) as new com.sun.star.beans.PropertyValue ' Left aligned caption If CaptionLeftAlign = TRUE Then ' Insert a centered tab stop at positions pos1 args1(0).Name = "Tabstops.TabStops" args1(0).Value = Array(Array(pos1,com.sun.star.style.TabAlign.CENTER,","," ")) oDispatcher.executeDispatch(oFrame, ".uno:Tabstops", "", 0, args1()) ' Insert the equation caption text at the left If len(oSystemInfo.EquationCaption) = 0 Then sCaption = "()" Else sCaption = "(" & oSystemInfo.EquationCaption & " )" End If args1(0).Name = "Text" args1(0).Value = sCaption + CHR$(9) oDispatcher.executeDispatch(oFrame, ".uno:InsertText", "", 0, args1()) ' Go two characters left args2(0).Name = "Count" args2(0).Value = 2 args2(1).Name = "Select" args2(1).Value = false oDispatcher.executeDispatch(oFrame, ".uno:GoLeft", "", 0, args2()) ' Insert a numbering variable named Equation args3(0).Name = "Type" args3(0).Value = 23 args3(1).Name = "SubType" ' Set the numbering level If oSystemInfo.NumLevel = "0" Then args3(1).Value = 127 Else args3(1).Value = Val(oSystemInfo.NumLevel) - 1 End If args3(2).Name = "Name" args3(2).Value = "Equation" args3(3).Name = "Content" args3(3).Value = "" args3(4).Name = "Format" args3(4).Value = 4 args3(5).Name = "Separator" args3(5).Value = "." oDispatcher.executeDispatch(oFrame, ".uno:InsertField", "", 0, args3()) ' Go two characters right args2(0).Name = "Count" args2(0).Value = 2 args2(1).Name = "Select" args2(1).Value = false oDispatcher.executeDispatch(oFrame, ".uno:GoRight", "", 0, args2()) ' Eventually insert an empty paragraph after the equation If BreakAfterNum = TRUE Then oDispatcher.executeDispatch(oFrame, ".uno:InsertPara", "", 0, Array()) ' Go one character left args2(0).Name = "Count" args2(0).Value = 1 args2(1).Name = "Select" args2(1).Value = false oDispatcher.executeDispatch(oFrame, ".uno:GoLeft", "", 0, args2()) End If ' Right aligned caption Else ' Insert two tab stops at positions pos1 and pos2 ' The first one is centered and the second one is right justified args1(0).Name = "Tabstops.TabStops" args1(0).Value = Array(Array(pos1,com.sun.star.style.TabAlign.CENTER,","," "),Array(pos2,com.sun.star.style.TabAlign.RIGHT,","," ")) oDispatcher.executeDispatch(oFrame, ".uno:Tabstops", "", 0, args1()) ' Insert the equation caption text at the right If len(oSystemInfo.EquationCaption) = 0 Then sCaption = "()" Else sCaption = "(" & oSystemInfo.EquationCaption & " )" End If args1(0).Name = "Text" args1(0).Value = CHR$(9) + CHR$(9) + sCaption oDispatcher.executeDispatch(oFrame, ".uno:InsertText", "", 0, args1()) ' Evetually insert an empty paragraph after the equation ' And set the number of characters to go left Dim nleft as Integer If BreakAfterNum = TRUE Then oDispatcher.executeDispatch(oFrame, ".uno:InsertPara", "", 0, Array()) nleft = 2 Else nleft = 1 End If ' Go one or two characters left args2(0).Name = "Count" args2(0).Value = nleft args2(1).Name = "Select" args2(1).Value = false oDispatcher.executeDispatch(oFrame, ".uno:GoLeft", "", 0, args2()) ' Insert a numbering variable named Equation args3(0).Name = "Type" args3(0).Value = 23 args3(1).Name = "SubType" ' Set the numbering level If oSystemInfo.NumLevel = "0" Then args3(1).Value = 127 Else args3(1).Value = Val(oSystemInfo.NumLevel) - 1 End If args3(2).Name = "Name" args3(2).Value = "Equation" args3(3).Name = "Content" args3(3).Value = "" args3(4).Name = "Format" args3(4).Value = 4 args3(5).Name = "Separator" args3(5).Value = "." oDispatcher.executeDispatch(oFrame, ".uno:InsertField", "", 0, args3()) ' Go len(sCaption)+1 characters left args2(0).Name = "Count" args2(0).Value = len(sCaption)+1 args2(1).Name = "Select" args2(1).Value = false oDispatcher.executeDispatch(oFrame, ".uno:GoLeft", "", 0, args2()) End If ' Set vertical alignment to middle dim args4(0) as new com.sun.star.beans.PropertyValue args4(0).Name = "VerticalParagraphAlignment" args4(0).Value = 3 oDispatcher.executeDispatch(oFrame, ".uno:VerticalParagraphAlignment", "", 0, args4()) ' Launch the TexMaths Equation main macro TexMaths.TexMathsEquations.main() End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsHelp_GUI.xdl000064440400000000521613206777051030073 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsPreamble.xba000064440400000001473413206777051030216 0ustar kkremitzkikkremitzki ' ' TexMathsPreamble ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to create and manage the Preamble dialog ' Force variable declaration Option Explicit ' Dialog declaration Private oDlgPreamble as Variant ' Create and show dialog Sub PreambleDialog() ' Load the library TexMaths DialogLibraries.LoadLibrary( "TexMaths" ) ' Create the dialog object oDlgPreamble = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsPreamble_GUI") ) ' Dialog strings for translation oDlgPreamble.setTitle( _("TexMaths Preamble") ) oDlgPreamble.getControl("DefaultButton").Model.Label = _("Default") oDlgPreamble.getControl("DefaultButton").Model.HelpText = _("Load default preamble") oDlgPreamble.getControl("LoadButton").Model.Label = _("Load") oDlgPreamble.getControl("LoadButton").Model.HelpText = _("Load preamble saved into the current document") oDlgPreamble.getControl("ApplyButton").Model.Label = _("Apply") oDlgPreamble.getControl("ApplyButton").Model.HelpText = _("Apply current preamble") oDlgPreamble.getControl("SaveButton").Model.Label = _("Save") oDlgPreamble.getControl("SaveButton").Model.HelpText = _("Apply current preamble and save it into the current document") oDlgPreamble.getControl("IgnorePreamble").Model.Label = _("Do not use preamble for LaTeX type equations") oDlgPreamble.getControl("IgnorePreamble").Model.HelpText = _("Ignore preamble when generating LaTeX type equations. Full LaTeX code must then be entered in the TexMaths equation dialog.") ' Set the value oDlgPreamble.getControl("Preamble").setText(glb_sPreamble) ' Ignore preamble button state If glb_bIgnorePreamble Then oDlgPreamble.getControl("IgnorePreamble").setState(1) Else oDlgPreamble.getControl("IgnorePreamble").setState(0) End If ' The load button is activated if a preamble is stored in the current document If ReadPreamble() = 1 Then oDlgPreamble.getControl("LoadButton").setEnable(TRUE) Else oDlgPreamble.getControl("LoadButton").setEnable(FALSE) End If ' Display the dialog ' This routine call does not return until the dialog is dismissed oDlgPreamble.Execute() End Sub ' Load the default preamble Sub DefaultPreambleButton_Clicked() ' Load the default preamble DefaultPreamble() oDlgPreamble.getControl("Preamble").setText(glb_sPreamble) oDlgPreamble.getControl("IgnorePreamble").setState(glb_bIgnorePreamble) End Sub ' Load the stored preamble if any Sub LoadPreambleButton_Clicked() ' As a fallback, load the default preamble DefaultPreamble() ' Try to read the stored preamble ReadPreamble() oDlgPreamble.getControl("Preamble").setText(glb_sPreamble) oDlgPreamble.getControl("IgnorePreamble").setState(glb_bIgnorePreamble) End Sub ' Save the preamble to the config file Sub SavePreambleButton_Clicked() ' Set the preamble variable glb_sPreamble = oDlgPreamble.getControl("Preamble").getText() ' Save the preamble to a UserDefinedProperties property Dim oDoc as Variant, oProperties as Variant, sIgnorePreamble as String oDoc = ThisComponent oProperties = oDoc.DocumentProperties.UserDefinedProperties ' Set the ignore preamble state If oDlgPreamble.getControl("IgnorePreamble").state() = 1 Then sIgnorePreamble = "TRUE" glb_bIgnorePreamble = TRUE Else sIgnorePreamble = "FALSE" glb_bIgnorePreamble = FALSE End If ' No LaTeX preamble already set => create it and set it If Not oProperties.PropertySetInfo.hasPropertyByName("TexMathsPreamble") Then ' Encode the preamble string to avoid newline characters (workaround for an LO bug) oProperties.addProperty("TexMathsPreamble", com.sun.star.beans.PropertyAttribute.REMOVEABLE, EncodeNewline(glb_sPreamble)) ' Latex preamble already set => modify it Else ' Encode the preamble string to avoid newline characters (workaround for an LO bug) oProperties.setPropertyValue("TexMathsPreamble", EncodeNewline(glb_sPreamble)) End If ' IgnorePreamble value might be present or not If Not oProperties.PropertySetInfo.hasPropertyByName("TexMathsIgnorePreamble") Then oProperties.addProperty("TexMathsIgnorePreamble", com.sun.star.beans.PropertyAttribute.REMOVEABLE, sIgnorePreamble) Else oProperties.setPropertyValue("TexMathsIgnorePreamble", sIgnorePreamble) End If oDlgPreamble.endExecute() DisplayStatus( _("Preamble applied and saved...") ) End Sub ' Apply button clicked Sub ApplyPreambleButton_Clicked() ' Set The preamble variable glb_sPreamble = oDlgPreamble.getControl("Preamble").getText() If oDlgPreamble.getControl("IgnorePreamble").state() = 1 Then glb_bIgnorePreamble = TRUE Else glb_bIgnorePreamble = FALSE End If oDlgPreamble.endExecute() DisplayStatus( _("Preamble applied...") ) End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsHelp.xba000064440400000002324413206777051027353 0ustar kkremitzkikkremitzki ' ' TexMathsHelp ' ' Copyright (C) 2012-2017 Roland Baudin (roland65@free.fr) ' Based on the work of Geoffroy Piroux (gpiroux@gmail.com) ' ' This program is free software; you can redistribute it and/or modify ' it under the terms of the GNU General Public License as published by ' the Free Software Foundation; either version 2 of the License, or ' (at your option) any later version. ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY; without even the implied warranty of ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' GNU General Public License for more details. ' ' You should have received a copy of the GNU General Public License ' along with this program; if not, write to the Free Software ' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ' ' Macros used to create and manage the Help dialog ' Force variable declaration Option Explicit Private oDlgHelp as Variant Private oL as Variant Private closed as Boolean ' Main subroutine Sub Main() DefaultSysConfig() HelpDialog() ' Loop for non modal dialog closed = FALSE While(closed = FALSE) Wait 1000 Wend ' Save window position and size SavePosSize() End Sub ' Create and show non modal dialog Sub HelpDialog() ' Load the library TexMaths DialogLibraries.LoadLibrary("TexMaths") ' Create the dialog object oDlgHelp = createUnoDialog( DialogLibraries.GetByName("TexMaths").GetByName("TexMathsHelp_GUI") ) ' Window listener oL = createUnoListener("HelpWindow_","com.sun.star.awt.XTopWindowListener") oDlgHelp.addTopWindowListener(oL) ' Load help text, depending on the locale Dim sHelpPath as String, sFilePath as String, sMsg as String sHelpPath = "help/help." & GetLocale() sFilePath = ConvertToURL( glb_sPkgPath & sHelpPath ) If Not FileExists( sFilePath ) Then sHelpPath = "help/help.en" sMsg = ReadTextFileUtf8(sHelpPath, glb_sPkgPath) sMsg = chr(10) & " TexMaths " & GetVersion() & chr(10) & sMsg oDlgHelp.getControl("HelpText").setText(sMsg) ' Dialog strings for translation oDlgHelp.setTitle( _("TexMaths Help") ) oDlgHelp.getControl("CloseButton").Model.Label = _("Close") oDlgHelp.getControl("CloseButton").Model.HelpText = _("Close window") oDlgHelp.getControl("IncWidthButton").Model.HelpText = _("Increase window width") oDlgHelp.getControl("DecWidthButton").Model.HelpText = _("Decrease window width") oDlgHelp.getControl("IncHeightButton").Model.HelpText = _("Increase window height") oDlgHelp.getControl("DecHeightButton").Model.HelpText = _("Decrease window height") ' Arrow icons for resize buttons oDlgHelp.getControl("IncWidthButton").Model.ImageURL = glb_sPkgPath & "icons/right.png" oDlgHelp.getControl("DecWidthButton").Model.ImageURL = glb_sPkgPath & "icons/left.png" oDlgHelp.getControl("DecHeightButton").Model.ImageURL = glb_sPkgPath & "icons/up.png" oDlgHelp.getControl("IncHeightButton").Model.ImageURL = glb_sPkgPath & "icons/down.png" Dim oSystemInfo as Variant oSystemInfo = GetConfigAccess("/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' Set window position and size If oSystemInfo.HelpPositionX <> "" Then oDlgHelp.Model.PositionX = oSystemInfo.HelpPositionX If oSystemInfo.HelpPositionY <> "" Then oDlgHelp.Model.PositionY = oSystemInfo.HelpPositionY If oSystemInfo.HelpWidth <> "" Then ResizeWidth(oSystemInfo.HelpWidth) If oSystemInfo.HelpHeight <> "" Then ResizeHeight(oSystemInfo.HelpHeight) ' Show the dialog window oDlgHelp.setvisible(true) End Sub ' Resize window width Sub ResizeWidth(Width as Integer) Dim x as Integer, w as Integer Dim w1 as Integer, w2 as Integer w = oDlgHelp.Model.Width w1 = w - oDlgHelp.GetControl("HelpText").Model.Width - oDlgHelp.GetControl("HelpText").Model.PositionX w2 = w - oDlgHelp.GetControl("CloseButton").Model.PositionX ' Set window width oDlgHelp.Model.Width = Width ' Compute widget margins ' Compute and set new texfield width w = oDlgHelp.Model.Width - oDlgHelp.GetControl("HelpText").Model.PositionX - w1 oDlgHelp.GetControl("HelpText").Model.Width = w ' Compute and set other widget positions w = oDlgHelp.Model.Width x = w - w2 oDlgHelp.GetControl("CloseButton").Model.PositionX = x End Sub ' Resize window height Sub ResizeHeight(Height as Integer) Dim y as Integer, h as Integer Dim h1 as Integer, h2 as Integer ' Compute widget margins h = oDlgHelp.Model.Height h1 = h - oDlgHelp.GetControl("HelpText").Model.Height - oDlgHelp.GetControl("HelpText").Model.PositionY h2 = h - oDlgHelp.GetControl("CloseButton").Model.PositionY ' Set window height oDlgHelp.Model.Height = Height ' Compute and set new textfield height h = oDlgHelp.Model.Height - oDlgHelp.GetControl("HelpText").Model.PositionY - h1 oDlgHelp.GetControl("HelpText").Model.Height = h ' Compute and set other widget positions h = oDlgHelp.Model.Height y = h - h2 oDlgHelp.GetControl("CloseButton").Model.PositionY = y End Sub ' Increase width button clicked Sub IncreaseWidthButton_Clicked() Dim rw as Double Dim NewWidth as Integer ' Compute new width NewWidth = oDlgHelp.Model.Width + DLG_STEP_SIZE ' Resize ResizeWidth(NewWidth) ' Save window position and size SavePosSize() End Sub ' Decrease width button clicked Sub DecreaseWidthButton_Clicked() Dim rw as Double Dim NewWidth as Integer ' Compute new width NewWidth = oDlgHelp.Model.Width - DLG_STEP_SIZE ' Keep the width above a minimum value If NewWidth < DLG_MIN_WIDTH Then Exit Sub End If ' Resize ResizeWidth(NewWidth) ' Save window position and size SavePosSize() End Sub ' Increase height button clicked Sub IncreaseHeightButton_Clicked() Dim rh as Double Dim NewHeight as Integer ' Compute new width NewHeight = oDlgHelp.Model.Height + DLG_STEP_SIZE ' Resize ResizeHeight(NewHeight) ' Save window position and size SavePosSize() End Sub ' Decrease height button clicked Sub DecreaseHeightButton_Clicked() Dim rh as Double Dim NewHeight as Integer ' Compute new width NewHeight = oDlgHelp.Model.Height - DLG_STEP_SIZE ' Keep the height above a minimum value If NewHeight < DLG_MIN_HEIGHT Then Exit Sub End If ' Resize ResizeHeight(NewHeight) ' Save window position and size SavePosSize() End Sub ' Save window position and size Sub SavePosSize Dim oSystemInfo as Variant ' Save window position and size oSystemInfo = GetConfigAccess( "/ooo.ext.texmaths.Registry/SystemInfo", TRUE) ' Workaround for a bug that sometimes occurs where model positions are not updated ' We use the window positions to update the model positions ' convX and convY are conversion factors between twips and map appfont Dim Pos As New com.sun.star.awt.Rectangle Dim convX as Double, convY as Double Pos = oDlgHelp.GetPosSize() If oDlgHelp.Model.Width = 0 Then oDlgHelp.Model.Width = DLG_MIN_WIDTH End if if oDlgHelp.Model.Height = 0 Then oDlgHelp.Model.Height = DLG_MIN_HEIGHT End if convX = Pos.Width / oDlgHelp.Model.Width convY = Pos.Height / oDlgHelp.Model.Height ' Sometimes convX or convY are equal to zero If convX <> 0 and convY <> 0 Then oDlgHelp.Model.PositionX = Pos.X / convX oDlgHelp.Model.PositionY = Pos.Y / convY End If ' End of workaround oSystemInfo.HelpPositionX = oDlgHelp.Model.PositionX oSystemInfo.HelpPositionY = oDlgHelp.Model.PositionY oSystemInfo.HelpWidth = oDlgHelp.Model.Width oSystemInfo.HelpHeight = oDlgHelp.Model.Height oSystemInfo.commitChanges() End Sub ' Close non modal dialog Sub CloseHelp() oDlgHelp.setVisible(false) closed = TRUE End Sub ' It's recommended to implement all unneeded methods, called by a listener, as empty routines ' including "disposing" from parent-interface com.sun.star.lang.XEventListener 'Is invoked when a window is activated Sub HelpWindow_windowActivated(oEv as Variant) End Sub 'Is invoked when a window is de-activated Sub HelpWindow_windowDeactivated(oEv) End Sub 'Invoked when a window has been opened Sub HelpWindow_windowOpened(oEv as Variant) End Sub 'Close window using the menu bar close button 'Invoked when a window is in the process of being closed Sub HelpWindow_windowClosing(oEv as Variant) oDlgHelp.setVisible(false) closed = TRUE End Sub ' Is invoked when a window has been closed Sub HelpWindow_windowClosed(oEv as Variant) End Sub ' Is invoked when a window is iconified Sub HelpWindow_windowMinimized(oEv as Variant) End Sub ' Is invoked when a window is de-iconified Sub HelpWindow_windowNormalized(oEv as Variant) End Sub Sub HelpWindow_disposing(oEv as Variant) End Sub libreoffice-texmaths-0.43/source/texmaths/TexMaths/script.xlb000064440400000000157313206777051026325 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsSysConfig_GUI.xdl000064440400000002670013206777051031110 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsAbout_GUI.xdl000064440400000000433013206777051030251 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsEquations_GUI.xdl000064440400000001632113206777051031152 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/TexMaths/TexMathsPreamble_GUI.xdl000064440400000000512213206777051030726 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/icons/000075540400000000000013206777051023662 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/icons/eq_16.png000064440400000001067313206777051025312 0ustar kkremitzkikkremitzkiPNG  IHDRazTXtRaw profile type exifxWYgBphz3ijN{N{2%Qa(Y%jH!X\>2:j[~=ϋ:/rsp1ZޯryL˫zQti> y)ȣݖy7i;qg4q~WaX3x* Ow9#WW΀#'7Ԯ_>D>_O}.Os6ume0y^ةz bNobD(ӠJ&z]D\ud%W(i"+pcm uZbF3'hIq"`(BTmxce (͊ f["/zc7).c Blt. |2,w]$lQ7ƜHkH-B8p4彀?+8 E%I|B 3GG!ƨ1Ŭ^EFUMK&)hrƢ3fgȹ)Ģ%\APc՚jnqCТiR˝:}zS\<F:7jW ߣF_5cTL'21bM̬n"71!(5 N { [܌ 7+̄@Lr_qZu.vNZHl5;ͳ&5Tk^>Xw aW?Veq;B^f\m\3L/Z":opv}U XcxDynSjcIo32Q֐`Ag%ܞeen넅u;|:[K[ZUxϩUe`5GDa@4 $~} o`(|ܹp!\<?0-rN͞ KĊqB אz`yێ;o~O.^k)=_qҒIW!jހwX!u4e)udeC8lg,?1r AcI㞂w씢=/WL4?LeCHT?G}-.>)۳a ^B^~ ;N[*VkEL#܂ k'"!RC̕N25㆟ uTQyw<N0f"#PQw S3)4:ZIoGICXlq^2tv^X\rW{t{뀇z6ٌO3ߦd8!)G2Q7$D+U$TwSSn!{,eP@3'GOv GM4Oc8 @%Kl~IvF^?m3x4_ "8_azTXtRaw profile type iptcx=I @ 3#$uH+_-?r;e[ R6XYp( ld?g{WU2?9GS jiTXtXML:com.adobe.xmp @bKGD pHYs  tIME;03}IDAT8͑OSabVڋ@Jt$118 &N.:Pl# $Ѥ$~?Qֶ(m\<ӛ @bKGD pHYs  tIME+&1IDAT8ݑ+q_ccf(@QJZ7B˺p6rP\&:I ?@m*Ә6ny>x8w?]^YkxY*;g@{ pw,9z~X"RuZm vHJ)vvז{$@4tGS-=&թ`ð P3'ѣg:0wd8 n w֧"ʲ4 M)vwv/Owc nW:MUv>zy'Ka0X&ǙmDRL&dn0sW>JKqZ4ږ|cHM/& 侮FN T^L0@'Ppxvm><$X~XIENDB`libreoffice-texmaths-0.43/source/texmaths/icons/left.png000064440400000000034613206777051025325 0ustar kkremitzkikkremitzkiPNG  IHDR /3sRGBbKGD pHYs+tIME  :3wtEXtCommentCreated with The GIMPd%n=IDAT}10sK6je<̒$NѓݳAUPDm84V %r?VIENDB`libreoffice-texmaths-0.43/source/texmaths/icons/sysconfig_26.png000064440400000000164613206777051026712 0ustar kkremitzkikkremitzkiPNG  IHDRJLbKGD pHYs  d_tIME xV)3IDATH]hSgom ŦB;: [l D62*ZSEi>jQ&]Ű8h+8bNeÚv6wR4M0ù8__+RWhe8|]|vϝ?[ Uչ?\ş77J)BXOu 1vJMo$<'JH 6x,J<:@ t\4}%h+Rleު}i 4G|]Ϛ - _o1F4tS^)%;wx09u\nsL*RE)xxTUnRޞެհu*kPJ}n!ֲ.UȿϕFA/9,IENDB`libreoffice-texmaths-0.43/source/texmaths/icons/right.png000064440400000000033213206777051025503 0ustar kkremitzkikkremitzkiPNG  IHDR =sRGBbKGD̿ pHYs+tIME  :9p.tEXtCommentCreated with The GIMPd%n5IDATm Lwci?a!bc%D[x)N lK&-rBIENDB`libreoffice-texmaths-0.43/source/texmaths/icons/sysconfig_16.png000064440400000000073313206777051026705 0ustar kkremitzkikkremitzkiPNG  IHDRabKGD pHYs  tIMEhIDAT8˵QKqx!f:ÖZZZ s!-hȹT[Ћ(ZL|>`T:$*KqFI*T͐;R]\X]*P6jBN_5Z[_|$ Gm(dr9Yau"lh"(]LP#yscSQ7 hX8]*:"iY- Xc"$Ah߄8ȼۋƧiM5O "Gdd]ב*d$@ d# " ~r3]" IENDB`libreoffice-texmaths-0.43/source/texmaths/icons/numeq_26.png000064440400000002333413206777051026031 0ustar kkremitzkikkremitzkiPNG  IHDRJLzTXtRaw profile type exifxYnvEcBp<k))*{Pj$#NCriTjn9[Rlߟ?|Rgx@g%ﯛ2D' .=Q۴_(XJ;4sU+1t~>߹0qcg>-x;Pbϱ+{~9T6>r({X_r_-N$N.[9do_VC7)| X&Tr5[ew\y9>'sǗDĝ3V˫Y2|4/K_`alb$U[9dO"X dfsı}~_rB&9SOyh!)PH BbLO)hRJ9TSK=s9,%XRɥZZ5XS͵Z[ͷ[1z碝Sw|GqGu'3L32l/¢W^ŬmJiǝvev? 't)vgެ~Ϛ-s5fMs+k\)$)gdGGƋ2@A{VW3Nqjsz*(N_F(F˜y8͊22-_Gz>Na||WHhH Xc9T Yj3,>s,N:w:͐5lﺻm]:9['ֱ@.yK55= Vr$v*;i's$ŕNo Y7It~#Ghn?z3y8t넹Dw76,KUG>|QNJ ܝ`dm;jiSt}u(*"T%V)e"QNx2T Sk2qTQ;ռژˍuS3XXfIb{q tЗ\LWϟeLA]fEjQk~W\͂RrU8Ӌ-$`d)H~ƚRluPi~=ѱv$Q_v +d% QzB )AE hX( UJOXw(q|gWN'D al"$ dUjq1s@aj>gltkV]NArfI#."bp͝Q=lۈڸ(D&*e9zt.w+MSs4&fωU5Ahi5"`)K_&Bqc<>Ge I@PAVV\N45yS4 ՗PF!6hI KQ(-3l<s\i @Axeю/Xv`ZQa s؀ZJWqXj$[jpyߣVʇ9cj׍ 6K0DDWP(9?K'qP_>jGv[b!ch1"GG7ǘ6C_.͗{BI R!&!D*`q 6DNz<5 xր&8\t3GNN.{/mZ`hmP4&vvsrGXQxq7k Ot{/pd펋+ͧhz?Q̇XU+J,&) }D9T<~e: D*"HH;8 QKwB/ ˦|Λ͆ٮKޤ aȞJ Α>A ktNbd (LKΠ";* BOՂ-XV;lD4-R#83NRUBIcUKssW9DgKƅ5w_ٽ[ER|`]_k .([8DFuCY24BH>?@< V%xt:^#t Jh {7uSc3Tžafvn席D1! f;(Sqm 8['9 -#X 'lvWԲ'r. !;5l9T6h0Q-R1~tٞ~;,x=I*G#ZYktY?4B}dVpon08Nh9{b*#[Ӑx!4bhXtm YtӠj.j+fY 49VV#h:wJ~+}QOSP5WD ;ٵSyK鼥Rr6~. 213F+e fMk@k8jb`pkަ{Y)"y'f^cp! 8V=Fl"(5$Ǖ)+C74_Ա5LzjA#v>Gu$i3?%zVU0 IE}i&;ݶך-wzW8@*Ane~ol08l~IhowYO4xz)_U4(Y,'|9WKp|Hɞ/[sA]A\k<1b" G)DDܛl| S"#`)pmSs%p i,;omat#h*E-S€In&_:,vtK8QlAmz􇽉2– "gi2l !{\ #-e54Oxф'ՈQ$IMKdE>lM:QP_]SCYng4P~%68 }enRч`8+,ȭ81GK;u#y=,BJ֬4t҆ tARɊZ4^}zcq,k[Ҵ$$0Wkz(P3%;gZLwÎ \Ӽ82B&,䎘&L+ip^*-{zG,~)"<cq7{~4.82ӓ{vPW P/UoRfU[*|L9W m7]ۨŒoÍ_t_ytV& eWT¾f "G#Vq9p PҬ&f\ʴ 8/'#Gb[ <֎TǠL}DNуCG%-Շq3ʮ$4mGv/->×dqXĻ1`DVWJP=-9p6 %>؂oa4{~EH2^-jkZB#bphr' #生cԎ_R/`PsdY=0r#9zQgyۯKcpl['&የg SmtڕsT]|4$ KeS2tDV-s~%SYZs=Là nSt qg6[]E`Bwz0*nd\9qDK^BSc%z-[M &]LAKX4O36,fRl ]4ٱ-k6ڣWYm}"4Dt?x+B=q4)KʬuP+)W53N掆NݧS"MvAi% W&ZbU>]^{#p7>~]]6V= *1ӀĜթNzBr^#z)yGܰ!_AGcV&afOUz*"F\TZ*"38G=4u T.f}<-6`/=`v=q1CqArB (g䷪?~pǮw9Ld| &ˢcmQښo;IjPC:a`P!f#ZDK .JNq݄ l/DcfTk(&^aXAY6hc%$mϺ&# ’v 'z;\i#@sZ |ô>/2lnI|끅CS=XH#z5ϱvAkVGo z@ew8M-6Au;'Kւb,c?N,.\&{+xFGȫu$g(8>%ϥ&f Q} ī%oǥgu QD/," e\pHn2=k{=hDYe#Ӌ1q6}3[3v::!x:{_R=1Evzo턙 %(azTXtRaw profile type iptcx= 0 #):u>U@g[LCgrp:_1<4;+ؤDN,,w0b H jiTXtXML:com.adobe.xmp @bKGD pHYs  tIMEl*IDATHMlLQ7c&j4! B$ 4 F"DD"b#*J,t! "+DiD;I?57XL {=”wI1A+5iW؂*_+c]vt$ʒ,L1w^\mMD#AlyUl8P -'&Q{V#=a:Ġ  "()oBy O_ypy{ rXM2z;~Ct**/=\ ;?㚥5خ9$ [j~4na0A: MFO5[AY&CcOB3!8s'k-/p+Ld c!`ײRiܼT3Z}!-V>/eN+P & (Ͻu-+??A~;yC)D>`7̊0x.<8OeUA'Ģ3֝5m?9<^bMXMSvo]=32G#I~_\.juy0.;O5koEO)vCal~?ܥ_F臬}_KY̮Ly'm*i4~*S}I>5]E\w:do_x~e}VC7) iX0[cm~UGzg?\s~bŸ a(sQ$ĝ7/uc$6t\`H{mqFcrwe D;1Ȁ.$-c%? .%9&Lr׽9{Oh!)PH BbLO)hRJ9TSK=s9,%XRɥZZ5XS͵Z[ͷ[1z禝Kw#8ȣ:qguٗ_a+bV]m6N;njO:SO;7?f5fM=k|\ʷK8IRȘeʙ.F)gy"y撒2Fv>˼Q2g_-׼{P1lkvc࣓wB(ǼN&y'n;rw;Vc()fMԕ;hϭ6cT ~a9 %6mΙ}t?%g:IJgԴWvgu g;V*gUt*PĖ{[6nZ~6Þ m9!~^ϼrj{̏3W2>7V<@6Tғ|˰g0 YnzRaNk)g,is>)+'r6q|.,QB^ d[qz xmY=Su*׶N.&?!;G 4vHT5Lf _=gp*'OИ<-N?L1 'QkVGvfDZU25Bg>$$bfPϐhݠ.4m$l:_ļC=D1H걵W}HL;)D]p>cM"9c"0 C?Kji Sܠ>E`rܣ9e'ål/LUlvjw]ܴQ\_ia) MQK6dC5QDcgL.p\p@0,a65xs?l^z&u%*J(CTFc|37ه>MXd"sAz e/ jt7yy4¬9).Q{q d|`K<%Ot~Zĵ\= 4Ld>糶աj\e:U}H=w/>W sh :%.Pv\0G22FۨT8>`@rW͠:-!hrbl$žgLP_ڶ-P/)\%m΄ p)L}PВxN,&nZ6 ȃ`3GS u~m_ 3vތSp  \a:枫lj/ql{!qVOV9Jyⲁi0G٪Z*JhAqu ,Sï\.;;Mўa94Z7e Ȫ)S-I#!ڡ̞( c(qOdBqp0%قZ$79? mʼƀC2R_2A}D: C`JU=bg˂14PFɡEI܋ 4 i S܎T/h.gTuD z )=]=pTj &SVk~o;0mO,3"h_nx{JJ l/6bmRsœ@T n.lđ qlMƢ;эist:IM5 eB05|R}ƻBvQ} td8T=j|D2c}Q"s"6M4U*FaRsqWb )#񘺰_7T+ Ő(Z#RL,eK!$5!3x{\b7N4ڴHqjqي<pUׅ_*|2r@4RL;~>aELx?Q@X$n3EGPs@0p.͇_ xlu(k_k Ol %l_} Rr hLˈmdl[K{~GYEۣ@X(aoCLB2,S%{oec ⢚E-wYA{@w*l-Ecb0F 'B7%5'YMb D_ P2<'"`9:]CUZ ڳ㽴[~ ֪:%Q?B|{5?@nA&oU"JaJpwJ*Ȩk 1=)Oe3gs|*3RE#$ErJlSDtafӕ Axεg/O6hk4&('ĔUvD㎀@B#~x"+d~M_U͌Xh\z`naʈ$?tRTdo/V`VUDՉ89!` EA/,ma )xskδڍ,o-  ? ( QqXd ltsGp5nĎz =glL;(y0= uۅԪӢ:@hU"MApnLk44BW$3h̵( @H4RxCi 0i" ܇uU<ф40@UkHil)bS~;uR"HF%Mb0N4{zaƒ[R vG]!*. "؞*eSmH`m2-jACV (FX҇*jD mAkZpL*ؔeP4u~m!`#=&XK }~=*gȃip푀)` 3 ;GO,B[¡xX@ڔ 6F}CAAB);m=BrAZӚ>^vnjo@ۍ-lu^MD-vP/Hg?JYƸI2R4 HXC%N\$v4wHɫ|@7/N-t! P-(c7sM+EZZ Mk"CX\NJN+Zn&fZiT' ~.TBwk$KUzZI pi{L}#`ߎ+gP`SVw%\NEzC mE8mwpOׯ@:$ĭ 'յ@s|vH(2^kΚf^ZQZ{UI& oP7Oۨ c5C±Jv=bo <܅k2-J LsY3OTF`[Hiꧡbj~@Y)6|z3W)Mc|EVS|U*keI5iSѱ^{r*] d5>6P gtG35m1c\ F|4uJ20A+t0moʽ8{;_X)<;{G,C9ddB=O󍓨X:[ZrMˏZTqYIAʣX^=PH~kv&MٽzDk(6"Ѕ 7 !C VL h2.(`i.G2EXd+@ [X1='zB{WVD:'4"_ik}A[SrtQz l%zv~-pDÃ*CpddC[]ʙKݻO !j;Q(@[Ӟw.S<m>9z ˀfD D,+!wѶh$.0i>E/.w!G, DC9.]hgZh&c ZnowX㺁ڥݦ,&E\δ\ZK ܵRjv>dߑJỲ-^{ :ʜKY,s.@m9S,DGFrZHɦ$v15 o?@kZ R+6 ڢڠĵrgHP-QLjyZ˴ 9׺m-o,.VVix71v+hLAOi6%gzD(ɚ-w#8 Q XbjbHCm5gR1Dkk]cZ;t m5t`D.0F{zf Gӵ<~6"xFѝR[VgZ14DFp2YPS橼p?ў[09`8ou\OD̫(Ib1!TnE 6U0o 0ѪFJ)OQyo^EV>ˑM ë'ֿ_.d?BazTXtRaw profile type iptcx=J1@ .n7X/Qr;e[ R6XYp( ld/g1 jiTXtXML:com.adobe.xmp @bKGD pHYs  tIME;V7IDATHKTq?wѴEPU"hծ"EFZHP3ha-,Ee."zA( i3sO kƩE p7|ŒLlᆪgcP@JD V j9}[O̍AL %J+g3ضA,Hmm8TQUPgYb@AAc(Es[ݧ{:s]ƾ&1>Nd&ؠJ: Q1 ΀b1cwddIGgcYN0۲Z:c,[0K7 @| ;,YZi0$wqR  FoCNeTqס$wo&ɜ2 T׺:.PQQ8I+)Q>5w걋csƟm:a!I(D)B`#~ 17@Y@]絽eM,$8R)EQ>'_7^*(\wמj;}SŃSMA "TKzxιu7jzNyK{z!@b|9%7]Y̪p eI]Lm_( [H1NgV._<][Ȩ1fQC;W-vw[N0aՅMČk}@IENDB`libreoffice-texmaths-0.43/source/texmaths/icons/texmaths.png000064440400000000153513206777051026231 0ustar kkremitzkikkremitzkiPNG  IHDRJLsRGBbKGD pHYs  tIME  + 4IDATHݖnUs]cm'4uE!R\pUn*!-O*\ BU* Mx8\;$M"q#9+~ob)oA("J[X]gE}sZ(I3b@ZhZHY$YJ[Bٰ&MxXM^ENZ'Nr-J<%5Q A7CcQft4h(\2tHQf;(ry?w5E.Y6yJ4 ӵgVht&L_0OSh`+c ^u?>C,AvmhY!F ] jO*7 ,ٴ1y㘋AG rW%)wolFe_1כ ܴF8Iٻe,KVrzY᥌! }<\o}<8N]?~6hYFdx\\#xAAEi1PJ BzaQxxpԕ[089,Z0S*y~ID־:hn7:!#SnW-qujಷe_  'tI̹i/ho{6(,]}yEX^jKxJ=oߎh 3 <ǧ`:I[<Po3<ӬUy'ݟA{oIENDB`libreoffice-texmaths-0.43/source/texmaths/icons/down.png000064440400000000035513206777051025342 0ustar kkremitzkikkremitzkiPNG  IHDR sRGBbKGD pHYs+tIME  ;4j tEXtCommentCreated with The GIMPd%nDIDAT}! @,I*LǨd@5Hllf ϾQ0Iэщ;Ve,,IENDB`libreoffice-texmaths-0.43/source/texmaths/icons/up.png000064440400000000036113206777051025014 0ustar kkremitzkikkremitzkiPNG  IHDR sRGBbKGD pHYs+tIME  ;!x~tEXtCommentCreated with The GIMPd%nHIDAT} 0@gOLȘZM'$K2xIAq=?xPf~NΒTڽ4,y#_IENDB`libreoffice-texmaths-0.43/source/texmaths/icons/recomp_26.png000064440400000003167513206777051026200 0ustar kkremitzkikkremitzkiPNG  IHDRJL%GzTXtRaw profile type exifxڭicr0S;w`2IQz%ffd;;ec4׼r[lMx~?ܯ_x^ | Ǽ>l?__7e~S?f|Puٴz6K|ca1Vߡ{w 7WB^;ookgR?oȿuvw~ٵw{omYfcfLTw=~,_r4T8Ye'949=.;n߯MOk5l X&TcoXܽorxw\1z9 qlZ+uah7bCi{oqcml`]#>ޗl4+s{';` eg9ֱ?~.%9 qT{{}eH!֐.lV)C=MJ)jjcN9璅QK*RK+kZkr+ZܴsΧ;}FiQFmI8̳:˯HW1vPqwuv‰'|ʩk]uo;ϻ>}r)?.'I{Ǝ Vil$EKڜc`Χ㾙}sF[c猶sݷ?}ͻc/ 67}o/ڍnN^ލ> L/:u; vۑKwUƶn5iD\]jeL4%g09v'wCȆ_6b\}t_eϬuRٓ-=~Q^ٝ L8۹R9Ll9}osVc(lggC|!_|.z'g~u~|ib|?Dox6Ql#%'yn0"atA2 l[ g8 5\bҫ|}>e~Oړr1 G ymMIy6൑gO#ɪ\:)9o}E A>y @c*z,%_CWB ʉ|]C @hLn'?L1 'QkVGvfDZU21Bg>lH̠!ѺAg]h1 IҽuA@#ӑK x#c^o,A_㉆j( ]tR z\$y!K(U@PЎѕ<WF٢(w6*~ @Cf-hrblM}ۉ"[m[r_ s/@E7osfRPé" $ :a{:m_ 3vތ#Sp H\Q0^{ArU8=M' h+9Jyⲁi0GЧ_E`0!Aqu ,7ï\.;;MÑa94Z7Ó1lўHhI epDXlHG|"  ̤lbpSt9Ǹ"!MWUpH_KLPg"!ZH0TeAUP~geP"$Ň4 K nV/h.gTqzv˔%k? lBіUAIÊQNƎo08ԉ6*x ]X.3HGkǠm\ Ewkfxz%/Cs#V"N6eX(SDhף'mi-PǕk.[Jx <؃Eb(^rwؐ +ɩͤ2LUvD~n зPp O$Vg2N.Yl!!K[eɬi:XWp<  xn7f7`NǚƜ,Uz+c$R((uvU:c J㦚Ul $dMdoD{WĐw>Ǻ&Y| $_J>PcH4OP=ճWH-Dpʊq͟i-L) 3^BIퟋw.f>IaU< <ͅ 80[a` Xtg701iNgvSL«by8 !`cA> ]aF٨m:@Tdz5>\D ;c}uHAMт0e Ĺ+k {h` )#񘺰_7T+ ޙ!QGvHk- P A1J߄;:8hӎ#X  .ǵ*E@=>e+LÍZT^\~ՎTi$뗑(V#ʴ#ϷLӂh o }FP(pjނ |V'x;ix׾dR@Bl% Wȿ6j%2{'ضJ{~GY!Eۣ¬^d,$sLuJ6E5cZnYAT*Ecb0F 'B7%5gMPF z *@ɸҪP򜈴=ѡ(պўmYVE7J=~Bj~܌Mު$E”|T*HczR  oDgns|"3RE#$ErjC$N1c=jӅMWR6Xs"_mѐ\i LW(-O9)m I=UvD㎀@B#~x"+d~M_U͌Xh\W={b00reDd !|) p2 U3!#p9l?zu"FGNX"By ,`~0IrznBk{\xzhQY,h 2PH2}(1_QB[К3Wx\9VX6Ƿ}{DΆqs B#S,fvBY ja}.P΂ی ;=D !A(ZSMAD tv8P8E[]+VQ |Sqd$I@eQy8] sY}t3ZB˩B2XeFrRZhUHaq.;^J**7,͚N, ΉN!2]"(!1KS{yc|%*=BB|0.@f}#`ߎ+gP, "OYݕp ;K.`(w(鸃{~r4G!!nlD8ᡕȓ:A~]DAJ_ej&PmA4:T" Wـa/,|E;:HW.P<#L@R]p=Qf#{Êċ6cx}pQ#"oPTfj6jf!az $4{ܪ.[i]+.[}Е Ԧ=9ѷ;XAaST, 7 ў [xS9 ˰ AW[yRg@z^b\8آ>ô޻Vv}JXVtPj"][HTR̍QIͳd?`G h*<{6PNЮ,&5%;CV0IF~%ƏvR,xR]o60A w>s!$ԫPoD%2EZ<ӵ qXtGU{LfEA?ZsYSg P!Xcȣu y)S>{: dY!ZQ!C:0ã)td ܲ$D$=wGWt?3 ڐKE(Iʟ*4WʘBU=c2W)RA'9tcz}6uR%Ð` ??Z-K7;`U F&0rpV 谬;Nox9ذ9'&,tLщ j`,|!c"fʷt7NAê[E! U {fY@$# |:C!hUn% diȰUr*Va9a ETa,CNBE9$ IT|#|nm,. XD|aTVz( ށL'\){DVg,\2z"pAH X3|"c!."sQxh W,CUc["e A wQ;D:ȧЍ߰+ud#sKMxz@fݱ-*WBkDiďT4l|ȋDm 9Q7QL/;_F k[v OI2k06M 4H_kYѬCpb.Eex`9!(p` V왪i mV#zY%Cc4ZYx+{ED\WC2-{}bA1YUu~{"XRScتF4ي*hxeՁ>S=Ϛ+'g'y"+c+$o=X [U.W+N"]~Gp@lf?^@D^ZڼGϯ%MGq*g֕%=}Vhʂ2٢3qI ԌF|g`Umi Vy!!evv0qF)ћYP{#@:q'TUn_=ڤS3ĺ_!AcIsbp=5n{Ҏr'].J.m?+f!uXձA ͚CUe{CyM~ԋvem}ɞ4dac4Kc%r96$vgjCuFu͎C2^IȽfG]g aL%%~!Jv-=8.0—A&G ټfNuf†]TٱZ#RBjQA~v9?z44DNUw7򂴯1/=ʗG+{ϰI[,QDSgT*lĕ@Ib&]編@+TxN[0SmCR${4!QꙬ Pt;:Y*Ѵܽjtd] Ŭ+'*$V¨RVG/0<Z+KÏU&)5s:dZ _>bjA[1g=(Jkj9'wRy=M82a gՎԠ5=o~tRIXotWR5y,9[R%q7dNJ4JSDxTWSCSoxZ (lD.ۤuUtT"A>pMHhh^LlLSN۪y%zr X|3a0nUtcyB<"z7TP68p与IԖlXo`Le>ieQIQi Ov'$W QoӅ3o+^&1V one;EjzO"W&M=SWQv+QsZ>Ho&l\II@:6Xy6f:2hxlj}Mg],rL*c5Xq%5;PoNIG7sR;a*zlӈ5 8@ EKjK٪=Pt24A~B:o! zs֯ YZمɈ<r,B#s`'[-GDf_gH@¶d5I5H+4!xpwht>OmzU d=j@eCA_Ѓzujd:Aد}zECR_g[ب{V;d̰8H:ԣ2@b!\ul4vE06_|>Ay=lݼJ P &g Sl@I}v%?x@q:]tMXÔM*HH,eX48yWه+:@yTZwVޝ?&TUbs#ibXجh.pl0 |My'|s1++ܧiz {KtrRJ=D;$RNgSt1}ao`FUb%|Ȫ!j"zrI6ģg_ 9(@ cfSpaa dA'j& ,2#ׁ`mB'FFd0H(R`*ffnSd8w>Bi-+KO6QSNWgք1Kϑ^v$J1Tg꽓깊LU最g3j h\n>nLrہtw Y\Uѣzk?H˲!U PP,)"*{E~0C<R :x^Y8?4}uX՚:pG!O fp3:hzptqtJ<6-`_Qsi{Y:fԆ{9y7G=ظ/Q84NsV>̣-O[\O2(ժ^9`5{=@ڥxRlD(I*{Uɩ2T%¨o*}-U^>iǂGH` *PĊ>Լ;wS@aJBZ|N,#>]`>\u>gA=ɂ jziݍo޾)ԋGG*{%ZWtL@BmlTEj_o x]U"vQ{`W\j贙wޔ. `zTXtRaw profile type iptcx=A@ }Oh ؽx#id캟4 &'S+@ӤDN)J1䳾` jiTXtXML:com.adobe.xmp @bKGD pHYs  tIME$%UeIDATH[lTUL/әuZ:4[xE5C!#!/D|ɤ5AH - Dj[D.eJ PDڎiA*L}2uW]og}kgEZd>4MQ)JiITZ;/{p9d\KH_T 1::F^]+#ISV~;@q"5-A@BiMŽ(AlWNjtMҰKa !hT@ B̜@6= +mdph-}l6N~rRi;ؾlo)+~8HuVP]YO%+Y =!ct @fEe:ؾ>egQ3Nۑ4MQηݐ8?u;A) I]F(EܸtXC9;Ιef+<X?s(ܸŷ'e4m(<^41!?KaYheeeRQQ!eeerSBK՝9>3ܸ$YyL!@@ww`@@^x^IƆ~_q>ZAIwX}󱫭?JU|>zcNt`0t߼G= i,f9 jyn$(vtay ԓ2o <{ַ860r]ص73 h.M{ jGi`Zy>Gߴ0eͬY$Oc< QJQ乇l^g 9; H$Ѷ#L,DkN^B݉- cgN3ZEJk=?utŮ,F?=C޴SW kozbY}H4ߡSĆJiq}A}vKh5 w$RǜM<+aL{H 7ظIQyE} o(M;UMgy  )Bw THn/B2m@XG#dvzeZZ%:D}„hU$~&6>\X̌S5 9 #8p? )ƾvD'f/sP3o螷 +YwX'{c. K$iF,mU\7(ϳ&P! n@\zF# 2=|J?mđXB5Mx2GCxe <&yLgsx(۸zsk~#F.w Zc纤'/·Z!+kHm# g}=|ˑ9:OP)ߘ":86@xS6cnlrKl9_~֘4f_a \Gy*L[4T(9-T*ⅷUQ k ]ML<x15DHrkOPOǝQ\}q AsAoPM5 è#(ca&н.}e]+6KFT5D^dxun{;̃f}*QAqHj* 3[ o5NM rA.5-cjچSZ|yEaYH_[bږV5I7. u\ZgT8l8*5}.UBTvdVA" SlCU" ~FZ x_PVqw`zTXtRaw profile type iptcx= PCL@_GxI!ul# \,e/+KuCm<2/񙲄6 jiTXtXML:com.adobe.xmp @bKGD pHYs  tIME0P Q$IDAT8˥MHTQ3y9h‘Z"E m" "jӮEDaf8C ,2 #hQYQ~ 3B}D*.ϣ.ۯDV2MbBˎS\4~%{4h=;P@)o,kPZs^L~$~"ѩYܳx (V$Idf&e0y,[kћ1)$_!#]1)>+; @>PwYhQ<\g?d{?\6! F,zX=kk  5 :FD, 4u ǢB:MI'*C Ӡ~42>  FyNzj4t~ajmښÙO)-Xowwn=TWj#V{uH">Ʃmꝶl0HOq \I9=:=E- w}ٕ723, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libreoffice-texmaths-0.43/source/texmaths/description.xml000064440400000000127713206777051025623 0ustar kkremitzkikkremitzki TexMaths Roland Baudin libreoffice-texmaths-0.43/source/texmaths/Office/000075540400000000000013206777051023742 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/Office/UI/000075540400000000000013206777051024257 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/Office/UI/WriterWindowState.xcu000064440400000000102213206777051030440 0ustar kkremitzkikkremitzki TexMaths libreoffice-texmaths-0.43/source/texmaths/Office/UI/ImpressWindowState.xcu000064440400000000102313206777051030607 0ustar kkremitzkikkremitzki TexMaths libreoffice-texmaths-0.43/source/texmaths/Office/UI/DrawWindowState.xcu000064440400000000102013206777051030057 0ustar kkremitzkikkremitzki TexMaths libreoffice-texmaths-0.43/source/texmaths/Addons.xcu000064440400000002367113206777051024511 0ustar kkremitzkikkremitzki macro:///TexMaths.TexMathsEquations.main %origin%/icons/eq_16.png %origin%/icons/eq_26.png macro:///TexMaths.TexMathsNumberedEquations.main %origin%/icons/numeq_16.png %origin%/icons/numeq_26.png macro:///TexMaths.TexMathsSysConfig.main %origin%/icons/sysconfig_16.png %origin%/icons/sysconfig_26.png macro:///TexMaths.TexMathsRecompileEquations.main %origin%/icons/recomp_16.png %origin%/icons/recomp_26.png com.sun.star.text.TextDocument,com.sun.star.presentation.PresentationDocument,com.sun.star.drawing.DrawingDocument macro:///TexMaths.TexMathsEquations.main TexMaths Equations Équations TexMaths Ecuaciones TexMaths _self com.sun.star.text.TextDocument macro:///TexMaths.TexMathsNumberedEquations.main TexMaths Numbered Equations Équations numérotées TexMaths Ecuaciones numeradas TexMaths _self com.sun.star.text.TextDocument,com.sun.star.presentation.PresentationDocument,com.sun.star.drawing.DrawingDocument macro:///TexMaths.TexMathsSysConfig.main TexMaths System Configuration Configuration système TexMaths Configuración del sistema TexMaths _self com.sun.star.text.TextDocument,com.sun.star.presentation.PresentationDocument,com.sun.star.drawing.DrawingDocument macro:///TexMaths.TexMathsRecompileEquations.main TexMaths Recompile Equations Recompiler les équations TexMaths Recompilar TexMaths ecuaciones _self TexMaths com.sun.star.text.TextDocument,com.sun.star.presentation.PresentationDocument,com.sun.star.drawing.DrawingDocument macro:///TexMaths.TexMathsEquations.main TexMaths Equations Équations TexMaths Ecuaciones TexMaths _self com.sun.star.text.TextDocument macro:///TexMaths.TexMathsNumberedEquations.main TexMaths Numbered Equations Équations numérotées TexMaths Ecuaciones numeradas TexMaths _self com.sun.star.text.TextDocument,com.sun.star.presentation.PresentationDocument,com.sun.star.drawing.DrawingDocument macro:///TexMaths.TexMathsSysConfig.main TexMaths System Configuration Configuration système TexMaths Configuración del sistema TexMaths _self com.sun.star.text.TextDocument,com.sun.star.presentation.PresentationDocument,com.sun.star.drawing.DrawingDocument macro:///TexMaths.TexMathsRecompileEquations.main TexMaths Recompile Equations Recompiler les équations TexMaths Recompilar TexMaths ecuaciones _self com.sun.star.text.TextDocument,com.sun.star.presentation.PresentationDocument,com.sun.star.drawing.DrawingDocument macro:///TexMaths.TexMathsAbout.About %origin%/icons/eq About TexMaths... À propos de TexMaths... Acerca de TexMaths... _self libreoffice-texmaths-0.43/source/texmaths/help/000075540400000000000013206777051023477 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/help/description.en000064440400000000066013206777051026350 0ustar kkremitzkikkremitzki A LaTeX equation editor for LibreOffice http://roland65.free.fr/texmaths Copyright (c) 2012-2017 Roland Baudin (roland65@free.fr) Based on OOoLatex, by Geoffroy Piroux (http://ooolatex.sourceforge.net) TexMaths is an addon designed to provide LaTeX support into LibreOffice. LaTeX equations can be inserted as images (SVG or PNG formats) and the LaTeX code is saved into the image attribute for further editing. libreoffice-texmaths-0.43/source/texmaths/help/help.fr000064440400000003424713206777051024772 0ustar kkremitzkikkremitzki 1. La barre d'outils TexMaths Une fois l'extension TexMaths installée, vous devriez voir apparaître une nouvelle barre d'outils dans Writer, Impress et Draw. Il s'agit de la barre d'outils TexMaths. Cette barre d'outils comporte quatre icônes dans Writer et seulement trois dans Impress et Draw. Dans Writer, un clic sur l'icône Équations TexMaths (celle avec le symbole Pi bleu) lance la macro Équations TexMaths. La seconde icône à droite permet de lancer la macro Équations numérotées TexMaths. La troisième icône (avec les outils) ouvre le dialogue Configuration système TexMaths et enfin, la quatrième icône (celle avec l'engrenage) est affectée à la macro Recompiler les équations TexMaths. Veuillez noter que la deuxième icône n'est pas présente dans Impress ni Draw. 2. Démarrer avec TexMaths Pour insérer votre première équation dans un document, tapez simplement une instruction LaTeX dans le champ de texte de la fenêtre Équations TexMaths et ensuite cliquez sur le bouton LaTeX. Ex. : x(t) = \mu ^2 (t) doit produire l'équation x(t)=µ²(t) 3. Sélectionner le format d'image TexMaths peut générer et insérer deux types d'images dans un document LibreOffice. Pour sélectionner le format d'image désiré, utilisez le sélecteur situé dans le cadre Format d'image. Le format d'image par défaut est le format vectoriel SVG. Il permet de redimensionner les équations LaTeX sans perte de précision et ne nécessite d'installer aucune police mathématique supplémentaire dans LibreOffice, car les symboles mathématiques sont simplement tracés sous forme de courbes. Le format SVG est le format conseillé (et le format par défaut) mais il peut exister quelques problèmes de compatibilité lors de l'export de documents LibreOffice vers d'anciennes versions de MS Office, comme MS Office 2000 (voir plus bas). Le second format possible est le format d'image PNG, qui est un format bitmap. Par conséquent, vous devez spécifier une résolution pour l'utiliser. Bien que 600 dpi soit la résolution par défaut, vous pouvez choisir parmi plusieurs valeurs prédéfinies. Vous pouvez également définir la transparence de l'image, ce qui peut s'avérer utile si votre document possède un fond coloré. Il ne devrait pas exister de problèmes de compatibilité avec ce format lors de l'export de documents vers MS Office, quelle que soit la version. Veuillez noter que chacun des formats n'est disponible que si le programme externe correspondant (dvisvgm pour le SVG et dvipng pour le PNG) est installé sur votre système avec son chemin configuré dans Configuration système TexMaths. Au moins un de ces deux programmes est requis pour utiliser TexMaths. 4. Taille de police TexMaths peut gérer différentes tailles de caractères pour vos équations. Pour modifier la taille de police, utilisez le sélecteur situé dans le cadre Taille de police. Vous pouvez choisir parmi différentes tailles de polices prédéfinies ou bien entrer une taille particulière si celle-ci n'est pas listée. 5. Transparence Il est possible de basculer la transparence des images d'équations en cochant l'option Transparence dans la fenêtre Équations TexMaths. Cela peut s'avérer utile lorsque le fond du document n'est pas blanc. La transparence peut désormais être modifiée pour les deux formats SVG et PNG. 6. Type d'équations TexMaths peut générer trois types d'équations LaTeX : - les équations display - les équations inline display - les équations LaTeX Pour choisir un type d'équation, utilisez le bouton radio situé dans le cadre Type d'équation. Pour générer des équations display ou inline display, il vous suffit de sélectionner le type d'équations approprié et ensuite de taper le texte de votre équation dans le champ de texte de la fenêtre Équations TexMaths. Ex. : Pour générer le symbole grec alpha, tapez simplement \alpha Les équations inline display sont obtenues de la même manière, la différence résidant dans l'aspect de l'équation, qui s'intègre mieux dans le texte. Par exemple, l'indice et l'exposant du signe somme sont affichés à côté de lui et non pas au dessous et au dessus. Ces deux types d'équations sont idéales pour de simples équations écrites sur une ligne, et de plus, l'alignement vertical est correct. Cependant, ces types d'équations ne permettent pas de générer des équations multi-lignes ou de travailler avec des environnements LaTeX plus complexes. Dans ce cas, sélectionnez le type d'équations LaTeX et tapez votre équation entre des instructions d'environnement \begin{} et \end{}. Ex. : Tapez les lignes suivantes pour afficher une équation de trois lignes, alignées sur le signe égal. \begin{align*} x &= 1 \\ y &= 2x+1\\ &= 3\\ \end{align*} 7. Nom d'équation Vous pouvez entrer un nom d'équation dans la fenêtre Équations TexMaths. Cela peut notamment s'avérer utile dans Impress pour retrouver une équation à partir de son nom, afin de lui appliquer une animation. 8. Génération d'équations LaTeX Une fois que vous avez tapé une équation, vous pouvez la générer en cliquant sur le bouton LaTeX de la fenêtre Équations TexMaths. Cette opération génère une image de votre équation dans les format, type et taille que vous avez sélectionnés. 9. Équations numérotées sous Writer Pour insérer une équation numérotée, il suffit de cliquer sur l'icône Équations numérotées TexMaths, de taper le code LaTeX de votre équation, puis de cliquer sur le bouton LaTeX. Une équation centrée, numérotée est alors automatiquement insérée dans votre document Writer. Vous pouvez également choisir l'alignement (à droite ou à gauche), l'espacement ainsi que la légende d'équations que vous désirez dans l'onglet Options de la fenêtre Configuration système TexMaths. 10. Éditer des équations LaTeX Dans un document LibreOffice, sélectionnez une image d'équation et cliquez sur l'icône Équations TexMaths de la barre d'outils TexMaths (ou bien utilisez un raccourci clavier si vous en avez défini un). La fenêtre Équations TexMaths s'ouvre alors et le texte de votre équation est sélectionné. Il vous suffit d'éditer ce texte et de cliquer sur le bouton LaTeX pour générer l'équation modifiée. Vous pouvez bien sûr fermer un document, l'ouvrir à nouveau et éditer les équations qui y figurent. 11. Texte vers LaTeX sous Writer Tapez du code LaTeX directement dans un document Writer (sans ouvrir la fenêtre TexMaths), sélectionnez ce texte et cliquez sur l'icône Équations TexMaths (ou utilisez le raccourci clavier approprié si vous en avez défini un) pour convertir votre texte en une image d'équation LaTeX. Le format d'image, la taille ainsi que le type d'équation seront ceux que vous avez définis par défaut dans les Préférences TexMaths. 12. Préférences TexMaths est fourni avec certains réglages par défaut. Si ces réglages ne vous conviennent pas, vous pouvez les modifier grâce à la fenêtre Préférences TexMaths, obtenue en cliquant sur le bouton Préférences. Cette fenêtre vous permet de modifier le format d'image, la taille de police, le type d'équation, etc., pour chaque type de document LibreOffice. Vous pouvez enregistrer vos nouveaux réglages, restaurer les réglages par défaut ou charger des réglages déjà enregistrés. 13. Préambule LaTeX Un clic sur le bouton Préambule permet d'afficher la fenêtre Préambule TexMaths qui vous permet d'ajuster le préambule LaTeX. Par exemple, pour générer des équations en couleurs, décommentez les trois lignes suivantes du préambule par défaut : %\definecolor{fgcolor}{RGB}{0,0,255} %\definecolor{bgcolor}{RGB}{255,255,255} %\pagecolor{bgcolor}\color{fgcolor} Ensuite, modifiez la valeur de la couleur RGB selon vos souhaits et enregistrez le préambule. Les nouvelles équations posséderont alors le schéma de couleurs que vous avez défini dans le préambule. Notez que les équations ayant une couleur de fond ne sont pas transparentes, même si l'option de transparence a été spécifiée. Il est nécessaire de supprimer la couleur de fond dans le préambule pour retrouver la transparence. À partir de la version 0.38 de TexMaths, le préambule est stocké dans les propriétés du document. Chaque document peut donc avoir son propre préambule. Le préambule par défaut est global et ne peut être modifié. 14. Commandes \input, \include et \usepackage À partir de la version 0.41 de TexMaths, des commandes LaTeX \input et \include peuvent être ajoutées de façon à inclure le contenu de fichiers LaTeX (fichiers .tex) dans les équations. Les fichiers insérés doivent se trouver dans le même dossier que le document en cours. Ex. : Dans le document mon_doc.odt, la commande LaTeX : \include{mes_equations} peut être utilisée pour inclure le contenu du fichier mes_equations.tex, à condition que celui-ci soit situé dans le même dossier que mon_doc.odt. Il est aussi possible d'utiliser des styles personnalisés de documents LaTeX (fichiers .sty) grâce à la commande \usepackage, qui doit être insérée dans le préambule LaTeX. Le fichier .sty doit alors se trouver dans le même dossier que le document courant. Ex. : Dans le document mon_doc.odt, la commande LaTeX : \usepackage{mon_style} insérée dans le préambule permet de prendre en compte le fichier de style LaTeX mon_style.sty, qui doit se trouver dans le même dossier que mon_doc.odt. 15. Recompilation des équations TexMaths Lorsqu'un document (dans Writer, Impress ou Draw) contient des centaines d'équations, il peut s'avérer utile de changer la taille, le format, la transparence, etc., de ces équations en une seule opération. C'est le but de la macro Recompiler les équations. Lorsque vous cliquez sur l'icône associée (celle avec l'engrenage) de la barre d'outils TexMaths, un dialogue apparaît où il est possible de modifier un certain nombre de paramètres des équations TexMaths. Il est possible de ne pas modifier certains paramètres. Dans une liste, il faut alors sélectionner l'entrée "---" et dans une case à cocher, il faut choisir l'option '-'. Dans les trois types de documents, vous pouvez recompiler toutes les équations d'un document en sélectionnant l'option Recompiler toutes les équations. Dans les documents Writer, en sélectionnant l'option Recompiler les équations sélectionnées, vous pouvez choisir de ne recompiler que les équations situées dans la zone de texte sélectionnée. Notez qu'en raison de certaines limitations des sélections sous LibreOffice, cette macro ne permet pas de recompiler les équations situées dans les tableaux, les cadres de texte, l'en-tête et le pied de page. Si nécessaire, vous pouvez recompiler ces équations en les sélecctionnant une par une et en les éditant de la manière habituelle. Dans les documents Impress et Draw, en sélectionnant l'option Recompiler les équations de la diapositive, vous pouvez choisir de ne recompiler que les équations de la diapositive courante. Lorsque tous les paramètres et options ont été fixés, lancez la macro en cliquant sur le bouton Exécuter et les équations seront recompilées. Si des centaines d'équations doivent être recompilées, l'opération peut durer un certain temps et demande un peu de patience... 16. Compatibilité avec ooolatex À partir de la version 0.34, TexMaths est compatible avec ooolatex. Cela signifie que si vous avez des documents contenant des équations ooolatex, vous pouvez les éditer avec TexMaths. Sélectionnez les équations une par une, puis lancez la macro Équations TexMaths et modifiez le code LaTeX de vos équations. Vous pouvez ensuite regénérer les équations dans le format que vous souhaitez, SVG ou PNG. 17. Exporter vos documents vers MS Office Si vous envisagez d'exporter vos documents vers MS Office (Word et Powerpoint, quelle que soit la version), vous devriez enregistrer vos documents LibreOffice dans les formats .doc et .ppt et *PAS* dans les formats .docx et .pptx. En effet, bien que LibreOffice puisse produire ces formats, les images d'équations sont mal converties et il y aura donc de sérieux problèmes de rendu sous Word et Powerpoint. Il est également recommandé de cocher l'option de compatibilité verticale Word (dans la fenêtre Configuration système TexMaths) si vous exportez vos documents Writer vers Word. Cela aura pour effet d'améliorer nettement l'alignement vertical sous Word des équations situées dans le texte. À partir de la version 0.38 de TexMaths, les équations SVG sont bien rendues dans Word et Powerpoint 2003 et les versions ultérieures, mais toujours pas dans Word et Powerpoint 2000. Si vous êtes bloqués avec ces vieilles versions, vous devrez utiliser le format PNG. 18. Raccourcis clavier Pour configurer les raccourcis permettant d'ouvrir la fenêtre Équations TexMaths avec ou sans numérotation des équations, cliquez sur le bouton Configuration système TexMaths de la barre d'outils TexMaths et définissez vos raccourcis clavier. Pour les équations sans numérotation, vous pouvez définir un seul raccourci pour toutes les applications ou bien un raccourci différent par application. Du fait que les équations numérotées ne sont disponibles que sous Writer, il n'y a qu'un seul raccourci pour celles-ci. Dans la fenêtre Équations TexMaths, vous pouvez utiliser les raccourcis suivants : - Esc pour fermer la fenêtre et quitter sans générer d'équation - Alt-L ou Ctrl-L pour générer une équation - Alt-P ou Ctrl-P pour afficher la fenêtre Préférences - Alt-B ou Ctrl-B pour afficher la fenêtre Préambule 19. Problèmes Le rendu des équations SVG est buggé dans LibreOffice 3.x (les équations ont un aspect de caractères gras), mais pas dans les versions 4.x ni 5.x. Par conséquent, si vous désirez utiliser le SVG, il vous est recommandé de mettre à niveau LibreOffice en version 4.x ou 5.x. TexMaths peut fonctionner avec Apache Openoffice 3.4.x, mais les équations au format SVG ne sont pas visibles. Cependant, les équations PNG sont correctement rendues. TexMaths fonctionne bien (formats PNG et SVG) avec Apache Openoffice 4.x. Les équations contenant des commandes PSTricks ne peuvent être correctement rendues en PNG à cause de dvipng. Dans ce cas, il faut utiliser le format SVG. libreoffice-texmaths-0.43/source/texmaths/help/help.es000064440400000001677713206777051025002 0ustar kkremitzkikkremitzki 1. Comenzando con TexMaths Equations. Para insertar su primera ecuación en un documento, simplemente escriba las instrucciones LaTex en el campo de texto de la ventana de ecuaciones TexMaths y de clic sobre el botón LaTeX. Ejemplo: x(t) = \mu ^2 (t) debe producir la ecuación x(t)=µ²(t) 2. Seleccionando el formato de la imagen. TexMaths puede generar e insertar dos clases de imágenes en un documento LibreOffice. Para seleccionar el formato de la imagen use el selector ubicado dentro del recuadro Formato de Imagen. El formato de imagen por defecto es formato vectorial SVG. Este permite que las ecuaciones LaTeX se les pueda cambiar el tamaño sin pérdida de calidad y no necesita instalarse ninguna fuente en especial en LibreOffice puesto que los símbolos matemáticos son dibujados usando curvas vectoriales. Este es el formato preferido (y por defecto), pero puede haber algunos problemas cuando se exportan los documentos de LibreOffice a versiones viejas de MS Office como MS Office 2000. El otro formato de imagen soportado es el PNG y es un formato de imagen de mapa de bits. Así, usted tiene que seleccionar una resolución para usarlo. La resolución por defecto se de 600 dpi, pero usted puede seleccionar otros valores distintos de los predefinidos. No debe haber ningún problema de compatibilidad cuando se utiliza el formato PNG para la exportación a documentos de MS Office. Note que cada formato está solamente disponible si el programa externo correspondiente (dvisvgm para SVG y dvipng para PNG) está instalado en su sistema con su ruta ajustada usando el cuadro de configuración de TexMaths. Por lo menos uno de esos dos programas se requiere para que TexMaths corra. 3. Tamaño de la fuente TexMaths puede manejar diferentes tamaños de letra para sus ecuaciones. Para cambiar el tamaño de la fuente use el selector localizado dentro del recuadro del tamaño de fuente. Puede seleccionar entre los tamaños predefinidos o escribir uno de su preferencia si este no está en la lista. 4. Escribiendo ecuaciones TexMaths puede generar tres tipos de ecuaciones LaTeX: - ecuaciones tipo "display" - ecuaciones que se muestran en línea - ecucaciones LaTeX Para seleccionar un tipo de ecuación, use el radio selector localizado dentro del recuadro Tipo de Ecuación. Para generar ecuaciones tipo "display" o ecuaciones en línea tipo display, todo lo que tiene que hacer es seleccionar el tipo adecuado de ecuación y luego escribir el texto de la ecuación en el campo de texto de TexMaths en el diálogo de ecuación de TexMaths. Ejemplo: Para generar la letra griega alpha, escriba \alpha Las ecuaciones tipo "display" que van en línea se obtienen por la misma vía, pero la diferencia es que el estilo de la ecuación que se genera se integra mejor dentro del texto. Por ejemplo, los índices de suma (\sum) y los exponentes se muestran cerca del signo suma y no abajo o arriba. Ambas clases de ecuaciones son ideales para ecuaciones en una línea, el alineamiento vertical con el texto es correcto pero no es posible manejar ecuaciones multi-línea o ambientes más generales LaTeX. Para esa clase de ecuaciones seleccione el tipo de ecuación LaTeX y escriba su ecuación dentro de las estructuras \begin{} y \end{}. Usted puede usar cualquier ambiente de instrucciones LaTeX. Ejemplo: Escriba las siguientes líneas para mostrar una ecuación con tres líneas alineadas sobre el signo igual. \begin{align*} x &= 1 \\ y &= 2x+1\\ &= 3\\ \end{align*} 5. Genere ecuaciones LaTeX Una vez que usted ha escrito una ecuación, puede generarla dando clic sobre el botón denominado LaTeX del cuadro de diálogo TexMaths. Esto genera una imagen de su ecuación en el formato, tipo y tamaño que usted seleccionó. 6. Numerando las ecuaciones en Writer Numerar las ecuaciones es tan simple como hacer clic sobre el icono TexMaths numerado (o dando una combinación de teclas que usted haya definido), escriba su ecuación y de clic sobre el botón LaTeX. Una ecuación centrada y numerada se inserta automáticamente en su documento Writer. Igualmente puede seleccionar el espaciado que desee y la etiqueta de la ecuación en la pestaña de opciones de Sistema de configuración de TexMaths. 7. Edite ecuaciones LaTeX Dentro de un documento LibreOffice, seleccione una imagen de una ecuación (ya creada con TexMaths) y de clic sobre el icono de ecuación TexMaths en la barra de herramientas (o use una combinación de teclas que haya definido). Esta operación muestra el cuadro de diálogo de TexMaths de la ecuación que ha seleccionado. Edite este texto y de clic sobre el botón LaTeX para generar la ecuación modificada. De hecho usted puede cerrar un documento, abrirlo nuevamente y editar las ecuaciones que ha guardado. 8. Texto a LaTeX en Writer Escriba algún código LaTeX directamente en el documento Writer (p.e. sin abrir el cuadro de diálogo TexMaths), seleccione el texto y de clic sobre el icono de ecuación de TexMaths (o use la combinación de teclas que haya definido). El texto seleccionado es convertido a una imagen de ecuación LaTeX. El formato aplicado a la imagen, el tamaño y el tiempo de ecuación son los seleccionados por defecto en el cuadro de diálogo de preferencias de TexMaths. 9. Compatibilidad con ooolatex Comenzando con la versión 0.34, TexMaths es compatible con ooolatex. Esto significa que si usted tiene un documento que contiene ecuaciones ooolatex, puede editarlas seleccionándolas (una por una) y llamando el macro TexMaths para ecuaciones. Puede entonces modificar el código LaTeX y regenerar la ecuación ya sea en formato SVG o PNG, como usted prefiera. 10. Preferencias TexMaths viene con algunos ajustes por defecto. Si estos ajustes no cumplen con sus necesidades puede cambiarlos usando el cuadro de diálogo Preferencias de TexMaths, el cual se llama dando clic en el botón Preferencias. Este cuadro de diálogo le permite cambiar el formato de la imagen, el tamaño de la fuente, el tipo de ecuación, etc., para cada tipo de documento de LibreOffice. Puede entonces guardar sus nuevos ajustes, restaurarlos a los que vienen por defecto o cargar ajustes que haya guardado con anterioridad. 11. El preámbulo LaTeX Dando clic sobre el botón preámbulo se muestra el cuadro de diálogo Preámbulo, el cual le permite ajustar su preámbulo LaTeX. Por ejemplo, para generar ecuaciones coloreadas, descomente las siguientes dos líneas de preámbulo por defecto, cambie el valor del color RGB al que desee y grabe su preámbulo. % \definecolor{myColor}{RGB}{0,0,255} % \pagecolor{white}\color{myColor} Ahora, todas las ecuaciones nuevas tendrán el esquema de color que haya definido en el preámbulo. 12. Combinaciones de teclas Para configurar las combinaciones de teclas lance TexMaths (con o sin numeración), de clic sobre el sistema de configuración TexMaths y defina sus combinaciones preferidas. Para ecuaciones sin numeración usted puede tener una única combinación de teclas en todas las aplicaciones o diferentes para cada una. Puesto que las ecuaciones numeradas se pueden usar sólo en Writer, existe sólo una combinación de teclas para él. Dentro del cuadro de diálogo de TexMaths usted puede usar las siguientes combinaciones de teclas: - Esc para cerrar el cuadro de diálogo sin generar la ecuación - Alt-L or Ctrl-L para generar una ecuación - Alt-P or Ctrl-P para mostrar el diálogo de preferencias - Alt-B or Ctrl-B para mostrar el diálogo del preámbulo libreoffice-texmaths-0.43/source/texmaths/help/description.fr000064440400000000102213206777051026346 0ustar kkremitzkikkremitzki Un éditeur d'équations LaTeX pour LibreOffice http://roland65.free.fr/texmaths Copyright (c) 2012-2017 Roland Baudin (roland65@free.fr) Basé sur OOoLatex, par Geoffroy Piroux (http://ooolatex.sourceforge.net) TexMaths est une extension permettant de créer des équations LaTeX dans LibreOffice. Les équations peuvent être insérées sous forme d'images (formats SVG ou PNG) et le code LaTeX correspondant est enregistré dans les attributs d'image, ce qui permet d'éditer ultérieurement les équations. libreoffice-texmaths-0.43/source/texmaths/help/description.es000064440400000000075613206777051026363 0ustar kkremitzkikkremitzki Un editor de ecuaciones LaTeX para LibreOffice http://roland65.free.fr/texmaths Copyright (c) 2012-2017 Roland Baudin (roland65@free.fr) Basado en OOoLatex, por Geoffroy Piroux (http://ooolatex.sourceforge.net) TexMaths es un complemento diseñado para dotar a LibreOffice de soporte para LaTeX. Las ecuaciones LaTeX pueden insertarse como imágenes (formatos SVG o PNG) y el código LaTeX es grabado dentro de los atributos de imagen para futuras ediciones. libreoffice-texmaths-0.43/source/texmaths/help/help.en000064440400000003016613206777051024761 0ustar kkremitzkikkremitzki 1. The TexMaths toolbar Once the TexMaths extension is installed into LibreOffice, you should see a new toolbar in Writer, Impress and Draw. This is the TexMaths toolbar. In Writer, this toolbar is made of four icons, while in Impress and Draw it has only three. In Writer, clicking on the left most icon (the one with the blue Pi symbol) launches the TexMaths Equations macro. The second icon is used for TexMaths Numbered Equations. The third icon (with the tools) opens the TexMaths Sysconfig dialog. Finally, the right most icon (featuring a gear) is bound to the TexMaths Recompile Equations macro. Note that in Impress and Draw, the second icon is not present. 2. Getting started with TexMaths Equations To insert your first equation into a document, click on the TexMaths Equations icon from the TexMaths toolbar. Then type a LaTeX math instruction in the text field of the TexMaths Equations window and at last click on the LaTeX button. Ex: x(t) = \mu ^2 (t) should produce the equation x(t)=µ²(t) 3. Selecting the image format TexMaths can generate and insert two kinds of images in a LibreOffice document. To select the image format, use the selector located within the Image Format frame. The default image format is the SVG vector format. It allows LaTeX equations to be resized without precision loss and does not need any special math font to be installed in LibreOffice, because math symbols are simply drawn using curves. This is the preferred (and default) format but there can be some issues when exporting LibreOffice documents to MS Office old versions, like MS Office 2000 (see below). The other supported image format is PNG and is a raster image format. Thus, you have to select a resolution to use it. While 600 dpi is the default resolution, you can choose among several predefined values. There should be no compatibility issues when using PNG format for MS Office document export. Note that each format is only available if the corresponding external program (dvisvgm for SVG and dvipng for PNG) is installed onto your system with its path set using the TexMaths System Configuration dialog. At least one of these two programs is required to run TexMaths. 4. Font size TexMaths can handle different character sizes for your equations. To change the font size, use the selector located within the font size frame. You can choose between predefined font sizes or type the one you prefer if it is not listed. 5. Transparency You can toggle the equation image transparency by checking the Transparency checkbox in the TexMaths dialog box. This can be useful when the document background is not white. Transparency can now be used with both SVG and PNG image formats. 6. Equation type TexMaths can generate three types of LaTeX equations: - display equations - inline display equations - LaTeX equations To select an equation type, just use the radio button located within the Equation Type frame. To generate display equations or inline display equations, all you have to do is to select the appropriate equation type and then type the text of your equation in the text field of the TexMaths Equations dialog. Ex: To generate the Greek alpha symbol, just type \alpha Inline display equations are obtained by the same way, but the difference is the style of the generated equation which is better integrated within a text. For example, sum index and exponent are displayed besides the sum sign and not below or above. Both kinds of equations are ideal for simple one line equations and vertical alignment within text is correct, but they cannot handle multiline equations or more general LaTeX environments. For that kind of equations, select the LaTeX equation type and type your equation within \begin{} and \end{} instructions. You can use any LaTeX environment instructions. Ex: Type the following lines to display a three lines equation, aligned on the equal sign. \begin{align*} x &= 1 \\ y &= 2x+1\\ &= 3\\ \end{align*} 7. Equation name In the TexMaths Equations dialog, you can enter a label in the Name text field. This can be used to retrieve and equation by its name and could help when dealing with animations in Impress. 8. Generate LaTeX equations Once you typed an equation, you can generate it by clicking on the LaTeX button of the TexMaths Equations dialog. This generates an image of your equation in the format, type and size you selected. 9. Numbering equations in Writer Numbering equations is as simple as clicking on the TexMaths Numbered Equations icon (or entering a keyboard shortcut if you have defined one), enter your equation and click on the LaTeX button. A centered, numbered equation is then automatically inserted in your Writer document. You can also select the spacing you want and the equation caption in the Options Tab of the TexMaths System Configuration dialog. 10. Edit LaTeX equations Within a LibreOffice document, select an equation image (already generated using TexMaths) and click on the TexMaths Equations icon in the TexMaths toolbar (or use a keyboard shortcut if you have defined one). This shows up the TexMaths Equations dialog with the text of your equation selected. Just edit this text and click on the LateX button to generate the modified equation. You can of course close a document, open it again and edit your saved equations. 11. Text to LaTeX in Writer Type some LaTeX code directly within a Writer document (i.e. without opening the TexMaths dialog), select the text and click on the TexMaths Equations icon (or use a keyboard shortcut if you have defined one). The selected text is then silently converted to a LaTeX equation image. The applied image format, equation size and equation type are the default ones defined in the TexMaths Preferences. 12. Preferences TexMaths comes with some default settings. If these settings don't suit your needs, you can change them using the TexMaths Preferences dialog which is obtained by clicking on the Preferences button. This dialog allows you to change the image format, font size, equation type, etc., for each type of LibreOffice document. You can then save your new settings, restore default ones or load already saved settings. 13. LaTeX Preamble Clicking on the Preamble button shows the TexMaths Preamble dialog that allows you to adjust your LaTeX preamble. For example, to generate colored equations, uncomment the following three lines of the default preamble, change the RGB color value to what you want, and save the preamble. %\definecolor{fgcolor}{RGB}{0,0,255} %\definecolor{bgcolor}{RGB}{255,0,0} %\pagecolor{bgcolor}\color{fgcolor} Now, all new equations will have the color scheme you have defined in the preamble. Note that equations with a background color are not transparent anymore, even if the transparency option was checked. Therefore, you must remove the colored background if you want transparency. Starting with TexMaths 0.38, the preamble is stored into the document properties. This way each document can have its own preamble. Note the default preamble is global and can't be changed. 14. \input, \include and \usepackage commands Starting with TexMaths 0.41, \input and \include LaTeX commands can be used to insert the content of a LaTeX (.tex) text file. The inserted .tex files are assumed to be located in the same directory as the document. Ex: In the document my_doc.odt, the LaTeX command: \include{my_equations} can be used to insert the content of the LaTeX file my_equations.tex provided that this file is located in the same directory as my_doc.odt. There is also the possibility to use custom .sty files through the use of \usepackage commands. These commands have to be inserted in the preamble and then (if desired) stored in the current document. The .sty files have to be located in the same directory as the document. Ex: In the document my_doc.odt, the document style my_style.sty can be used by adding to the LaTeX preamble the command: \usepackage{my_style} The file my_style.sty has to be located in the same directory as my_doc.odt otherwise this won't work. 15. Recompilation of TexMaths equations When a document (in Writer, Impress or Draw) contains many equations, it can be useful to be able to change their font size, transparency, image format, etc., in a single shot. This is the purpose of the TexMaths Recompile Equations macro. Clicking on the related toolbar icon (the one with the gear) opens a dialog where you can change a number of equation parameters, and the preamble. If you don't want to change a parameter from a list, then select the '---' entry of that list. For a check box, select the '-' state if you don't want to change the related parameter. In any of the three document types, you can recompile all equations from the document by selecting the Recompile All Equations option. In Writer documents, by selecting the Recompile Selected Equations option, you can choose to recompile only equations that are located within the selected text area. Note that, due to some limitations with selections in LibreOffice, this macro does not recompile equations located in tables, text frames, header and footer. If needed, you can recompile those equations one by one, by editing them the usual way. In Impress and Draw documents, by selecting the Recompile Equations from Slide option, you can recompile only equations that are located within the current slide. When all parameters and options have been set, then click on the Run button and all or selected equations should be updated with the new parameter values. When dealing with hundreds of equations, this can take a while, so please be patient. 16. Compatibility with ooolatex Starting with version 0.34, TexMaths is compatible with ooolatex. This means that if you have a document that contains ooolatex equations, you can edit those equations by selecting them (one by one) and calling the TexMaths Equation macro. You can then modify the LaTeX code and regenerate the equation either in either SVG or PNG format, as you prefer. 17. Exporting documents to MS Office If you plan to export your documents to MS Office (Word and Powerpoint, whatever versions), you should save your LibreOffice documents to .doc and .ppt formats, *NOT* to .docx or .pptx formats. Indeeed, while LibreOffice can produce these formats, the equation images are badly converted and there will be severe issues when rendering them in Word or Powerpoint. It is also recommended to set the Word vertical alignment compatibility option (in the TexMaths System Configuration dialog) if your Writer documents have to be exported to Word. This will greatly improve in Word the vertical alignment of in text equations. Note that it may even be necessary to manually adjust the vertical alignment of equations in Word. Starting with TexMaths 0.38, exported SVG equations are well rendered in Word and Powerpoint 2003 and above, but still not in Word and Powerpoint 2000. So if you're stuck with these rather old versions, you'll have to use the PNG format. 18. Keyboard shortcuts To configure shortcuts to launch the TexMaths Equations with or without numbering, click on the TexMaths System Configuration button of the TexMaths toolbar and define your shortcuts. For equations without numbering, you can have a single shortcut for all applications or a different one for each. Since numbered equations can only be used in Writer, there is only one shortcut for them. Within the TexMaths Equations dialog, you can use the following shortcuts: - Esc to close the dialog without generating and equation - Alt-L or Ctrl-L to generate an equation - Alt-P or Ctrl-P to display the Preferences dialog - Alt-B or Ctrl-B to display the Preamble dialog 19. Issues SVG rendering is buggy in LibreOffice versions 3.x (equations appear as if they were written in bold face), but it works well in versions 4.x or 5.x. So if you want to use SVG, I recommend to upgrade LibreOffice to version 4.x or 5.x. TexMaths can also be used in Apache Openoffice 3.4.x, but SVG rendering is completely broken. However, PNG equations are well rendered. TexMaths works well (PNG and SVG formats) in Apache Openoffice 4.x. Equations that include PSTtricks commands cannot be rendered correctly as PNG images because of dvipng. You can safely use SVG format instead. libreoffice-texmaths-0.43/source/texmaths/ChangeLog000064440400000004042613206777051024327 0ustar kkremitzkikkremitzki0.43 - Fixed wrong SVG equation size in LibreOffice 5.2.x and above - Fixed missing parentheses that break TextMaths in LibreOffice 5.3.1 0.42 - The TexMaths Recompile Equations macro now allows to work on a selected text area (in Writer) or on the current slide (in Impress and Draw). There are some limitations in Writer, see the documentation - Workaround for a crash with LibreOffice 5.x on Windows: do not restore the clipboard in this case - Added a left aligned caption mode for numbered equations (ticket #21) - Keep the paragraph style when inserting an equation (bug #20) 0.41 - Updated french translation - Updated help files - There is now a different transparency option for each document type - Fixed a crash in LibreOffice 4.3.x (thanks to Water Qian) - Updated german translation (thanks to Lars Kapp) - Fixed Addons.xcu to let the toolbar buttons appear in both Libreoffice 4.x and OpenOffice 4.x - Preserve Z order of graphics for Impress and Draw documents (patch by Daniel Fett) - Fixed a crash when the preamble is ignored and the LaTeX equation does not contain a document class - Added an Help button to the sysconfig and recompile dialogs - Added resize buttons the Help window - Fixed a problem where the sysconfig dialog appeared again and again if the helper programs were not found - Added a macro and a GUI to recompile all TexMaths equations in a Writer, Impress or Draw document (initial patch by Daniel Fett) 0.40 - Added an option to the preamble dialog that allows ignoring the preamble. This can be useful to convert LaTeX equations written with a foreign software to TexMaths (patch by Daniel Fett) - Now we use png icons (instead of bmp) as toolbar icons. This improves the transparency rendering - Fixed the problem where the MakeEquation() macro couldn't be called without dialog anymore - Added the ability to use \include and \input commands with local .tex files, and also local .sty files with the \usepackage command in preamble (patch by Daniel Fett) - Now, clicking on Undo (or pressing Ctrl-Z) works as expected in Impress and Draw - Added the "-shell-escape" option to the latex command. This allows using the package minted, as requested by some users - Reduced the size of the help dialog, because it could not be viewed entirely on monitors having 1024x768 resolution - Added a name field to the main dialog. This allows giving a name to equations, and can be useful in Impress when dealing with animations - Fixed the problem with lost animations in Impress when editing equations (thanks to Daniel Fett for his patch) 0.39 - Fixed the preamble bug where newline characters were dropped - Sometimes the position of an edited equation was wrong; this is now hopefully fixed - Fixed a resizing bug that occured sometimes when the equation is located at the end of the line - Added a line to the default preamble to enable sans-serif font - Now only align, gather, flalign and multline environments are forced to LaTeX mode. This fixes some problems with other environments, like matrix or pmatrix - Added an error message when the Draw component is not installed and fixed various errors with uninstalled Writer or Impress components - Fixed the random order of the controls when navigating using the Tab key - Fixed the Help dialog menu bar close button that didn't work - Fixed a potential division by zero in function SavePosSize(). Thanks to Federico Di Sante - Fixed a problem in some equations with SVG format and transparency enabled, where rectangles (fraction bar, square root bar, etc.) were not displayed - Image format, resolution and transparency are now retained when editing an existing equation 0.38 - The LaTeX preamble is now stored locally into the document properties. So, each document can have a different preamble as requested by some users. - Equation attributes are now stored into the image title and description instead of the UserDefinedAttributes property. This allows equation images to be pasted as Draw images instead of GDI images, and fixes the bug that prevented to edit Writer equations pasted to Draw or Impress. As a side effect, the poor SVG rendering quality that was only visible in Impress and Draw (in LibreOffice 3.5.x and 3.6.x) is now also visible in Writer. But this problem is fixed in LibreOffice 4.0.x. - Added German translation (thanks to Lars Kapp) 0.37 - Fixed a bug that occurred in text to LaTeX mode when the equation starts with \begin - Workaround for the random error UnsupportedFlavorException that sometimes appears with some clipboard contents - Workaround for a random bug that occurs in SavePosSize() when convX or convY are equal to zero 0.36 - Updated the help text - Fixed the incorrect help path string in the sysconfig dialog. Now we detect the system type and modify the string accordingly - Added a transparency option to be used with the png image format. This allows to work with transparent png equations, or to use an opaque color background. The internal graphic format used for transparent PNG images is now SVXB (Starview Bitmap/Animation, code 12) for Linux and Mac OS, and GDI (code 3) for Windows, because the bitmap format does not allow a transparent background - Added spanish translation (thanks to Luis Jaime Salazar Ramirez) - Restored the Word compatibility option for vertical alignment. Equations are now verticaly centered when Word compatibility is requested, otherwise they are aligned to base line. Numbered equations are always vertically centered - Force the equation type to "latex" when the latex code starts with \begin (thanks to Luis Jaime Salazar for this tip) - Fixed a run time error in the sysconfig dialog on Windows - Fixed window resizing that didn't work in Debian Linux 64 bits - When editing equations, keep the anchor mode of the image - Fixed a crash that occurred when editing equations within tables. Now equations can be edited within tables or frames - Fixed two bugs that prevented TexMaths to work properly when the programs latex, dvipng or dvisvgm are not located in the path. These bugs affected Mac OS X where these program are located in /usr/texbin which is not in the system path 0.35 - PNG images are now pasted as bitmap format for better compatibility with MS Office. This has no impact on LibreOffice documents - Fixed a problem with the position of the equations after their edition. They were often misplaced in the text. This should be fixed now - Prevent running the TexMaths Equation macros in Writer preview mode - Added a border to Writer equations for better readability - Removed the Word compatibility option for vertical alignment. All equations are now vertically centered - Added to the sysconfig dialog an option that allows to change the numbering level 0.34 - TexMaths now tries to find at first run the paths where external programs are installed - Added compatibility with ooolatex - Fixed problem of SVG equations not perfectly drawn - Fixed problem with drive changing on Windows (thanks to Stefan Sager) 0.33 - Improved equation selection usability (equations are now pasted as GDI images) - Removed the Word 2000 PNGCompat option - Added a Text to LaTeX feature for Writer : type some LateX code in your document, then call TexMaths to directly convert the text to a LaTeX equation, without opening the TexMaths dialog 0.32 - Added a vertical alignment compatibility option for improving export towards Word documents - Added four buttons to resize the TexMaths Equation window - Changed the way shortcuts are stored to the registry. The new scheme allows to keep shortcuts between TexMaths updates - Display an error message when Equations and NumberedEquations modules have the same shortcut - Don't display an error message if the shell or batch script is not found. Instead, silently generate the script - Reorganized the About dialog to present things like in the Sysconfig dialog - The position and size of the TexMaths Equation window is now automatically saved - Fixed some typos in the french translation - Set equation numbers as (Chapter.Number) when there are chapters in the document - Added an option to the System Config dialog to select the text displayed before numbered equations 0.31 - Fixed the wrong equation generation on Linux systems. This was due to /bin/sh pointing to the dash shell and not on the bash shell. Strangely, the shell script used to generate equations doesn't work with the dash shell, but I don't know why! So I replaced /bin/sh with /bin/bash and everything is OK now. However, this means that TexMaths will not work if bash is not installed... - Fixed the makepkg script : this script only works with bash 0.30 - Added partial Danish translation (thanks to Leif Lodahl) - Redesign of the System Config dialog. The new dialog has tabs and is smaller - The help dialog is now non modal. The user can thus work in TexMaths with the help dialog opened - Defined a default button for each dialog 0.29 - Fixed a bug that made TexMaths not work under LibreOffice 3.3.3 (space character after &_) 0.28 - Added a "PNG compatibility with Word 2000" option on non Windows systems. This is because equations look nicer on Libreoffice when this option is not used. So the user who doesn't care about Word 2000 would benefit from disabling this option - Added two options to allow inserting a paragraph break before or after a numbered equation - Fallback to english locale when the help and description files are not available in the current locale 0.27 - Since equations can be produced separately by dvipng alone or dvisvgm alone, these two external programs are now made optional. Only one of them is required. This allows TexMaths to work even if the user doesn't have installed one of these programs - Improved the SysConfig dialog - Fixed the paths in the batch script for Windows - Added "..." to some menu button names - Changed the name of the SysConfigDialog() function in the About module to AboutDialog() - Fixed the second radio button in the Preferences dialog that did not function properly (activation sequence number problem) - Fixed a problem in LaTeX mode, where the GetVertShift() function is called and the tmpfile.bsl does not exist - Fixed the right margin problem for numbered equations - In Writer, move one character right of the equation, to be able to type text just after 0.26 - Added a macro and a toolbar button to write numbered equations in Writer - Added a shortcut for that macro - Added an icon and renamed other icons 0.25 - On Windows the tricky process used to generate a PNg image (for maximum MS Word compatibility) doesn't work reliably and I didn't find why. So I fall back to the simple paste process on this system 0.24 - Added an help button to the main dialog, reorganized directories and renamed some files - Added 72, 96, and 120 dpi predefined values and fixed a bug in the dpi selector control - Fixed an execution error that occurred when the image point size is 0 - Fixed the way Prefrences are handled. Now the strategy is the following : In Preferences dialog, display the config file preferences if they exist, otherwise display the default preferences. If the save button is clicked, set the TexMaths Equations preferences to the values of the config file - Display a syntax error message when the generated equation image has size 0 0.23 - The clipboard content is not lost anymore when exiting TexMaths. We save the clipboard when entering TexMaths and then we restore it before exiting - Set the keyboard shortcut for generating LaTeX equations as Alt-L or Ctrl-L 0.22 - In Writer, changed the way images are generated to ensure maximum compatibility with MS Word 2000 or 2003. This is not perfect but works better now. For PNG images, we use a special paste with bitmap format and for SVG images we use a simple paste. - Renamed icons 0.21 - Fixed the problem of equations inserted within a paragraph (not at the start or not at the end) that were not correctly placed - Fixed an untranslated string 0.20 - Removed the handle of plural forms in the gettext implementation because it is not used in TexMaths 0.19 - Replaced the old make.sh script with a new one that also updates the po files - Use gettext localization also for dialogs 0.18 - Use gettext implementation from Pierre Chef for string localization 0.17 - Initial dialog localization (in French) using the standard way - Designed new icons with transparency for TexMaths 0.16 - Rename TexMathsConfig to TexMathsPrefs. We now use the word "preferences" for equation options and "System configuration" for other configuration parameters - Removed the Cancel button from the SysConfig dialog - Renamed TexMathsEquation to TexMathsEquations everywhere - On Linux, fixed the TexMaths shell script to allow generating images when minor LaTeX errors are found and also removed the error() function that is not used anymore. The system log is now generated each time the script is run - On Windows, fixed the TexMaths batch script to correctly display the system log 0.15 - Added configuration options for Draw documents - Document type is now guessed using the GetDocumentType() function from Andrew Pytoniak - Many small improvements to the dialogs 0.14 - Added a ConfigSaved property to the registry. This is used to know if the configuration was already saved when starting the program - Removed the Reset button from the configuration dialog 0.13 - The script name is now based on the TexMaths version number. This allows to force the creation of a new script whenever the version changes 0.12 - Use LaTeX code to generate the depth information for baseline alignment of inline and inline display equations. We use a trick from Maarten Sneep, see http://mactextoolbox.sourceforge.net/articles/baseline.html. Thus, the use of preview.sty is no more necessary and color can be used in equations. It also no more necessary to generate a png image to get the depth information with SVG format - The script is now located in the user directory (sUserPath) - The reset button now completely resets the configuration and deletes rc, prb, script and system log file - Fixed the PNG image size in the temporary Draw document - Fixed vertical alignment with text equations - Minor improvements of the main dialog box 0.11 - Fixed the problem with the image dpi button not grayed out for svg in the config dialog - Removed the {picture} commands from the generated LaTeX code because they are not used anymore (?) - Let the text mode work in Writer 0.10 - Some code cleanup and reorganization 0.9 - Fixed compatibility issues with MS Word (inline equations were badly positioned and image object was duplicated when exported to Word) - Position the equation at the center of the visible area in Impress and Draw 0.8 - On Windows, the script is now located in %HOMEDRIVE%\texmaths-%USERNAME%\TexMaths.bat where all space characters are removed from the original %USERNAME% string. The directory is made hidden. In multiuser environment, this allows to install and uninstall the extension without permission problems. 0.7 - Let it work under Windows. Due to a bug in the Shell() command (script paths with spaces don't work) the TexMaths.bat script is located in C:\. This is bad of course, but I didn't manage yet to do something better. 0.6 - Removed the transparent and cropping options because they are not used anymore - PNG resolution is now set using a combo box - Font size are now set using a combo box 0.5 - Now PNG images are generated using dvipng - Fixed the wrong PNG image size by estimating the real screen resolution - Fixed the wrong position of images using the baseline computed by dvipng using the --depth option 0.4 - Fixed the wrong size of SVG equations. This was because when importing the SVG equations, it is splitted in many different shapes and then we imported only the first shape. This is solved by combining all the shapes before copying into the clipboard 0.3 - Code cleanup - Added "Option Explicit" to force declaration of variables. Fixed all missing declarations - Fixed some typos in the original code 0.2 - Fixed declarations like Dim var1, var2 as String, which should be (according to the documentation) Dim var1 as String, var2 as String - Replaced each occurrence of StarDesktop.CurrentComponent with ThisComponent. This allows to run TexMaths within the IDE 0.1 - First version built from OOoLatex 4.0.0 beta 2 - Removed the expand dialog because TexMaths is intended to produce equations as pure graphics image (no need for specific Latex fonts to see the produced equations in LibreOffice, OpenOffice or MS Office) libreoffice-texmaths-0.43/source/texmaths/META-INF/000075540400000000000013206777051023707 5ustar kkremitzkikkremitzkilibreoffice-texmaths-0.43/source/texmaths/META-INF/manifest.xml000064440400000000243113206777051026237 0ustar kkremitzkikkremitzki libreoffice-texmaths-0.43/source/texmaths/makepkg000075540400000000370113206777051024115 0ustar kkremitzkikkremitzki#!/bin/bash # 7/11/2011 # Shell script used (under Linux) to create the TexMaths-.oxt package # The created package can be used on Linux, MacOS X and Windows # The version number must be passed at the command line and is used to update # the description.xml file # Display usage information usage(){ echo "Usage: ./makepkg version_number" echo "Example: ./makepkg 0.39" exit 1 } # Update po files update_po(){ echo echo Updating po files... cd po ./xgettextbas ../TexMaths/*.xba > TexMaths.pot 2> /dev/null for File in `ls *.po 2>/dev/null` do echo $File msgmerge -N $File TexMaths.pot > $File.tmp mv $File.tmp $File done cd .. } # Create package make_package(){ echo echo Making package release... cat description.xml \ | sed s/" tmp.xml mv tmp.xml description.xml href="http://downloads.sourceforge.net/texmaths/TexMaths-${ver}.oxt" echo " TexMaths " > ../TexMaths.update.xml zip -r ../TexMaths-${ver}.oxt \ AddonRegistry.{xcs,xcu} \ Addons.xcu \ ChangeLog \ makepkg \ description.xml \ README \ META-INF/manifest.xml \ Office/UI/*.xcu \ icons/*.{bmp,png} \ TexMaths/*.{xba,xdl,xlb} \ license.txt \ help/* \ po/* } # Main part # Get package version from the description.xml file #ver=`grep "//' | sed 's/ //g'` # Version number must be entered at the command line [ "$1" = "" ] && usage ver=$1 echo Version = $ver # Update po files update_po # Make package make_package # Display message echo echo Done! exit 0 libreoffice-texmaths-0.43/source/texmaths/README000064440400000000113613206777051023430 0ustar kkremitzkikkremitzkiTexMaths is an extension derived from OOoLatex, by Geoffroy Piroux. It provides a simple Latex equation editor for LibreOffice. TexMaths requires the following software to be installed on your computer: - LibreOffice Draw (version 4 or later) - a Latex distribution as TexLive (Linux/ Mac OS X) or Miktex (Windows) - the program dvipng to produce PNG images from dvi files - or the program dvisvgm to produce SVG images from dvi files (only one of dvipng or dvisvgm is required) TexMaths is licensed under the terms of the GNU GPL license (version 2 or later), see the license.txt file for details. libreoffice-texmaths-0.43/source/texmaths/AddonRegistry.xcs000064440400000000373013206777051026047 0ustar kkremitzkikkremitzki