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. " MsgBox("Vous allez d'abord être interrogé·e pour vérifier que les" &_ " références aux lignes sont correctement reconnues. Chaque fois" &_ " que vous répondrez OUI, elles seront mises en exposant. Dans un" &_ " second temps, les chaînes de caractères “, l. ” seront supprimées.",_ 0, mJournal) SetStringPartToExponent(oDocument, sLineRefRegex, sLineRefRegex) ReplaceString(sLineRefRegex, "$1", TRUE) SetFolioToPluralForm("f. ", "ff. ") 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