Ajout des macros ApresZotero avec license
This commit is contained in:
parent
0ca4726f51
commit
e12664e881
576
Macros/LibreOffice/ApresZotero/ApZotFunctions.xba
Normal file
576
Macros/LibreOffice/ApresZotero/ApZotFunctions.xba
Normal file
File diff suppressed because one or more lines are too long
40
Macros/LibreOffice/ApresZotero/ApZotGlobalOptions.xba
Normal file
40
Macros/LibreOffice/ApresZotero/ApZotGlobalOptions.xba
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ApZotGlobalOptions" script:language="StarBasic" script:moduleType="normal">REM ***** BASIC *****
|
||||
|
||||
'************************************************************************
|
||||
'* Copyright 2021 by Bastien Dumont (bastien.dumont@posteo.net)
|
||||
'*
|
||||
'* This file is part of the ApresZotero library.
|
||||
'*
|
||||
'* ApresZotero 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 3 of the License, or
|
||||
'* (at your option) any later version.
|
||||
'*
|
||||
'* ApresZotero 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 ApresZotero. If not, see <https://www.gnu.org/licenses/>.
|
||||
'*
|
||||
'************************************************************************
|
||||
|
||||
Public Const nExponentCharSizePercentage As Integer = 33
|
||||
Public Const nExponentCharHeightPercentage As Integer = 58
|
||||
Public Const nBigZoomFactor As Integer = 350
|
||||
Public Const nMaxArray As Integer = 1002
|
||||
Public Const sSeparatorForListOfAbbreviations As String = "|"
|
||||
Public Const sReplacementSeparatorForListOfAbbreviations As String = " : "
|
||||
Public Const sAbbrevRefSeparator As String = " : "
|
||||
Public Const sAbbrevRefSuffix As String = "."
|
||||
Public Const sFirstCitationPrefix As String = ", cité n. "
|
||||
Public Const nDefaultCharHeight As Integer = 12
|
||||
Public Const sGreekTextRegex As String = "[ΑΖΕΡΤΨΥΙΟΠΘΣΔΦΓΗϞΚΛΜΩΞΧϐΒΝαζερτψυιοπθσδφγηϟκλμωξχϐβνϡϠ]*[αζερτψυιοπθσδφγηϟκλμωξχϐβνϡϠ] ?[,;:!.·]?"
|
||||
Public Const GreekFont As String = "IFAO-Grec Unicode"
|
||||
Public Const sBibliographyStyleName As String = "Bibliography 1"
|
||||
Public Const sRectoVersoRegex As String = "[0-9]+[rv](-v)?"
|
||||
Public Const sNumberOrIssueRegex As String = " nos? " ' last character is a non-breakable space
|
||||
</script:module>
|
85
Macros/LibreOffice/ApresZotero/ApZotRevues.xba
Normal file
85
Macros/LibreOffice/ApresZotero/ApZotRevues.xba
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ApZotRevues" script:language="StarBasic" script:moduleType="normal">REM ***** BASIC *****
|
||||
|
||||
'************************************************************************
|
||||
'* Copyright 2021 by Bastien Dumont (bastien.dumont@posteo.net)
|
||||
'*
|
||||
'* This file is part of the ApresZotero library.
|
||||
'*
|
||||
'* ApresZotero 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 3 of the License, or
|
||||
'* (at your option) any later version.
|
||||
'*
|
||||
'* ApresZotero 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 ApresZotero. If not, see <https://www.gnu.org/licenses/>.
|
||||
'*
|
||||
'************************************************************************
|
||||
|
||||
Option Compatible
|
||||
Option Explicit
|
||||
|
||||
Sub REB
|
||||
|
||||
Const mJournal As String = "REB"
|
||||
Const sCitedPrefix As String = ", cité n. "
|
||||
Dim mTitreLong() As String
|
||||
mTitreLong = Array("Acta Sanctorum", "Acta Conciliorum Oecumenicorum", "Analecta Bollandiana", "Archives de l'Orient chrétien", "Byzantinische Forschungen", "Bibliotheca Hagiographica Graeca", "Byzantine and Modern Greek Studies", "Byzantinisch-Neugriechische Jahrbücher", "Byzantinoslavica", "Byzantion", "Byzantinische Zeitschrift", "Cahiers Archéologiques", "Corpus Christianorum, Series Graeca", "Corpus Fontium Historiae Byzantinae", "Clavis Patrum Graecorum", "Corpus Scriptorum Christianorum Orientalium", "Corpus Scriptorum Historiae Byzantinae", "Dictionnaire d'Archéologie Chrétienne et de Liturgie", "Δελτίον τῆς Χριστιανικῆς καὶ Ἀρχαιολογικῆς Ἑταιρείας", "Dictionnaire d’Histoire et de Géographie Ecclésiastiques", "Dumbarton Oaks Papers", "Dictionnaire de Théologie Catholique", "Ἐπετηρὶς Ἑταιρείας Βυζαντινῶν Σπουδῶν", "Échos d'Orient", "Greek, Roman and Byzantine Studies", "Известия Русскаго Археолгическаго Института в Константинополие", "Jahrbuch der Österreichischen Byzantinistik", "Lexikon zur byzantinischen Gräzität", "Lexikon für Theologie und Kirche", "Μεσαιωνικὴ Βιβλιοθήκη", "Medioevo Greco", "Monumenta Germaniae Historica", "F. Miklosich, J. Müller (éd.), Acta et diplomata", "Νέος Ἑλληνομνήμων", "Orientalia Christiana Analecta", "Orientalia Christiana Periodica", "The Oxford Dictionary of Byzantium, I-III, New York – Oxford 1991", "Prosopography of the Byzantine Empire I (641-867)", "Prosopography of the Byzantine World", "Patrologia Graeca", "Patrologie grecque", "Patrologia Latina", "Patrologie latine", "Prosopographisches Lexikon der Palaiologenzeit", "Prosopographie der mittelbyzantinischen Zeit (641-1025)", "Patrologia Orientalis", "Patrologie orientale", "Patristische Texte und Studien", "Revue des Études Byzantines", "Revue des Études Grecques", "Revue des Études Sud-Est Européennes", "Repertorium der griechischen Kopisten", "Rivista di Studi Bizantini e Neoellenici", "Rivista di Studi Bizantini e Slavi", "Studies in Byzantine Sigillography", "Sources Chrétiennes", "Synaxarium Ecclesiae Constantinopolitanae", "Θρησκευτικὴ καὶ Ἠθικὴ Ἐγκυκλοπαιδεία", "Tabula Imperii Byzantini", "Travaux et Mémoires", "Византийский Временник")
|
||||
Dim mAbrev() As String
|
||||
mAbrev= Array("AASS", "ACO", "An. Boll.", "AOC", "BF", "BHG", "BMGS", "BNJ", "BS", "Byz.", "BZ", "CA", "CCSG", "CFHB", "CPG", "CSCO", "CSHB", "DACL", "DChAE", "DHGE", "DOP", "DTC", "EEBS", "EO", "GRBS", "IRAIK", "JÖB", "LBG", "LTK", "MB", "MEG", "MGH", "MM", "NE", "OCA", "OCP", "ODB", "PBE", "PBW", "PG", "PG", "PL", "PL", "PLP", "PMBZ", "PO", "PO", "PTS", "REB", "REG", "RESEE", "RGK", "RSBN", "RSBS", "SBS", "SC", "Syn. CP", "ThEE", "TIB", "TM", "VV")
|
||||
Const sLineRefRegex As String = ", l\.[ ]([A-D0-9-]+)"
|
||||
|
||||
Dim oDocument As Object
|
||||
Dim oSearch As Object, oReplace As Object, oResult As Object
|
||||
Dim oFound As Object, oFoundCursor As Object
|
||||
Dim n As Integer
|
||||
Dim iReturnCode As Integer
|
||||
|
||||
' Initialisation des objets utilisés dans plusieurs blocs de code
|
||||
oDocument = ThisComponent
|
||||
oSearch = oDocument.createSearchDescriptor
|
||||
oReplace = oDocument.createReplaceDescriptor
|
||||
|
||||
' Vérifier que le document n'a plus à être modifié.
|
||||
If Check(mJournal) = 7 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
' Abrègement des titres de revues
|
||||
Abbreviate (oDocument, mTitreLong(), mAbrev(), mJournal, False)
|
||||
AbbrevAnnee_Philologique(True)
|
||||
|
||||
' Numéros de lignes en exposant sans "l. "
|
||||
oSearch.SearchString = sLineRefRegex
|
||||
oSearch.SearchRegularExpression = TRUE
|
||||
oResult = oDocument.findAll(oSearch)
|
||||
For n = 0 To oResult.count - 1
|
||||
oFound = oResult.getByIndex(n)
|
||||
oFoundCursor = oFound.Text.createTextCursorByRange(oFound)
|
||||
oFoundCursor.CharEscapement = nExponentCharSizePercentage
|
||||
oFoundCursor.CharEscapementHeight = nExponentCharHeightPercentage
|
||||
Next n
|
||||
ReplaceString(sLineRefRegex, "$1", TRUE)
|
||||
|
||||
SetFolioToPluralForm("f. ", "ff. ")
|
||||
|
||||
ReplaceString(" ", " ", FALSE) ' Replace narrow non breakable spaces (automatically generated by Zotero) by simple non breakable spaces.
|
||||
ReplaceString(" - ", "-", FALSE)
|
||||
|
||||
SetStringPartToExponent(oDocument, sRectoVersoRegex, "[rv](-v)?")
|
||||
SetStringPartToExponent(oDocument, sNumberOrIssueRegex, "os?")
|
||||
|
||||
SetFontSlantToString("CPG", com.sun.star.awt.FontSlant.ITALIC)
|
||||
SetFontSlantToString("BHG", com.sun.star.awt.FontSlant.ITALIC)
|
||||
|
||||
HandleItemsInBibliography("Titre Liste des abréviations")
|
||||
|
||||
end sub
|
||||
|
||||
</script:module>
|
55
Macros/LibreOffice/ApresZotero/ApZotUtilities.xba
Normal file
55
Macros/LibreOffice/ApresZotero/ApZotUtilities.xba
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ApZotUtilities" script:language="StarBasic" script:moduleType="normal">REM ***** BASIC *****
|
||||
|
||||
'************************************************************************
|
||||
'* Copyright 2021 by Bastien Dumont (bastien.dumont@posteo.net)
|
||||
'*
|
||||
'* This file is part of the ApresZotero library.
|
||||
'*
|
||||
'* ApresZotero 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 3 of the License, or
|
||||
'* (at your option) any later version.
|
||||
'*
|
||||
'* ApresZotero 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 ApresZotero. If not, see <https://www.gnu.org/licenses/>.
|
||||
'*
|
||||
'************************************************************************
|
||||
|
||||
Sub CountOccurrencesPerReference
|
||||
Dim vSortedItemMap As Variant
|
||||
Dim oScope As Object
|
||||
|
||||
oScope = ThisComponent
|
||||
|
||||
vSortedItemMap = getOccurrencesCount(oScope)
|
||||
PrintMap(vSortedItemMap)
|
||||
End Sub
|
||||
|
||||
Sub ChangeGreekFont
|
||||
Dim oSearch As Object
|
||||
Dim oDocument As Object
|
||||
Dim oResult As Object
|
||||
Dim i As Integer
|
||||
Dim oFound As Object
|
||||
Dim oFoundCursor As Object
|
||||
|
||||
oDocument = ThisComponent
|
||||
oSearch = oDocument.createSearchDescriptor
|
||||
oSearch.SearchString = sGreekTextRegex
|
||||
oSearch.SearchRegularExpression = TRUE
|
||||
oResult = oDocument.findAll(oSearch)
|
||||
For i = 0 To oResult.count - 1
|
||||
oFound = oResult.getByIndex(i)
|
||||
oFoundCursor = oFound.Text.createTextCursorByRange(oFound)
|
||||
oFoundCursor.CharFontName = GreekFont
|
||||
Next i
|
||||
|
||||
End Sub
|
||||
</script:module>
|
3
Macros/LibreOffice/ApresZotero/dialog.xlb
Normal file
3
Macros/LibreOffice/ApresZotero/dialog.xlb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ApresZotero" library:readonly="false" library:passwordprotected="false"/>
|
8
Macros/LibreOffice/ApresZotero/script.xlb
Normal file
8
Macros/LibreOffice/ApresZotero/script.xlb
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ApresZotero" library:readonly="false" library:passwordprotected="false">
|
||||
<library:element library:name="ApZotRevues"/>
|
||||
<library:element library:name="ApZotFunctions"/>
|
||||
<library:element library:name="ApZotGlobalOptions"/>
|
||||
<library:element library:name="ApZotUtilities"/>
|
||||
</library:library>
|
BIN
Macros/LibreOffice/ApresZotero_LO.oxt
Normal file
BIN
Macros/LibreOffice/ApresZotero_LO.oxt
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user