From 33f5efdfab6bad0b2ab894f3bb114c0f345c661f Mon Sep 17 00:00:00 2001 From: Karchnu Date: Mon, 9 May 2022 05:27:12 +0200 Subject: [PATCH] New macros. --- macros.ms | 173 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 157 insertions(+), 16 deletions(-) diff --git a/macros.ms b/macros.ms index e2bf766..6d8c15d 100644 --- a/macros.ms +++ b/macros.ms @@ -5,8 +5,7 @@ .nr DI 0 .nr FF 3 \" footnotes' type: numbered, with point, indented . -. -.nr LIST_NUMBER 0 +.nr LIST_NUMBER 0 +1 . .R1 no-label-in-reference @@ -131,9 +130,15 @@ accumulate .. . .de NAMECITATION -.ps -2 -\(em\h'1'\\$* -.ps +.QP +.vs -\\n[legendps]p +.ps -\\n[legendps] +.in -1.2 +.ll +1.2 +\h'|-2'\(em\h'|-0.4' +\\$* +.br +.LP .. . .de EXPLANATION1 @@ -384,30 +389,29 @@ Compilé pour la dernière fois le .de ABSTRACT2 .AE .. +.ds CH Page % .de TITLE .TL \\$* +.ds LH \\$* .. .de AUTHOR -.AU -.ie '\\$1'' \ -. -.el \ -\\$* +. AU +. ie !'\\$1'' \\$* .. .de FOOTNOTE1 -.FS +. FS .. .de FOOTNOTE2 -.FE +. FE .. .de VOCABULARY1 -.KS -.BULLET -.UL "\\$*" : +. KS +. BULLET +. UL "\\$*" : .. .de VOCABULARY2 -.KE +. KE .. . . @@ -432,3 +436,140 @@ Compilé pour la dernière fois le \\$1\ \h'.2m' .. +. +. +. +.ds SPACE_SS_NUMBER_TITLE 0.5\" not a number register because of leading 0 +.nr CURRENT_SECTION 0 +1 +.nr CURRENT_APPENDIX 0 +.af CURRENT_APPENDIX I +.nr CURRENT_SUBSECTION 0 +1 +.nr CURRENT_SSSECTION 0 +1 +.rm SECTION +.de SECTION +. nr CURRENT_SUBSECTION 0 \" reset current subsection numbering +. nr CURRENT_SSSECTION 0 \" reset current subsubsection numbering +. ie !(\\n[CURRENT_SECTION]=0) .sp +1 +. br +. ie (\\n[APPENDIX_TIME]=0) \ +. ds RH \\n+[CURRENT_SECTION].\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$* +. el \{ +. ds RH \\n[CURRENT_APPENDIX].\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$* +. bp \} +. ps +2 +. fam H \" helvetica family +. ft B +. ne 4 \" should be at least a few lines left at the bottom of the page +\\*[RH] +. ft +. fam \" back to previous font family +. ps -2 +. PARAGRAPH_INDENTED +.. +.nr APPENDIX_TIME 0 +.de APPENDIX +. nr CURRENT_APPENDIX +1 +. nr APPENDIX_TIME 1 +. SECTION \\$* +.. +.de SS +. nr CURRENT_SSSECTION 0 +. ie (\\n[APPENDIX_TIME]=0) \ +. SUBSECTION_NO_NUMBER \\n[CURRENT_SECTION].\ +\\n+[CURRENT_SUBSECTION]\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$* +.el \ +. SUBSECTION_NO_NUMBER \\n[CURRENT_APPENDIX].\ +\\n+[CURRENT_SUBSECTION]\h'\\*[SPACE_SS_NUMBER_TITLE]' \\$* +.. +.de SSS +. br +. ps -2 +. fam H \" helvetica family +. ft B +. ie (\\n[APPENDIX_TIME]=0) \ +. SUBSECTION_NO_NUMBER \\n[CURRENT_SECTION].\ +\\n[CURRENT_SUBSECTION].\\n+[CURRENT_SSSECTION]\h'\ +\\*[SPACE_SS_NUMBER_TITLE]' \\$* +. el \ +\\n[CURRENT_APPENDIX].\ +\\n[CURRENT_SUBSECTION].\\n+[CURRENT_SSSECTION]\h'\ +\\*[SPACE_SS_NUMBER_TITLE]' \\$* +. ft +. fam \" back to previous font family +. ps +2 +. PARAGRAPH_INDENTED +.. +.de INNERBULLET +. in +1 +. br +\(bu +. in +1 +. sp -1 +\\$* +. in -2 +.. +.de EENUM \" Numbered list +. nr ENUM_INDENTATION 2 +. ie !(\\n[LIST_NUMBER]=0) .in -\\n[ENUM_INDENTATION] +. br +\\n+[LIST_NUMBER]. +. in +\\n[ENUM_INDENTATION] +. sp -1 +\\$* +.. +.de EENDENUM +. nr LIST_NUMBER 0 +. in -\\n[ENUM_INDENTATION] +.. +.nr legendps 2 +.de LEGEND1 +. QP +. vs -\\n[legendps]p +. ps -\\n[legendps] +. in -1.2 +. ll +1.2 +. br +.. +.de LEGEND2 +. br +. vs +\\n[legendps]p +. ps +\\n[legendps] +. br +. LP +.. +.de IEME +\\$1\u\s-4\\$2\s+4\d +.. +.de CENTERED +. ce +\\$* +. br +.. +.de GIVEEXAMPLE1 +. in +1 +. ll -1 +. KS \" start a keep +. \" .ft I \" citation in italics +. mk C \" set a marker for line drawing +. in +1 \" indent a bit +. gcolor citation +.. +.de GIVEEXAMPLE2 +. mk D \" set second marker to come back here +. \" .ft \" back to previous font +. in -1 \" remove indent +. gcolor black\" remove previous color +. gcolor citationbar +. \" r = move upward +. \" Z D t = drawing thickness +. \" L = draw the line +\r\ +\Z'\D't 1p''\ +\L'|\\nCu' \" draw line +. gcolor black \" remove previous color +. sp -2 \" get two lines back +\Z'\D't 0.5p'' \" get the previous drawing thickness back +. KE \" end of the keep +. ll +1 +. in -1 +..