SPB Git

Repository Public

Templates+Academic.swift 28.7 KB 349 lines swift

1// ORIX Docs2// File: Packages/ORIXDocsKit/Sources/DocTemplates/Templates+Academic.swift3// Description: Academic paper, research report and thesis templates.4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7import Foundation8import DocModel910extension TemplateLibrary {11    /// The descriptive-statistics table shared by the paper and the thesis: three-rule style, right-aligned numeric columns, bracketed values.12    private static func statisticsTable(_ b: inout TemplateBuilder) {13        let t = b.t14        let value = t("[0.00]", "[0,00]")15        b.table([2.4, 1, 1, 1, 1],16                header: [th(t("Variable", "Variable")), thNum(t("Mean", "Moyenne")), thNum(t("Std. dev.", "Écart-type")), thNum("Min."), thNum("Max.")],17                rows: (1...3).map { n in18                    [cell("[Variable \(n)]"), num(value), num(value), num(value), num(value)]19                } + [[cell(t("Observations", "Observations")), num("[N]"), num(""), num(""), num("")]],20                rules: true)21    }2223    // MARK: Academic paper2425    static func academicPaper(_ c: TemplateContext) -> DocumentModel {26        var b = TemplateBuilder(c, theme: .academic, margins: Insets(top: 72, left: 76, bottom: 76, right: 76))27        let t = b.t28        let size = b.theme.bodySize29        let muted = b.muted30        b.adjust(StyleID.normal) { $0.para.alignment = .justified; $0.para.hyphenate = true; $0.para.lineSpacing = .multiple(1.3) }31        b.adjust(StyleID.title) { $0.char.fontSize = 21; $0.para.alignment = .center; $0.para.spaceAfter = 12 }32        b.adjust(StyleID.heading(1)) { $0.char.fontSize = 14; $0.para.spaceBefore = 20 }33        b.adjust(StyleID.heading(2)) { $0.char.fontSize = 12.5 }34        b.adjust(StyleID.heading(3)) { $0.char.fontSize = size; $0.char.italic = true }35        b.numberHeadings(1...3)36        b.define("Author", t("Author", "Auteur"), next: "Affiliation", char: CharProps(fontSize: size + 1), para: ParaProps(alignment: .center, spaceAfter: 2, keepWithNext: true))37        b.define("Affiliation", t("Affiliation", "Affiliation"), next: "AbstractHeading", char: CharProps(fontSize: size - 1, italic: true, color: muted),38                 para: ParaProps(alignment: .center, spaceAfter: 2, lineSpacing: .multiple(1.15)))39        b.define("AbstractHeading", t("Abstract Heading", "Titre du résumé"), next: StyleID.abstract, char: CharProps(fontSize: size - 1, bold: true, tracking: 0.8, allCaps: true),40                 para: ParaProps(alignment: .center, spaceBefore: 22, spaceAfter: 6, keepWithNext: true))41        b.define("Keywords", t("Keywords", "Mots-clés"), basedOn: StyleID.abstract, next: StyleID.heading(1), para: ParaProps(alignment: .left, spaceAfter: 18))42        b.define("AppendixHeading", t("Appendix Heading", "Titre d'annexe"), basedOn: StyleID.heading(1), next: StyleID.normal, para: ParaProps(pageBreakBefore: true))4344        let title = t("[Title of the Paper: A Subtitle That States the Contribution]", "[Titre de l'article : un sous-titre qui annonce la contribution]")45        b.setup.differentFirstPage = true46        b.setup.header = HeaderFooter(default: [b.header([b.authorRun, tab, tab, r(t("[Short title]", "[Titre abrégé]"))])])47        b.setup.footer = HeaderFooter(default: [b.pageNumberFooter(.center)], first: [b.pageNumberFooter(.center)])48        b.subject = t("[Field of research]", "[Domaine de recherche]")49        let keys = b.placeholderBibliography()50        let eqID = DocID.make(), figID = DocID.make(), tabID = DocID.make(), dataID = DocID.make(), appendixID = DocID.make()5152        b.p(StyleID.title, title)53        let thanks = b.footnote(t("[Acknowledgements, funding and corresponding author's e-mail address.]",54                                  "[Remerciements, financement et adresse de courriel de l'auteur-ressource.]"))55        b.p("Author", [b.authorRun, thanks])56        b.p("Affiliation", b.organization)57        b.p("Affiliation", t("[Working paper – ", "[Document de travail – ") + b.dateText + "]")5859        b.p("AbstractHeading", t("Abstract", "Résumé"))60        b.p(StyleID.abstract, t("[In 150 to 250 words, state the question, the data and method, the main result with its magnitude, and why it matters.] An abstract stands alone: it uses no citation, no abbreviation the reader does not know and no reference to the body of the paper.",61                                "[En 150 à 250 mots, énoncez la question, les données et la méthode, le résultat principal et son ampleur, puis sa portée.] Un résumé se lit seul : il ne contient ni citation, ni abréviation inconnue du lecteur, ni renvoi au corps de l'article."))62        b.p("Keywords", [strong(t("Keywords: ", "Mots-clés : ")), r(t("[keyword 1], [keyword 2], [keyword 3], [keyword 4]", "[mot-clé 1], [mot-clé 2], [mot-clé 3], [mot-clé 4]"))])6364        b.heading(1, t("Introduction", "Introduction"))65        b.body([r(t("[Open with the question and why it matters.] Position the paper against prior work with citations inserted from your reference library; this placeholder citation shows how one appears ",66                    "[Commencez par la question et son importance.] Situez l'article par rapport aux travaux antérieurs au moyen de citations tirées de votre bibliothèque de références ; cette citation fictive montre le résultat ")),67                cite(keys.article), r(t(". Replace it with your own sources.", ". Remplacez-la par vos propres sources."))])68        let note = b.footnote(t("[Use footnotes for brief clarifications, not for essential arguments.]", "[Réservez les notes aux précisions brèves, non aux arguments essentiels.]"))69        b.body([r(t("[State the contribution in one paragraph, then outline the paper.]", "[Énoncez la contribution en un paragraphe, puis annoncez le plan de l'article.]")), note,70                r(t(" The data are described in ", " Les données sont décrites à la ")), ] + b.ref(dataID, .section) + [r(t(" and the proofs are in the appendix.", " et les démonstrations figurent en annexe."))])7172        b.heading(1, t("Data and Method", "Données et méthode"))73        b.heading(2, t("Data", "Données"), id: dataID)74        b.body([r(t("[Describe the sources, the sample period and the filters applied.] Summary statistics are reported in ",75                    "[Décrivez les sources, la période d'échantillonnage et les filtres appliqués.] Les statistiques descriptives sont présentées au "))]76               + b.ref(tabID, .table) + [r(".")])77        b.caption(.table, t("[Descriptive statistics of the main variables]", "[Statistiques descriptives des principales variables]"), id: tabID)78        statisticsTable(&b)79        b.heading(2, t("Model", "Modèle"))80        b.body(t("[Introduce the specification before the equation and define every symbol right after it.] The baseline model is",81                 "[Présentez la spécification avant l'équation et définissez chaque symbole immédiatement après.] Le modèle de référence s'écrit"))82        b.displayEquation("y_i = \\alpha + \\beta x_i + \\varepsilon_i", id: eqID)83        b.body([r(t("where ", "où ")), math("y_i"), r(t(" is [the outcome], ", " désigne [la variable expliquée], ")), math("x_i"),84                r(t(" is [the regressor of interest] and ", " désigne [la variable d'intérêt] et ")), math("\\varepsilon_i"),85                r(t(" is the error term. The coefficient of interest in ", " est le terme d'erreur. Le coefficient d'intérêt de l'"))]86               + b.ref(eqID, .equation) + [r(t(" is ", " est ")), math("\\beta"), r(".")])8788        b.heading(1, t("Results", "Résultats"))89        b.body([r(t("[Report the main estimate first, with its uncertainty, then the robustness checks.] ", "[Présentez d'abord l'estimation principale et son incertitude, puis les tests de robustesse.] "))]90               + (t.french ? [r("La ")] : []) + b.ref(figID, .figure) + [r(t(" plots [the relation of interest].", " illustre [la relation d'intérêt]."))])91        b.figure(label: t("[Insert figure]", "[Insérer la figure]"),92                 alt: t("Placeholder for a figure: replace this rectangle with your chart and describe here what the chart shows.",93                        "Espace réservé à une figure : remplacez ce rectangle par votre graphique et décrivez ici ce qu'il montre."))94        b.caption(.figure, t("[What the figure shows, with units and sample]", "[Ce que montre la figure, avec les unités et l'échantillon]"), id: figID)95        b.heading(2, t("Robustness", "Robustesse"))96        b.body(t("[Say which alternative specifications were tried and whether the conclusion holds.]", "[Indiquez les autres spécifications essayées et si la conclusion tient.]"))9798        b.heading(1, t("Discussion", "Discussion"))99        b.body([r(t("[Interpret the results, compare them with the literature ", "[Interprétez les résultats, comparez-les aux travaux existants ")), cite(keys.book, locator: t("p. [00]", "p. [00]")),100                r(t(" and state the limits of the analysis.]", " et précisez les limites de l'analyse.]"))])101102        b.heading(1, t("Conclusion", "Conclusion"))103        b.body(t("[Restate the answer to the question, its implications and the work that remains.]", "[Rappelez la réponse à la question, ses implications et les travaux à poursuivre.]"))104105        b.bibliographyBlock()106107        b.heading(1, t("Appendix A. [Title of the appendix]", "Annexe A. [Titre de l'annexe]"), id: appendixID, style: "AppendixHeading")108        b.body(t("[Place proofs, variable definitions and supplementary tables here.] Equations keep the same numbering as in the body:",109                 "[Placez ici les démonstrations, la définition des variables et les tableaux supplémentaires.] Les équations poursuivent la numérotation du corps du texte :"))110        b.displayEquation("\\hat{\\beta} = \\frac{\\sum_i (x_i - \\bar{x})(y_i - \\bar{y})}{\\sum_i (x_i - \\bar{x})^2}")111        return b.build(title: title)112    }113114    // MARK: Research report115116    static func researchReport(_ c: TemplateContext) -> DocumentModel {117        var b = TemplateBuilder(c, theme: .orix, margins: Insets(top: 80, left: 76, bottom: 76, right: 76))118        let t = b.t119        let accent = b.theme.accent, muted = b.muted, tint = b.tint120        b.numberHeadings(1...3)121        coverStyles(&b)122        b.define("Callout", t("Callout", "Encadré"), next: StyleID.normal,123                 para: ParaProps(indentLeft: 12, indentRight: 12, spaceBefore: 8, spaceAfter: 12, keepLinesTogether: true, shading: tint, borderLeft: BorderLine(width: 3, color: accent)))124        b.define("Source", t("Source Note", "Note de source"), basedOn: StyleID.caption, next: StyleID.normal, char: CharProps(italic: true, color: muted),125                 para: ParaProps(alignment: .left, spaceBefore: 2))126127        let title = t("[Report Title]", "[Titre du rapport]")128        b.setup.differentFirstPage = true129        b.setup.header = HeaderFooter(default: [b.header([field(.title), tab, tab, r(b.organization)])])130        b.setup.footer = HeaderFooter(default: [b.footer([field(.headingText(level: 1)), tab, tab] + b.pageOfTotal)])131        let keys = b.placeholderBibliography()132        let methodID = DocID.make(), findingsTab = DocID.make(), figID = DocID.make(), limitsID = DocID.make()133134        b.p("CoverKicker", t("Research report", "Rapport de recherche"))135        b.p("CoverTitle", title)136        b.p("CoverSubtitle", t("[Subtitle: the question the report answers]", "[Sous-titre : la question à laquelle répond le rapport]"))137        b.p("CoverMeta", [r(t("Prepared by ", "Préparé par ")), b.authorRun])138        b.p("CoverMeta", b.organization)139        b.p("CoverMeta", b.dateText)140        b.p("CoverMeta", t("Version [1.0] · [Distribution: internal / public]", "Version [1.0] · [Diffusion : interne / publique]"))141        b.pageBreak()142143        b.toc(.contents, maxLevel: 2)144        b.pageBreak()145146        b.heading(1, t("Executive Summary", "Sommaire"), style: TStyle.unnumberedHeading)147        b.body(t("[One page at most, written last.] State the question, the approach in one sentence, and what the reader should remember and do.",148                 "[Une page au plus, rédigée en dernier.] Énoncez la question, la démarche en une phrase, puis ce que le lecteur doit retenir et faire."))149        b.p("Callout", [strong(t("Key findings", "Constats clés"))])150        b.bullets([t("[Finding 1, with its figure and its unit]", "[Constat 1, avec son chiffre et son unité]"),151                   t("[Finding 2]", "[Constat 2]"), t("[Finding 3]", "[Constat 3]")])152153        b.heading(1, t("Introduction", "Introduction"))154        b.heading(2, t("Context", "Contexte"))155        b.body([r(t("[Explain why the study was commissioned and what is already known ", "[Expliquez pourquoi l'étude a été commandée et ce que l'on sait déjà ")), cite(keys.article),156                r(t(".] The placeholder citation shows how a reference appears; replace it with your sources.", ".] La citation fictive montre l'aspect d'un renvoi ; remplacez-la par vos sources."))])157        b.heading(2, t("Objectives", "Objectifs"))158        b.numbered([t("[Objective 1: a question the report answers]", "[Objectif 1 : une question à laquelle le rapport répond]"),159                    t("[Objective 2]", "[Objectif 2]"), t("[Objective 3]", "[Objectif 3]")])160161        b.heading(1, t("Methodology", "Méthodologie"), id: methodID)162        let note = b.footnote(t("[Give the collection dates, the response rate or the version of the data set.]", "[Indiquez les dates de collecte, le taux de réponse ou la version du jeu de données.]"))163        b.body([r(t("[Describe the data, the sample and the analysis so that a reader could repeat the work.]", "[Décrivez les données, l'échantillon et l'analyse de façon qu'un lecteur puisse refaire le travail.]")), note])164        b.heading(2, t("Data Sources", "Sources de données"))165        b.bullets([t("[Source 1: owner, period, coverage]", "[Source 1 : détenteur, période, couverture]"), t("[Source 2]", "[Source 2]")])166        b.heading(2, t("Analysis", "Analyse"))167        b.body(t("[Name the methods and the software, and justify the main choices.]", "[Nommez les méthodes et les logiciels, et justifiez les principaux choix.]"))168169        b.heading(1, t("Findings", "Résultats"))170        b.body([r(t("[Present one finding per subsection, the most important first.] The results are summarized in ", "[Présentez un constat par sous-section, le plus important d'abord.] Les résultats sont résumés au "))]171               + b.ref(findingsTab, .table) + [r(t(" and illustrated in ", " et illustrés à la "))] + b.ref(figID, .figure) + [r(".")])172        b.heading(2, t("[Finding 1]", "[Constat 1]"))173        b.caption(.table, t("[Summary of results by group]", "[Synthèse des résultats par groupe]"), id: findingsTab)174        b.table([2.2, 1, 1, 1],175                header: [th(t("Group", "Groupe")), thNum(t("Sample", "Échantillon")), thNum(t("Result", "Résultat")), thNum(t("Change", "Variation"))],176                rows: (1...3).map { [cell(t("[Group \($0)]", "[Groupe \($0)]")), num("[n]"), num(t("[0.0]", "[0,0]")), num(t("[0.0%]", "[0,0 %]"))] }, style: b.bandedTable)177        b.p("Source", t("Source: [origin of the data, year].", "Source : [provenance des données, année]."))178        b.heading(2, t("[Finding 2]", "[Constat 2]"))179        b.figure(label: t("[Insert chart]", "[Insérer le graphique]"),180                 alt: t("Placeholder for a chart: replace this rectangle with your chart and describe here the trend it shows.",181                        "Espace réservé à un graphique : remplacez ce rectangle par votre graphique et décrivez ici la tendance qu'il montre."))182        b.caption(.figure, t("[Trend of the main indicator over the period]", "[Évolution de l'indicateur principal sur la période]"), id: figID)183184        b.heading(1, t("Recommendations", "Recommandations"))185        b.body([r(t("[Each recommendation follows from a finding and names who should act.] The limits of the evidence are discussed in ",186                    "[Chaque recommandation découle d'un constat et nomme le responsable de sa mise en œuvre.] Les limites de la preuve sont exposées à la "))]187               + b.ref(limitsID, .section) + [r(".")])188        b.numbered([t("[Recommendation 1 – owner – deadline]", "[Recommandation 1 – responsable – échéance]"),189                    t("[Recommendation 2 – owner – deadline]", "[Recommandation 2 – responsable – échéance]")])190191        b.heading(1, t("Limitations", "Limites"), id: limitsID)192        b.body([r(t("[State what the data cannot show and how the method described in ", "[Précisez ce que les données ne permettent pas de conclure et en quoi la méthode décrite à la "))]193               + b.ref(methodID, .section) + [r(t(" affects the conclusions ", " influe sur les conclusions ")), cite(keys.book), r(".]")])194195        b.bibliographyBlock()196197        b.heading(1, t("Appendix A. [Supplementary material]", "Annexe A. [Documents complémentaires]"), style: TStyle.unnumberedHeading)198        b.body(t("[Questionnaires, detailed tables, definitions.]", "[Questionnaires, tableaux détaillés, définitions.]"))199        return b.build(title: title)200    }201202    /// Cover-page styles shared by the reports, the proposal and the manual.203    static func coverStyles(_ b: inout TemplateBuilder) {204        let t = b.t205        b.define("CoverKicker", t("Cover Kicker", "Surtitre de couverture"), next: "CoverTitle",206                 char: CharProps(fontFamily: b.theme.headingFont, fontSize: 11, bold: true, color: b.theme.accent, tracking: 1.6, allCaps: true),207                 para: ParaProps(spaceBefore: 150, spaceAfter: 10, keepWithNext: true))208        b.define("CoverTitle", t("Cover Title", "Titre de couverture"), basedOn: StyleID.title, next: "CoverSubtitle",209                 char: CharProps(fontSize: 34), para: ParaProps(spaceAfter: 10))210        b.define("CoverSubtitle", t("Cover Subtitle", "Sous-titre de couverture"), basedOn: StyleID.subtitle, next: "CoverMeta",211                 para: ParaProps(spaceAfter: 60, borderBottom: b.accentRule))212        b.define("CoverMeta", t("Cover Details", "Renseignements de couverture"), next: "CoverMeta",213                 char: CharProps(fontFamily: b.theme.headingFont, fontSize: b.theme.bodySize, color: b.muted), para: ParaProps(spaceAfter: 3, lineSpacing: .multiple(1.15)))214    }215216    // MARK: Thesis217218    static func thesis(_ c: TemplateContext) -> DocumentModel {219        // Wider binding margin on the left.220        var b = TemplateBuilder(c, theme: .academic, margins: Insets(top: 80, left: 100, bottom: 80, right: 72))221        let t = b.t222        let size = b.theme.bodySize223        b.adjust(StyleID.normal) { $0.para.alignment = .justified; $0.para.hyphenate = true; $0.para.lineSpacing = .multiple(1.5); $0.para.spaceAfter = 10 }224        b.adjust(StyleID.heading(1)) { $0.char.fontSize = 24; $0.para.pageBreakBefore = true; $0.para.spaceBefore = 60; $0.para.spaceAfter = 28 }225        b.adjust(StyleID.footnoteText) { $0.para.lineSpacing = .multiple(1.15) }226        b.numberHeadings(1...3)227        b.define("FrontHeading", t("Front Matter Heading", "Titre des pages liminaires"), basedOn: StyleID.heading(1), next: StyleID.normal,228                 para: ParaProps(alignment: .center, spaceBefore: 40))229        b.define("AppendixHeading", t("Appendix Heading", "Titre d'annexe"), basedOn: StyleID.heading(1), next: StyleID.normal)230        b.define("ThesisTitle", t("Thesis Title", "Titre de la thèse"), basedOn: StyleID.title, next: "TitlePage",231                 char: CharProps(fontSize: 26), para: ParaProps(alignment: .center, spaceBefore: 70, spaceAfter: 36, lineSpacing: .multiple(1.15)))232        b.define("TitlePage", t("Title Page Text", "Texte de la page de titre"), next: "TitlePage",233                 char: CharProps(fontSize: size + 1), para: ParaProps(alignment: .center, firstLineIndent: 0, spaceAfter: 6, lineSpacing: .multiple(1.3), hyphenate: false))234        b.define("Keywords", t("Keywords", "Mots-clés"), basedOn: StyleID.abstract, next: StyleID.normal, para: ParaProps(alignment: .left))235236        let title = t("[Title of the Thesis]", "[Titre de la thèse]")237        b.subject = t("[Discipline]", "[Discipline]")238        // Front matter: no header, roman page numbers, none on the title page.239        b.setup.differentFirstPage = true240        b.setup.differentOddEven = true241        b.setup.pageNumberFormat = .lowerRoman242        b.setup.pageNumberStart = 1243        b.setup.footer = HeaderFooter(default: [b.pageNumberFooter(.center)], even: [b.pageNumberFooter(.center)])244        let keys = b.placeholderBibliography()245        let ch2 = DocID.make(), ch3 = DocID.make(), ch4 = DocID.make(), ch5 = DocID.make()246        let eqID = DocID.make(), figID = DocID.make(), tabID = DocID.make(), designID = DocID.make()247248        // Title page249        b.p("TitlePage", [r(b.organization)], props: ParaProps(spaceBefore: 30))250        b.p("TitlePage", t("[Faculty or department]", "[Faculté ou département]"))251        b.p("ThesisTitle", title)252        b.p("TitlePage", t("by", "par"))253        b.p("TitlePage", [b.authorRun], props: ParaProps(spaceAfter: 40))254        b.p("TitlePage", t("A thesis submitted in partial fulfilment of the requirements for the degree of [Degree] in [Program]",255                            "Thèse présentée en vue de l'obtention du grade de [Grade] en [Programme]"))256        b.p("TitlePage", [r(t("[City, Province], ", "[Ville (Province)], ") + t.monthYear(c.date))], props: ParaProps(spaceBefore: 60))257        b.p("TitlePage", [r("© "), b.authorRun, r(", " + t.year(c.date))])258259        b.heading(1, t("Abstract", "Résumé"), style: "FrontHeading")260        b.p(StyleID.abstract, t("[In 250 to 350 words: the problem, the approach, the main results and the contribution of the thesis.] Check the length your institution requires.",261                                "[En 250 à 350 mots : le problème, la démarche, les principaux résultats et la contribution de la thèse.] Vérifiez la longueur exigée par votre établissement."))262        b.p("Keywords", [strong(t("Keywords: ", "Mots-clés : ")), r(t("[keyword 1], [keyword 2], [keyword 3], [keyword 4], [keyword 5]", "[mot-clé 1], [mot-clé 2], [mot-clé 3], [mot-clé 4], [mot-clé 5]"))])263264        b.heading(1, t("Acknowledgements", "Remerciements"), style: "FrontHeading")265        b.body(t("[Thank your supervisor, the committee, funding bodies, colleagues and family.]", "[Remerciez votre direction de recherche, le jury, les organismes subventionnaires, vos collègues et vos proches.]"))266267        b.pageBreak()268        b.toc(.contents, maxLevel: 3)269        b.pageBreak()270        b.toc(.figures)271        b.pageBreak()272        b.toc(.tables)273274        // Body: arabic numbering restarts at 1 on a right-hand page; mirrored headers carry the thesis title and the chapter title.275        let bodyHeader = HeaderFooter(default: [b.header([tab, tab, field(.headingText(level: 1))])], even: [b.header([field(.title)])])276        let bodyFooter = HeaderFooter(default: [b.pageNumberFooter(.right)], even: [b.pageNumberFooter(.left)])277        b.section(.oddPage) { s in278            s.differentFirstPage = false279            s.pageNumberFormat = .decimal280            s.pageNumberStart = 1281            s.header = bodyHeader282            s.footer = bodyFooter283        }284285        b.heading(1, t("Introduction", "Introduction"))286        b.heading(2, t("Background", "Contexte"))287        b.body(t("[Present the field and the problem that motivates the thesis.]", "[Présentez le domaine et le problème qui motive la thèse.]"))288        b.heading(2, t("Research Questions", "Questions de recherche"))289        b.numbered([t("[Research question 1]", "[Question de recherche 1]"), t("[Research question 2]", "[Question de recherche 2]"), t("[Research question 3]", "[Question de recherche 3]")])290        b.heading(2, t("Outline of the Thesis", "Plan de la thèse"))291        b.body(b.ref(ch2, .chapter).capitalizedFirst(t.french, article: "Le ") + [r(t(" reviews the literature, ", " recense les écrits, le "))] + b.ref(ch3, .chapter)292               + [r(t(" presents the method, ", " présente la méthode, le "))] + b.ref(ch4, .chapter) + [r(t(" reports the results and ", " expose les résultats et le "))]293               + b.ref(ch5, .chapter) + [r(t(" concludes. These references update themselves when chapters move.", " conclut. Ces renvois se mettent à jour lorsque les chapitres sont déplacés."))])294295        b.heading(1, t("Literature Review", "Recension des écrits"), id: ch2)296        let note = b.footnote(t("[A footnote for a clarification or a secondary source.]", "[Une note pour une précision ou une source secondaire.]"))297        b.body([r(t("[Organize the review by theme, not by author.] Citations come from your reference library; this placeholder shows how one appears ",298                    "[Organisez la recension par thème, non par auteur.] Les citations proviennent de votre bibliothèque de références ; cet exemple fictif en montre l'aspect ")),299                cite(keys.article), r("."), note])300        b.heading(2, t("[Theme 1]", "[Thème 1]"))301        b.body([r(t("[Summarize, compare and criticize the main works ", "[Résumez, comparez et critiquez les principaux travaux ")), cite(keys.book, locator: t("ch. [0]", "chap. [0]")), r(".]")])302        b.heading(2, t("[Theme 2]", "[Thème 2]"))303        b.heading(3, t("[Sub-theme]", "[Sous-thème]"))304        b.body(t("[End the chapter with the gap your thesis fills.]", "[Terminez le chapitre par la lacune que comble votre thèse.]"))305306        b.heading(1, t("Methodology", "Méthodologie"), id: ch3)307        b.heading(2, t("Research Design", "Devis de recherche"), id: designID)308        b.body([r(t("[Justify the design and describe the data.] The overall design is shown in ", "[Justifiez le devis et décrivez les données.] Le devis d'ensemble est illustré à la "))]309               + b.ref(figID, .figure) + [r(".")])310        b.figure(label: t("[Insert figure]", "[Insérer la figure]"),311                 alt: t("Placeholder for a figure: replace this rectangle with your diagram and describe here what the diagram shows.",312                        "Espace réservé à une figure : remplacez ce rectangle par votre schéma et décrivez ici ce qu'il montre."), height: 200)313        b.caption(.figure, t("[Research design]", "[Devis de recherche]"), id: figID)314        b.heading(2, t("Model", "Modèle"))315        b.body(t("[Introduce the model, then define each symbol.] The model is", "[Présentez le modèle, puis définissez chaque symbole.] Le modèle s'écrit"))316        b.displayEquation("y_{it} = \\alpha_i + \\beta^{\\top} x_{it} + \\varepsilon_{it}", id: eqID)317        b.body([r(t("where ", "où ")), math("\\alpha_i"), r(t(" is [an individual effect]. The parameters of ", " désigne [un effet individuel]. Les paramètres de l'"))]318               + b.ref(eqID, .equation) + [r(t(" are estimated by [method].", " sont estimés par [méthode]."))])319320        b.heading(1, t("Results", "Résultats"), id: ch4)321        b.body([r(t("[Present the results in the order of the research questions.] Descriptive statistics are given in ", "[Présentez les résultats dans l'ordre des questions de recherche.] Les statistiques descriptives figurent au "))]322               + b.ref(tabID, .table) + [r(t("; the design is recalled in ", " ; le devis est rappelé à la "))] + b.ref(designID, .section) + [r(".")])323        b.caption(.table, t("[Descriptive statistics]", "[Statistiques descriptives]"), id: tabID)324        statisticsTable(&b)325        b.heading(2, t("[Result 1]", "[Résultat 1]"))326        b.body(t("[State the result, then the evidence, then its interpretation.]", "[Énoncez le résultat, puis la preuve, puis son interprétation.]"))327328        b.heading(1, t("Conclusion", "Conclusion"), id: ch5)329        b.heading(2, t("Contributions", "Contributions"))330        b.body(t("[Answer each research question.]", "[Répondez à chaque question de recherche.]"))331        b.heading(2, t("Limitations and Future Work", "Limites et travaux futurs"))332        b.body(t("[Be candid about the limits and precise about the next steps.]", "[Soyez franc sur les limites et précis sur les suites à donner.]"))333334        b.pageBreak()335        b.bibliographyBlock()336337        b.heading(1, t("Appendix A. [Title of the appendix]", "Annexe A. [Titre de l'annexe]"), style: "AppendixHeading")338        b.body(t("[Instruments, proofs, supplementary tables, ethics certificate.]", "[Instruments, démonstrations, tableaux supplémentaires, certificat d'éthique.]"))339        b.heading(1, t("Appendix B. [Title of the appendix]", "Annexe B. [Titre de l'annexe]"), style: "AppendixHeading")340        b.body(t("[One appendix per kind of material.]", "[Une annexe par type de document.]"))341        return b.build(title: title)342    }343}344345extension Array where Element == Run {346    /// Sentence-initial form of a reference: in French an article goes in front ("Le chapitre 2"), in English the label is already capitalized.347    func capitalizedFirst(_ french: Bool, article: String) -> [Run] { french ? [Run(article)] + self : self }348}349
Files main
Menu

Theme