├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── LICENCE ├── README.md ├── bmc-boxes.sty ├── bmc-color.sty ├── bmc-fonts.sty ├── bmc-maths.sty ├── bmc-ref.sty ├── bmc-sectioning.sty ├── bmc.cls ├── documentation ├── bmc-demo-img.png ├── bmc.pdf ├── bmc.svg ├── bmc.tex └── refs.bib ├── infoBulle.sty ├── marginInfoBulle.sty ├── yMainColor.sty └── yMarginDesign.sty /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pdf filter=lfs diff=lfs merge=lfs -text 2 | *.png filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.cls 2 | *.aux 3 | *.toc 4 | *.ptc 5 | *.log 6 | *.out 7 | *.fls 8 | *.pygstyle 9 | *.pygtex 10 | *.synctex.gz 11 | *.fdb_latexmk 12 | *.glg 13 | *.glo 14 | *.gls 15 | *.glsdefs 16 | *.ist 17 | *.bbl 18 | *.bcf 19 | *.blg 20 | *.run.xml 21 | testing/ 22 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [Unreleased] 4 | 5 | ### Added 6 | 7 | - New \maketitle style for article option 8 | - Nice pgfplot keys for asymptotes 9 | - More documentation, with some improvements 10 | 11 | ### Improved 12 | 13 | - Improved microtype (add some protrusion) 14 | - Remove extra space from `\today` format 15 | - Lighten content boxes background 16 | - Create option 'maths' alias for 'math' 17 | - Make inline maths colour match text in (various) titles 18 | - Improve support for maths symbols in pdf outline 19 | - Improve pgfplot line style variation and more tweaks 20 | - 'smart' axis arrows for pgfplots 21 | - Move code that should be in bmc-font from bmc 22 | - (Vertically) spaced out mini-toc a bit more 23 | - Prevent unsightly overlap (solid colour panel, or stripe) with bibliography contents 24 | - Improve sectioning label string conversion with hyperref (e.g `\acr{abc}` to `abc`) 25 | - Switched the maths font to `newpxmath`, which is very nice 26 | - Use actual origin for graph axis instead of always (0,0) 27 | 28 | ### Fixed 29 | 30 | - positioning of counter, in the header of a continued box 31 | - Silence + hyperref + inline maths doesn't mix well 32 | - inline math color for continued box title 33 | - spelling of "quaternary" 34 | - remove unwanted space before numbered ((sub?)sub?)sections 35 | - weird spacing of small caps by removing `tracking` option from microtype 36 | 37 | ## [0.2.2] — 2019-08-13 38 | 39 | ### Added 40 | 41 | - More documentation 42 | 43 | ### Improved 44 | 45 | - Tweak styling of acronyms 46 | - Improve math differential macros 47 | - Implement (non-margin) infoBulle using tcolorbox 48 | - Remove deterimental baseline shift with box icons 49 | - Make default bold actually semibold 50 | - Enhance derivative (\dv) comand 51 | 52 | ### Fixed 53 | 54 | - Issue with minted breaking for some files 55 | - Remove accidentally included test file 56 | - minor tcolorbox issues + tweaks 57 | - (#9) Add default values for title and author 58 | 59 | ## [0.2.1] — 2019-07-22 60 | 61 | ### Added 62 | 63 | - `landscape` class option 64 | - Class option to configure glossaries `gloss` 65 | 66 | ### Improved 67 | 68 | - Update readme, add image 69 | - Make `\textsc` use `\fauxsc` when appropriate 70 | - Make `\fauxsc` weight more appropriate 71 | - Tweaked `hyperref` options 72 | - Complete move from `titlesec` to `koma` 73 | - Remove some warnings 74 | 75 | ### Fixed 76 | 77 | - Removed some tests that sneaked in 78 | - Potential issue with tabular row colouring 79 | 80 | ## [0.2] — 2019-06-16 81 | 82 | ### Added 83 | 84 | - Use of `silent` package 85 | - Revamped colour management in `bmc-color.sty` 86 | 87 | ### Improved 88 | 89 | - **Split up main `.cls` into a few `.sty` components!** 90 | - Table header fill is now a tad less dodgy, and more robust 91 | - Update and improve documentation 92 | 93 | ### Fixed 94 | 95 | - Non-existant font weight reference 96 | - Dodgy `chemfig` externalise code commented out 97 | 98 | ## [0.1] — 2019-06-09 99 | 100 | ### Added 101 | 102 | - Documentation/Demo pdf 103 | - Ditto command 104 | - Dodgy tcolobox'd `\mintinline` 105 | - Roman numeral commands `\RN` and `\Rn` 106 | - Inline math colour (disable by using `\(* \)`) 107 | - Add dark colour theme (class option `dark`) 108 | - Pgfplots customisations 109 | - Optional matrix alignment (default `r`) 110 | - Use main font for maths 111 | - Proof environment 112 | 113 | ### Improved 114 | 115 | - Have href and inline math change with light/dark theme 116 | - Better (rudimentary) table header fill 117 | - Expand space for minted line numbers, now max of 9999 118 | - Captions now use heading font 119 | - Captions become raggedright when they become multiline 120 | - Colour variables no longer contains superflous `color` in name. 121 | - tweak infobulle alignment 122 | - microtype settings 123 | - metadata adding 124 | - `mathbb` shortcuts now two letters (`\XX`) to avoid clashes 125 | - `mathbb` shortcuts now better handle optional argument 126 | - `\today` format is now "D^th Month YYYY" 127 | - `\leq` and `\geq` now produce ⩽ and ⩾ 128 | - Remove dot after numbers in figure captions etc. 129 | 130 | ### Fixed 131 | 132 | - Tabulars now always have the `text` colour 133 | - `\indent` now does something 134 | - Correct class now used with `article` class option 135 | 136 | ## [Initial commit] 137 | 138 | A nice custom class. 139 | 140 | [unreleased]: https://github.com/tecosaur/BMC/compare/v0.2.2...HEAD 141 | [0.2.2]: https://github.com/tecosaur/BMC/compare/v0.2.1...v0.2.2 142 | [0.2.1]: https://github.com/tecosaur/BMC/compare/v0.2...v0.2.1 143 | [0.2]: https://github.com/tecosaur/BMC/compare/v0.1...v0.2 144 | [0.1]: https://github.com/tecosaur/BMC/compare/84c5f58...v0.1 145 | [initial commit]: https://github.com/tecosaur/BMC/commit/84c5f58d18a12c722598c42d497a1abaf551dcd3 146 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | The LaTeX Project Public License 2 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 3 | 4 | LPPL Version 1.3c 2008-05-04 5 | 6 | Copyright 1999 2002-2008 LaTeX3 Project 7 | Everyone is allowed to distribute verbatim copies of this 8 | license document, but modification of it is not allowed. 9 | 10 | 11 | PREAMBLE 12 | ======== 13 | 14 | The LaTeX Project Public License (LPPL) is the primary license under 15 | which the LaTeX kernel and the base LaTeX packages are distributed. 16 | 17 | You may use this license for any work of which you hold the copyright 18 | and which you wish to distribute. This license may be particularly 19 | suitable if your work is TeX-related (such as a LaTeX package), but 20 | it is written in such a way that you can use it even if your work is 21 | unrelated to TeX. 22 | 23 | The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', 24 | below, gives instructions, examples, and recommendations for authors 25 | who are considering distributing their works under this license. 26 | 27 | This license gives conditions under which a work may be distributed 28 | and modified, as well as conditions under which modified versions of 29 | that work may be distributed. 30 | 31 | We, the LaTeX3 Project, believe that the conditions below give you 32 | the freedom to make and distribute modified versions of your work 33 | that conform with whatever technical specifications you wish while 34 | maintaining the availability, integrity, and reliability of 35 | that work. If you do not see how to achieve your goal while 36 | meeting these conditions, then read the document `cfgguide.tex' 37 | and `modguide.tex' in the base LaTeX distribution for suggestions. 38 | 39 | 40 | DEFINITIONS 41 | =========== 42 | 43 | In this license document the following terms are used: 44 | 45 | `Work' 46 | Any work being distributed under this License. 47 | 48 | `Derived Work' 49 | Any work that under any applicable law is derived from the Work. 50 | 51 | `Modification' 52 | Any procedure that produces a Derived Work under any applicable 53 | law -- for example, the production of a file containing an 54 | original file associated with the Work or a significant portion of 55 | such a file, either verbatim or with modifications and/or 56 | translated into another language. 57 | 58 | `Modify' 59 | To apply any procedure that produces a Derived Work under any 60 | applicable law. 61 | 62 | `Distribution' 63 | Making copies of the Work available from one person to another, in 64 | whole or in part. Distribution includes (but is not limited to) 65 | making any electronic components of the Work accessible by 66 | file transfer protocols such as FTP or HTTP or by shared file 67 | systems such as Sun's Network File System (NFS). 68 | 69 | `Compiled Work' 70 | A version of the Work that has been processed into a form where it 71 | is directly usable on a computer system. This processing may 72 | include using installation facilities provided by the Work, 73 | transformations of the Work, copying of components of the Work, or 74 | other activities. Note that modification of any installation 75 | facilities provided by the Work constitutes modification of the Work. 76 | 77 | `Current Maintainer' 78 | A person or persons nominated as such within the Work. If there is 79 | no such explicit nomination then it is the `Copyright Holder' under 80 | any applicable law. 81 | 82 | `Base Interpreter' 83 | A program or process that is normally needed for running or 84 | interpreting a part or the whole of the Work. 85 | 86 | A Base Interpreter may depend on external components but these 87 | are not considered part of the Base Interpreter provided that each 88 | external component clearly identifies itself whenever it is used 89 | interactively. Unless explicitly specified when applying the 90 | license to the Work, the only applicable Base Interpreter is a 91 | `LaTeX-Format' or in the case of files belonging to the 92 | `LaTeX-format' a program implementing the `TeX language'. 93 | 94 | 95 | 96 | CONDITIONS ON DISTRIBUTION AND MODIFICATION 97 | =========================================== 98 | 99 | 1. Activities other than distribution and/or modification of the Work 100 | are not covered by this license; they are outside its scope. In 101 | particular, the act of running the Work is not restricted and no 102 | requirements are made concerning any offers of support for the Work. 103 | 104 | 2. You may distribute a complete, unmodified copy of the Work as you 105 | received it. Distribution of only part of the Work is considered 106 | modification of the Work, and no right to distribute such a Derived 107 | Work may be assumed under the terms of this clause. 108 | 109 | 3. You may distribute a Compiled Work that has been generated from a 110 | complete, unmodified copy of the Work as distributed under Clause 2 111 | above, as long as that Compiled Work is distributed in such a way that 112 | the recipients may install the Compiled Work on their system exactly 113 | as it would have been installed if they generated a Compiled Work 114 | directly from the Work. 115 | 116 | 4. If you are the Current Maintainer of the Work, you may, without 117 | restriction, modify the Work, thus creating a Derived Work. You may 118 | also distribute the Derived Work without restriction, including 119 | Compiled Works generated from the Derived Work. Derived Works 120 | distributed in this manner by the Current Maintainer are considered to 121 | be updated versions of the Work. 122 | 123 | 5. If you are not the Current Maintainer of the Work, you may modify 124 | your copy of the Work, thus creating a Derived Work based on the Work, 125 | and compile this Derived Work, thus creating a Compiled Work based on 126 | the Derived Work. 127 | 128 | 6. If you are not the Current Maintainer of the Work, you may 129 | distribute a Derived Work provided the following conditions are met 130 | for every component of the Work unless that component clearly states 131 | in the copyright notice that it is exempt from that condition. Only 132 | the Current Maintainer is allowed to add such statements of exemption 133 | to a component of the Work. 134 | 135 | a. If a component of this Derived Work can be a direct replacement 136 | for a component of the Work when that component is used with the 137 | Base Interpreter, then, wherever this component of the Work 138 | identifies itself to the user when used interactively with that 139 | Base Interpreter, the replacement component of this Derived Work 140 | clearly and unambiguously identifies itself as a modified version 141 | of this component to the user when used interactively with that 142 | Base Interpreter. 143 | 144 | b. Every component of the Derived Work contains prominent notices 145 | detailing the nature of the changes to that component, or a 146 | prominent reference to another file that is distributed as part 147 | of the Derived Work and that contains a complete and accurate log 148 | of the changes. 149 | 150 | c. No information in the Derived Work implies that any persons, 151 | including (but not limited to) the authors of the original version 152 | of the Work, provide any support, including (but not limited to) 153 | the reporting and handling of errors, to recipients of the 154 | Derived Work unless those persons have stated explicitly that 155 | they do provide such support for the Derived Work. 156 | 157 | d. You distribute at least one of the following with the Derived Work: 158 | 159 | 1. A complete, unmodified copy of the Work; 160 | if your distribution of a modified component is made by 161 | offering access to copy the modified component from a 162 | designated place, then offering equivalent access to copy 163 | the Work from the same or some similar place meets this 164 | condition, even though third parties are not compelled to 165 | copy the Work along with the modified component; 166 | 167 | 2. Information that is sufficient to obtain a complete, 168 | unmodified copy of the Work. 169 | 170 | 7. If you are not the Current Maintainer of the Work, you may 171 | distribute a Compiled Work generated from a Derived Work, as long as 172 | the Derived Work is distributed to all recipients of the Compiled 173 | Work, and as long as the conditions of Clause 6, above, are met with 174 | regard to the Derived Work. 175 | 176 | 8. The conditions above are not intended to prohibit, and hence do not 177 | apply to, the modification, by any method, of any component so that it 178 | becomes identical to an updated version of that component of the Work as 179 | it is distributed by the Current Maintainer under Clause 4, above. 180 | 181 | 9. Distribution of the Work or any Derived Work in an alternative 182 | format, where the Work or that Derived Work (in whole or in part) is 183 | then produced by applying some process to that format, does not relax or 184 | nullify any sections of this license as they pertain to the results of 185 | applying that process. 186 | 187 | 10. a. A Derived Work may be distributed under a different license 188 | provided that license itself honors the conditions listed in 189 | Clause 6 above, in regard to the Work, though it does not have 190 | to honor the rest of the conditions in this license. 191 | 192 | b. If a Derived Work is distributed under a different license, that 193 | Derived Work must provide sufficient documentation as part of 194 | itself to allow each recipient of that Derived Work to honor the 195 | restrictions in Clause 6 above, concerning changes from the Work. 196 | 197 | 11. This license places no restrictions on works that are unrelated to 198 | the Work, nor does this license place any restrictions on aggregating 199 | such works with the Work by any means. 200 | 201 | 12. Nothing in this license is intended to, or may be used to, prevent 202 | complete compliance by all parties with all applicable laws. 203 | 204 | 205 | NO WARRANTY 206 | =========== 207 | 208 | There is no warranty for the Work. Except when otherwise stated in 209 | writing, the Copyright Holder provides the Work `as is', without 210 | warranty of any kind, either expressed or implied, including, but not 211 | limited to, the implied warranties of merchantability and fitness for a 212 | particular purpose. The entire risk as to the quality and performance 213 | of the Work is with you. Should the Work prove defective, you assume 214 | the cost of all necessary servicing, repair, or correction. 215 | 216 | In no event unless required by applicable law or agreed to in writing 217 | will The Copyright Holder, or any author named in the components of the 218 | Work, or any other party who may distribute and/or modify the Work as 219 | permitted above, be liable to you for damages, including any general, 220 | special, incidental or consequential damages arising out of any use of 221 | the Work or out of inability to use the Work (including, but not limited 222 | to, loss of data, data being rendered inaccurate, or losses sustained by 223 | anyone as a result of any failure of the Work to operate with any other 224 | programs), even if the Copyright Holder or said author or said other 225 | party has been advised of the possibility of such damages. 226 | 227 | 228 | MAINTENANCE OF THE WORK 229 | ======================= 230 | 231 | The Work has the status `author-maintained' if the Copyright Holder 232 | explicitly and prominently states near the primary copyright notice in 233 | the Work that the Work can only be maintained by the Copyright Holder 234 | or simply that it is `author-maintained'. 235 | 236 | The Work has the status `maintained' if there is a Current Maintainer 237 | who has indicated in the Work that they are willing to receive error 238 | reports for the Work (for example, by supplying a valid e-mail 239 | address). It is not required for the Current Maintainer to acknowledge 240 | or act upon these error reports. 241 | 242 | The Work changes from status `maintained' to `unmaintained' if there 243 | is no Current Maintainer, or the person stated to be Current 244 | Maintainer of the work cannot be reached through the indicated means 245 | of communication for a period of six months, and there are no other 246 | significant signs of active maintenance. 247 | 248 | You can become the Current Maintainer of the Work by agreement with 249 | any existing Current Maintainer to take over this role. 250 | 251 | If the Work is unmaintained, you can become the Current Maintainer of 252 | the Work through the following steps: 253 | 254 | 1. Make a reasonable attempt to trace the Current Maintainer (and 255 | the Copyright Holder, if the two differ) through the means of 256 | an Internet or similar search. 257 | 258 | 2. If this search is successful, then enquire whether the Work 259 | is still maintained. 260 | 261 | a. If it is being maintained, then ask the Current Maintainer 262 | to update their communication data within one month. 263 | 264 | b. If the search is unsuccessful or no action to resume active 265 | maintenance is taken by the Current Maintainer, then announce 266 | within the pertinent community your intention to take over 267 | maintenance. (If the Work is a LaTeX work, this could be 268 | done, for example, by posting to comp.text.tex.) 269 | 270 | 3a. If the Current Maintainer is reachable and agrees to pass 271 | maintenance of the Work to you, then this takes effect 272 | immediately upon announcement. 273 | 274 | b. If the Current Maintainer is not reachable and the Copyright 275 | Holder agrees that maintenance of the Work be passed to you, 276 | then this takes effect immediately upon announcement. 277 | 278 | 4. If you make an `intention announcement' as described in 2b. above 279 | and after three months your intention is challenged neither by 280 | the Current Maintainer nor by the Copyright Holder nor by other 281 | people, then you may arrange for the Work to be changed so as 282 | to name you as the (new) Current Maintainer. 283 | 284 | 5. If the previously unreachable Current Maintainer becomes 285 | reachable once more within three months of a change completed 286 | under the terms of 3b) or 4), then that Current Maintainer must 287 | become or remain the Current Maintainer upon request provided 288 | they then update their communication data within one month. 289 | 290 | A change in the Current Maintainer does not, of itself, alter the fact 291 | that the Work is distributed under the LPPL license. 292 | 293 | If you become the Current Maintainer of the Work, you should 294 | immediately provide, within the Work, a prominent and unambiguous 295 | statement of your status as Current Maintainer. You should also 296 | announce your new status to the same pertinent community as 297 | in 2b) above. 298 | 299 | 300 | WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE 301 | ====================================================== 302 | 303 | This section contains important instructions, examples, and 304 | recommendations for authors who are considering distributing their 305 | works under this license. These authors are addressed as `you' in 306 | this section. 307 | 308 | Choosing This License or Another License 309 | ---------------------------------------- 310 | 311 | If for any part of your work you want or need to use *distribution* 312 | conditions that differ significantly from those in this license, then 313 | do not refer to this license anywhere in your work but, instead, 314 | distribute your work under a different license. You may use the text 315 | of this license as a model for your own license, but your license 316 | should not refer to the LPPL or otherwise give the impression that 317 | your work is distributed under the LPPL. 318 | 319 | The document `modguide.tex' in the base LaTeX distribution explains 320 | the motivation behind the conditions of this license. It explains, 321 | for example, why distributing LaTeX under the GNU General Public 322 | License (GPL) was considered inappropriate. Even if your work is 323 | unrelated to LaTeX, the discussion in `modguide.tex' may still be 324 | relevant, and authors intending to distribute their works under any 325 | license are encouraged to read it. 326 | 327 | A Recommendation on Modification Without Distribution 328 | ----------------------------------------------------- 329 | 330 | It is wise never to modify a component of the Work, even for your own 331 | personal use, without also meeting the above conditions for 332 | distributing the modified component. While you might intend that such 333 | modifications will never be distributed, often this will happen by 334 | accident -- you may forget that you have modified that component; or 335 | it may not occur to you when allowing others to access the modified 336 | version that you are thus distributing it and violating the conditions 337 | of this license in ways that could have legal implications and, worse, 338 | cause problems for the community. It is therefore usually in your 339 | best interest to keep your copy of the Work identical with the public 340 | one. Many works provide ways to control the behavior of that work 341 | without altering any of its licensed components. 342 | 343 | How to Use This License 344 | ----------------------- 345 | 346 | To use this license, place in each of the components of your work both 347 | an explicit copyright notice including your name and the year the work 348 | was authored and/or last substantially modified. Include also a 349 | statement that the distribution and/or modification of that 350 | component is constrained by the conditions in this license. 351 | 352 | Here is an example of such a notice and statement: 353 | 354 | %% pig.dtx 355 | %% Copyright 2005 M. Y. Name 356 | % 357 | % This work may be distributed and/or modified under the 358 | % conditions of the LaTeX Project Public License, either version 1.3 359 | % of this license or (at your option) any later version. 360 | % The latest version of this license is in 361 | % http://www.latex-project.org/lppl.txt 362 | % and version 1.3 or later is part of all distributions of LaTeX 363 | % version 2005/12/01 or later. 364 | % 365 | % This work has the LPPL maintenance status `maintained'. 366 | % 367 | % The Current Maintainer of this work is M. Y. Name. 368 | % 369 | % This work consists of the files pig.dtx and pig.ins 370 | % and the derived file pig.sty. 371 | 372 | Given such a notice and statement in a file, the conditions 373 | given in this license document would apply, with the `Work' referring 374 | to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being 375 | generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' 376 | referring to any `LaTeX-Format', and both `Copyright Holder' and 377 | `Current Maintainer' referring to the person `M. Y. Name'. 378 | 379 | If you do not want the Maintenance section of LPPL to apply to your 380 | Work, change `maintained' above into `author-maintained'. 381 | However, we recommend that you use `maintained', as the Maintenance 382 | section was added in order to ensure that your Work remains useful to 383 | the community even when you can no longer maintain and support it 384 | yourself. 385 | 386 | Derived Works That Are Not Replacements 387 | --------------------------------------- 388 | 389 | Several clauses of the LPPL specify means to provide reliability and 390 | stability for the user community. They therefore concern themselves 391 | with the case that a Derived Work is intended to be used as a 392 | (compatible or incompatible) replacement of the original Work. If 393 | this is not the case (e.g., if a few lines of code are reused for a 394 | completely different task), then clauses 6b and 6d shall not apply. 395 | 396 | 397 | Important Recommendations 398 | ------------------------- 399 | 400 | Defining What Constitutes the Work 401 | 402 | The LPPL requires that distributions of the Work contain all the 403 | files of the Work. It is therefore important that you provide a 404 | way for the licensee to determine which files constitute the Work. 405 | This could, for example, be achieved by explicitly listing all the 406 | files of the Work near the copyright notice of each file or by 407 | using a line such as: 408 | 409 | % This work consists of all files listed in manifest.txt. 410 | 411 | in that place. In the absence of an unequivocal list it might be 412 | impossible for the licensee to determine what is considered by you 413 | to comprise the Work and, in such a case, the licensee would be 414 | entitled to make reasonable conjectures as to which files comprise 415 | the Work. 416 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bespoke, Multifunctional Class 2 | 3 | #### [Documentation / Demo](https://tecosaur.com/lfs/bmc/bmc.pdf) 4 | 5 | ### A LaTeX Class designed to make my documents magnificent in style as well as content 6 | 7 | This project was heavily inspired, and initially built off the fantastic work of @HarveySheppard (see [yLaTeX](https://github.com/HarveySheppard/yLaTeX)). 8 | 9 | It is currently a work-in-progress, and will likely remain such until I am happy with it (i.e. indefinitely). 10 | 11 | If anybody out there happens to like this and use it, good for you :smiley:. 12 | Furthermore (as unlikely as this may be), if anybody does so and has an idea for, or even implements an improvement do be sure to give me a shout or open a PR. I'd really appreciate it :grin: 13 | 14 | ![demo-img](documentation/bmc-demo-img.png) 15 | 16 | ## Installation 17 | 18 | ### Method one 19 | 20 | Clone (or download) this folder into the your 21 | `texmf` directory (try `kpsewhich -var-value=TEXMFHOME` if in doubt). 22 | Run `texhash` 23 | 24 | If you have issues with `fontawesome5` (I did), try the following: 25 | `updmap-sys --enable Map=fontawesome5.map` (will probably require sudo). 26 | 27 | ### Method two 28 | 29 | Download this folder and shove the following file in the same folder as your working document. 30 | 31 | `bmc.cls`, `bmc-color.sty`, `bmc-fonts.sty`, `bmc-maths.sty`, `bmc-sectioning.sty`, `infoBulle.sty`, `marginInfoBulle.sty`, `yMainColor.sty`, `yMarginDesign` 32 | -------------------------------------------------------------------------------- /bmc-boxes.sty: -------------------------------------------------------------------------------- 1 | %══════════════════════════════════════════% 2 | % % 3 | % BMC % 4 | % A Bespoke, Multipurpose Class % 5 | % -- Boxes of Vaious Kinds -- % 6 | % -~=~- % 7 | % Authored by tecosaur % 8 | % % 9 | %══════════════════════════════════════════% 10 | 11 | \NeedsTeXFormat{LaTeX2e} 12 | \ProvidesPackage{bmc-boxes}[2019/06/09 Fonts functionality used in the BMC class] 13 | 14 | \ifdefined\@bmc\else 15 | \RequirePackage{bmc-fonts} 16 | \RequirePackage{bmc-color} 17 | \RequirePackage{bmc-ref} 18 | \fi 19 | 20 | \RequirePackage[many]{tcolorbox} 21 | \RequirePackage{interfaces-base} 22 | \LoadInterface{pgfkeys} 23 | \usetikzlibrary{calc} 24 | 25 | \tcbset{ 26 | bmcbox/.style={ 27 | enhanced, 28 | % text 29 | fonttitle=\large\fontfamily{\headingsFont}\fontseries{sb}\selectfont, 30 | coltitle=text, 31 | colback=infoBulleBackground, 32 | colbacktitle=infoBulleBackground, 33 | % frame 34 | % frame hidden, 35 | colframe=infoBulleBackground, 36 | toprule=4pt,titlerule=0pt,bottomrule=0pt,rightrule=0pt,leftrule=0pt, 37 | segmentation hidden, 38 | sharpish corners, 39 | overlay={% 40 | \draw[line width=2.5pt,#1] (frame.north west)--(frame.south west); 41 | }, 42 | % margins & padding 43 | before skip=\baselineskip, 44 | after skip=\baselineskip, 45 | boxsep=2pt, 46 | top=6pt, 47 | bottom=4pt, 48 | left=8pt, 49 | right=6pt, 50 | breakable, 51 | }, 52 | bmcboxtitle/.style n args=3{ 53 | extras middle and last={% 54 | top=20pt, 55 | overlay={% 56 | \draw[line width=2.5pt,#1] (frame.north west)--(frame.south west); 57 | % \draw[line width=0.5pt,dashed,#1] (frame.north west)--(frame.north east); 58 | \draw[] {([yshift=-12pt,xshift=4.5pt]frame.north west)} node[anchor=west] {#2}; 59 | \draw[] {([yshift=-12pt,xshift=-4.5pt]frame.north east)} node[anchor=east] {#3}; 60 | } 61 | }, 62 | } 63 | } 64 | 65 | % Counter Reset 66 | %------------------------------------------------------------------------------- 67 | \pgfkeys{ 68 | /infoBulle/math/.cd, 69 | counterReset/.store in=\infoBulle@mathCounterReset, 70 | counterReset = section, 71 | } 72 | % Icon Radius 73 | %------------------------------------------------------------------------------- 74 | \pgfkeys{ 75 | /infoBulle/icon/.cd, 76 | radius/.store as dimen 77 | } 78 | 79 | % Icon Shape 80 | %------------------------------------------------------------------------------- 81 | \DeclareDocumentCommand{\infoBulle@hexagon}{m m O{}}{ 82 | \fill [#3] ($ (#1) + (0:#2) $) -- ($ (#1) + (60:#2) $) -- ($ (#1) + (120:#2) $) -- ($ (#1) + (180:#2) $) -- ($ (#1) + (240:#2) $) -- ($ (#1) + (300:#2) $) -- cycle; 83 | } 84 | \pgfkeys{ 85 | /infoBulle/icon/.cd, 86 | shape/.is choice, 87 | shape/round/.style = {/infoBulle/icon/radius = 3.0mm, /infoBulle/icon/shapeCommand/.code n args = {3}{\fill[##3] (##1) circle (##2);}}, 88 | shape/hexagon/.style = {/infoBulle/icon/radius = 4mm, /infoBulle/icon/shapeCommand/.code n args = {3}{\infoBulle@hexagon{##1}{##2}[##3, rotate=90];}}, 89 | shape/round, 90 | } 91 | 92 | \DeclareDocumentCommand{\faAbstractIcon}{m m O{text=infoBulleBackground}}{% 93 | \begin{tikzpicture}[inner sep=0mm, baseline=(iconText.base)]% 94 | \coordinate (iconCenter) at (0,0); 95 | \pgfkeys{/infoBulle/icon/shapeCommand={iconCenter}{\pgfkeysvalueof{/infoBulle/icon/radius}}{#1}} 96 | \draw (iconCenter) node[text width=.6cm, anchor=center, align=center, font=\fontsize{.35cm}{.42cm}, #3] (iconText) {#2}; 97 | \end{tikzpicture} 98 | } 99 | 100 | \DeclareDocumentCommand{\newBmcBox}{m m m O{box} O{\faAngleRight}}{ 101 | \DeclareTColorBox[auto counter]{#1}{O{} O{} O{\thetcbcounter}}{ 102 | bmcbox={#2},bmcboxtitle={#2}{% 103 | \faAbstractIcon{infoBulleBackground}{#5}[text=#2!70!page]% 104 | \colorlet{inlinemath}{text!50!page}% 105 | \color{text!50!page}\small\fontfamily{\headingsFont}\fontseries{mb}\selectfont% 106 | \ifstrempty{##2}{#3~\thetcbcounter}{##2}% 107 | \fontseries{tx}\selectfont% 108 | \ifstrempty{##1}{}{\ifstrempty{##2}{}{: ##1}}% 109 | \itshape\enspace continued% 110 | }{\ifstrempty{##2}{}{\small\fontfamily{\headingsFont}\fontseries{tx}\selectfont\itshape% 111 | \hfill\textcolor{text!50!page}{\thetcbcounter}}}, 112 | title={% 113 | \faAbstractIcon{#2}{#5}~% 114 | \colorlet{inlinemath}{text}% 115 | \ifstrempty{##2}{#3~\thetcbcounter}{##2}% 116 | \ifstrempty{##1}{}{: \fontseries{tx}\selectfont##1}% 117 | \ifstrempty{##2}{}{\hfill\textcolor{text!50!page}{\thetcbcounter}}}, 118 | label=#4:##3, 119 | } 120 | \expandafter\newcommand\csname tcb@cnt@#1autorefname\endcsname{#3} 121 | } 122 | 123 | % \newBmcBox{}{}{}[<ref prefix>][<fa icon name>] 124 | \newBmcBox{example}{exampleColor}{Example}[eg][\faClipboard] 125 | \newBmcBox{critical}{criticalColor}{Critical}[crit][\faTimes] 126 | \newBmcBox{question}{questionColor}{Question}[qu][\faQuestion] 127 | \newBmcBox{info}{informationColor}{Information}[info][\faInfo] 128 | \newBmcBox{check}{checkColor}{Check}[check][\faCheck] 129 | \newBmcBox{warning}{warningColor}{Warning}[warn][\faExclamation] 130 | \newBmcBox{tip}{tipColor}{Tip}[tip][\faLightbulb] 131 | 132 | \newcommand{\bmcBoxMathIcon}{\fontsize{.6cm}{.72cm}\selectfont$\pi$} 133 | \newBmcBox{maths}{mathematicalColor}{Maths}[mth][\bmcBoxMathIcon] 134 | \newBmcBox{proof}{mathematicalColor}{Proof}[prf][\bmcBoxMathIcon] 135 | \newBmcBox{theorem}{mathematicalColor}{Theorem}[thr][\bmcBoxMathIcon] 136 | \newBmcBox{lemma}{mathematicalColor}{Lemma}[lem][\bmcBoxMathIcon] 137 | \newBmcBox{corollary}{mathematicalColor}{Corollary}[cor][\bmcBoxMathIcon] 138 | \newBmcBox{definition}{mathematicalColor}{Definition}[def][\bmcBoxMathIcon] 139 | \newBmcBox{axiom}{mathematicalColor}{Axiom}[axi][\bmcBoxMathIcon] 140 | \newBmcBox{proposition}{mathematicalColor}{Proposition}[prop][\bmcBoxMathIcon] 141 | -------------------------------------------------------------------------------- /bmc-color.sty: -------------------------------------------------------------------------------- 1 | %══════════════════════════════════════════% 2 | % % 3 | % BMC % 4 | % A Bespoke, Multipurpose Class % 5 | % -- Colour Functionality -- % 6 | % -~=~- % 7 | % Authored by tecosaur % 8 | % % 9 | %══════════════════════════════════════════% 10 | 11 | \ProvidesPackage{bmc-color}[2019/06/09 Colour functionality used in the BMC class] 12 | \NeedsTeXFormat{LaTeX2e} 13 | 14 | \RequirePackage{ifdraft} 15 | \ifdraft{ 16 | \PassOptionsToPackage{gray}{xcolor} 17 | }{ 18 | \ifbool{bmc@print}{ 19 | \PassOptionsToPackage{cmyk}{xcolor} 20 | }{ 21 | \PassOptionsToPackage{natural}{xcolor} 22 | } 23 | } 24 | 25 | \RequirePackage[dvipsnames,svgnames,table,hyperref]{xcolor} 26 | 27 | \ifdefined\@bmc \else 28 | \RequirePackage{etoolbox} 29 | \RequirePackage{kvoptions} 30 | 31 | \SetupKeyvalOptions{family=bmc, prefix=bmc@} 32 | \DeclareStringOption[de]{palette} 33 | 34 | \DeclareBoolOption[true]{light} 35 | \DeclareBoolOption{dark} 36 | 37 | \DeclareBoolOption{print} 38 | 39 | \ProcessKeyvalOptions* 40 | \fi 41 | 42 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 43 | % Theme Colours 44 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 45 | 46 | \ifbool{bmc@dark}{ 47 | \definecolor{page}{HTML}{222222} % dark grey 48 | \definecolor{text}{HTML}{FCFCFC} % white 49 | }{ 50 | \definecolor{page}{HTML}{FFFFFF} % white 51 | \definecolor{text}{HTML}{000000} % black 52 | } 53 | 54 | \pagecolor{page} 55 | \color{text} 56 | 57 | \definecolor{primary}{HTML}{019875} % emerald 58 | % \definecolor{primaryVariant}{HTML}{1CBE77} % emerald mixed with lighter green 59 | \AtEndPreamble{ 60 | \@ifundefined{\string\color@primaryVariant}{\colorlet{primaryVariant}{primary!75!Cream>twheel,-3,360}}{} 61 | } 62 | \definecolor{contrastColour}{HTML}{E8F1F2} % white 63 | 64 | \definecolor{tertiary}{HTML}{C47238} % yellow 65 | \definecolor{secondary}{HTML}{C6B53C} % orange 66 | \definecolor{quaternary}{HTML}{BD3E4C} % red 67 | 68 | \definecolor{alternativePrimary}{HTML}{13293D} % blue 69 | 70 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 71 | % Colour Pallets 72 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 73 | % source: https://flatuicolors.com/ 74 | 75 | \newcommand{\newpalette}[2]{ 76 | \expandafter\newcommand\csname palette#1\endcsname{#2}% 77 | } 78 | \newcommand{\usepalette}[1]{ 79 | \undefinepalette 80 | \csname palette#1\endcsname 81 | \ensurepalettecomplete 82 | \reloadBoxColours 83 | } 84 | 85 | \newcommand{\reloadBoxColours}{ 86 | \colorlet{infoBulleBackground}{page!98!text} 87 | \colorlet{infoBulleText}{text} 88 | \colorlet{marginInfoBulleBackground}{page} 89 | \colorlet{marginInfoBulleText}{text} 90 | 91 | \colorlet{criticalColor}{Red} 92 | \colorlet{questionColor}{Purple} 93 | \colorlet{informationColor}{Green} 94 | \colorlet{checkColor}{Blue} 95 | \colorlet{warningColor}{Orange} 96 | \colorlet{tipColor}{Purple} 97 | \colorlet{exampleColor}{Blue} 98 | \colorlet{mathematicalColor}{Orange} 99 | \colorlet{codeColor}{Grey} 100 | } 101 | 102 | \newcommand{\undefinepalette}{ 103 | \expandafter\let\csname\string\color@Cream\endcsname\undefined 104 | \expandafter\let\csname\string\color@White\endcsname\undefined 105 | \expandafter\let\csname\string\color@Black\endcsname\undefined 106 | \expandafter\let\csname\string\color@Grey\endcsname\undefined 107 | \expandafter\let\csname\string\color@LightGrey\endcsname\undefined 108 | \expandafter\let\csname\string\color@DarkGrey\endcsname\undefined 109 | \expandafter\let\csname\string\color@Red\endcsname\undefined 110 | \expandafter\let\csname\string\color@LightRed\endcsname\undefined 111 | \expandafter\let\csname\string\color@DarkRed\endcsname\undefined 112 | \expandafter\let\csname\string\color@Yellow\endcsname\undefined 113 | \expandafter\let\csname\string\color@LightYellow\endcsname\undefined 114 | \expandafter\let\csname\string\color@DarkYellow\endcsname\undefined 115 | \expandafter\let\csname\string\color@Blue\endcsname\undefined 116 | \expandafter\let\csname\string\color@LightBlue\endcsname\undefined 117 | \expandafter\let\csname\string\color@DarkBlue\endcsname\undefined 118 | \expandafter\let\csname\string\color@Green\endcsname\undefined 119 | \expandafter\let\csname\string\color@LightGreen\endcsname\undefined 120 | \expandafter\let\csname\string\color@DarkGreen\endcsname\undefined 121 | \expandafter\let\csname\string\color@Orange\endcsname\undefined 122 | \expandafter\let\csname\string\color@LightOrange\endcsname\undefined 123 | \expandafter\let\csname\string\color@DarkOrange\endcsname\undefined 124 | \expandafter\let\csname\string\color@Purple\endcsname\undefined 125 | \expandafter\let\csname\string\color@LightPurple\endcsname\undefined 126 | \expandafter\let\csname\string\color@DarkPurple\endcsname\undefined 127 | \expandafter\let\csname\string\color@Cyan\endcsname\undefined 128 | \expandafter\let\csname\string\color@LightCyan\endcsname\undefined 129 | \expandafter\let\csname\string\color@DarkCyan\endcsname\undefined 130 | } 131 | 132 | \newcommand{\ensurepalettecomplete}{ 133 | \@ifundefined{\string\color@Cream}{\definecolor{Cream}{HTML}{FFFCCF}}{} 134 | \@ifundefined{\string\color@White}{\definecolor{White}{HTML}{FCFCFC}}{} 135 | \@ifundefined{\string\color@Black}{\definecolor{Black}{HTML}{2f3640}}{} 136 | 137 | \@ifundefined{\string\color@Grey}{\colorlet{Grey}{White!50!Black}}{} 138 | \@ifundefined{\string\color@LightGrey}{\colorlet{LightGrey}{Grey!70!White}}{} 139 | \@ifundefined{\string\color@DarkGrey}{\colorlet{DarkGrey}{Grey!70!Black}}{} 140 | 141 | \@ifundefined{\string\color@Red}{\definecolor{Red}{HTML}{eb3b47}}{} 142 | \@ifundefined{\string\color@LightRed}{\colorlet{LightRed}{Red!80!White}}{} 143 | \@ifundefined{\string\color@DarkRed}{\colorlet{DarkRed}{Red!80!Black}}{} 144 | 145 | \@ifundefined{\string\color@Yellow}{\definecolor{Yellow}{HTML}{f7b731}}{} 146 | \@ifundefined{\string\color@LightYellow}{\colorlet{LightYellow}{Yellow!75!White}}{} 147 | \@ifundefined{\string\color@DarkYellow}{\colorlet{DarkYellow}{Yellow!90!Black}}{} 148 | 149 | \@ifundefined{\string\color@Blue}{\definecolor{Blue}{HTML}{3867d6}}{} 150 | \@ifundefined{\string\color@LightBlue}{\colorlet{LightBlue}{Blue!85!White}}{} 151 | \@ifundefined{\string\color@DarkBlue}{\colorlet{DarkBlue}{Blue!85!Black}}{} 152 | 153 | \@ifundefined{\string\color@Green}{\definecolor{Green}{HTML}{20bf6b}}{} 154 | \@ifundefined{\string\color@LightGreen}{\colorlet{LightGreen}{Green!85!White}}{} 155 | \@ifundefined{\string\color@DarkGreen}{\colorlet{DarkGreen}{Green!85!Black}}{} 156 | 157 | \@ifundefined{\string\color@Orange}{\definecolor{Orange}{HTML}{fa8231}}{} 158 | \@ifundefined{\string\color@LightOrange}{\colorlet{LightOrange}{Orange!85!White}}{} 159 | \@ifundefined{\string\color@DarkOrange}{\colorlet{DarkOrange}{Orange!90!Black}}{} 160 | 161 | \@ifundefined{\string\color@Purple}{\definecolor{Purple}{HTML}{8854d0}}{} 162 | \@ifundefined{\string\color@LightPurple}{\colorlet{LightPurple}{Purple!70!White}}{} 163 | \@ifundefined{\string\color@DarkPurple}{\colorlet{DarkPurple}{Purple!70!Black}}{} 164 | 165 | \@ifundefined{\string\color@Cyan}{\definecolor{Cyan}{HTML}{0fb9b1}}{} 166 | \@ifundefined{\string\color@LightCyan}{\colorlet{LightCyan}{Cyan!85!White}}{} 167 | \@ifundefined{\string\color@DarkCyan}{\colorlet{DarkCyan}{Cyan!85!Black}}{} 168 | } 169 | 170 | \newpalette{de}{ 171 | % Shades 172 | \definecolor{LightGrey}{HTML}{a5b1c2} 173 | \definecolor{Grey}{HTML}{778ca3} 174 | \definecolor{DarkGrey}{HTML}{4b6584} 175 | \definecolor{Black}{HTML}{231F20} 176 | % Primary Colours 177 | \definecolor{Red}{HTML}{eb3b47} 178 | \definecolor{LightRed}{HTML}{fc5c65} 179 | \definecolor{DarkRed}{HTML}{d91c38} 180 | 181 | \definecolor{Yellow}{HTML}{f7b731} 182 | \definecolor{LightYellow}{HTML}{fed330} 183 | \definecolor{DarkYellow}{HTML}{f0a132} 184 | 185 | \definecolor{Blue}{HTML}{3867d6} 186 | \definecolor{LightBlue}{HTML}{4b7bec} 187 | \definecolor{DarkBlue}{HTML}{2654bf} 188 | % tertiary Colours 189 | \definecolor{Green}{HTML}{20bf6b} 190 | \definecolor{LightGreen}{HTML}{26de81} 191 | \definecolor{DarkGreen}{HTML}{1ba155} 192 | 193 | \definecolor{Orange}{HTML}{fa8231} 194 | \definecolor{LightOrange}{HTML}{fd9644} 195 | \definecolor{DarkOrange}{HTML}{f76b20} 196 | 197 | \definecolor{Purple}{HTML}{8854d0} 198 | \definecolor{LightPurple}{HTML}{a55eea} 199 | \definecolor{DarkPurple}{HTML}{6e49b8} 200 | % secondary+ Colours 201 | % \definecolor{Brown}{HTML}{} 202 | \definecolor{Cyan}{HTML}{0fb9b1} 203 | \definecolor{LightCyan}{HTML}{2bcbba} 204 | \definecolor{DarkCyan}{HTML}{00a8a8} 205 | } 206 | 207 | \newpalette{fui}{ 208 | % Shades 209 | \definecolor{White}{HTML}{ecf0f1} 210 | \definecolor{LightGrey}{HTML}{bdc3c7} 211 | \definecolor{Grey}{HTML}{95a5a6} 212 | \definecolor{DarkGrey}{HTML}{7f8c8d} 213 | \definecolor{Black}{HTML}{2c3e50} 214 | % Primary Colours 215 | \definecolor{Red}{HTML}{e74c3c} 216 | % \definecolor{LightRed}{HTML}{fc5c65} 217 | \definecolor{DarkRed}{HTML}{c0392b} 218 | 219 | \definecolor{Yellow}{HTML}{f1c40f} 220 | % \definecolor{LightYellow}{HTML}{fed330} 221 | % \definecolor{DarkYellow}{HTML}{f0a132} 222 | 223 | \definecolor{Blue}{HTML}{3498db} 224 | % \definecolor{LightBlue}{HTML}{4b7bec} 225 | \definecolor{DarkBlue}{HTML}{2980b9} 226 | % tertiary Colours 227 | \definecolor{Green}{HTML}{2ecc71} 228 | % \definecolor{LightGreen}{HTML}{26de81} 229 | \definecolor{DarkGreen}{HTML}{27ae60} 230 | 231 | \definecolor{Orange}{HTML}{e67e22} 232 | \definecolor{LightOrange}{HTML}{f39c12} 233 | \definecolor{DarkOrange}{HTML}{d35400} 234 | 235 | \definecolor{Purple}{HTML}{9b59b6} 236 | % \definecolor{LightPurple}{HTML}{a55eea} 237 | \definecolor{DarkPurple}{HTML}{8e44ad} 238 | % secondary+ Colours 239 | % \definecolor{Brown}{HTML}{} 240 | \definecolor{Cyan}{HTML}{1abc9c} 241 | % \definecolor{LightCyan}{HTML}{2bcbba} 242 | \definecolor{DarkCyan}{HTML}{16a085} 243 | } 244 | 245 | \newpalette{au}{ 246 | % Shades 247 | \definecolor{White}{HTML}{dff9fb} 248 | \definecolor{LightGrey}{HTML}{c7ecee} 249 | \definecolor{Grey}{HTML}{95afc0} 250 | \definecolor{DarkGrey}{HTML}{535c68} 251 | \definecolor{Black}{HTML}{130f40} 252 | % Primary Colours 253 | \definecolor{Red}{HTML}{eb4d4b} 254 | \definecolor{LightRed}{HTML}{ff7979} 255 | 256 | \definecolor{Yellow}{HTML}{f9ca24} 257 | \definecolor{LightYellow}{HTML}{f6e58d} 258 | 259 | \definecolor{Blue}{HTML}{4834d4} 260 | \definecolor{LightBlue}{HTML}{686de0} 261 | % tertiary Colours 262 | \definecolor{Green}{HTML}{6ab04c} 263 | \definecolor{LightGreen}{HTML}{badc58} 264 | 265 | \definecolor{Orange}{HTML}{f0932b} 266 | \definecolor{LightOrange}{HTML}{ffbe76} 267 | 268 | \definecolor{Purple}{HTML}{be2edd} 269 | \definecolor{LightPurple}{HTML}{e056fd} 270 | % secondary+ Colours 271 | \definecolor{Cyan}{HTML}{22a6b3} 272 | \definecolor{LightCyan}{HTML}{7ed6df} 273 | } 274 | 275 | \newpalette{us}{ 276 | % Shades 277 | \definecolor{LightGrey}{HTML}{dfe6e9} 278 | \definecolor{Grey}{HTML}{b2bec3} 279 | \definecolor{DarkGrey}{HTML}{636e72} 280 | \definecolor{Black}{HTML}{2d3436} 281 | % Primary Colours 282 | \definecolor{Red}{HTML}{d63031} 283 | \definecolor{LightRed}{HTML}{ff7675} 284 | 285 | \definecolor{Yellow}{HTML}{fdcb6e} 286 | \definecolor{LightYellow}{HTML}{ffeaa7} 287 | 288 | \definecolor{Blue}{HTML}{0984e3} 289 | \definecolor{LightBlue}{HTML}{74b9ff} 290 | % tertiary Colours 291 | \definecolor{Green}{HTML}{00b894} 292 | \definecolor{LightGreen}{HTML}{55efc4} 293 | 294 | \definecolor{Orange}{HTML}{e17055} 295 | \definecolor{LightOrange}{HTML}{fab1a0} 296 | 297 | \definecolor{Purple}{HTML}{6c5ce7} 298 | \definecolor{LightPurple}{HTML}{a29bfe} 299 | % secondary+ Colours 300 | \definecolor{Cyan}{HTML}{00cec9} 301 | \definecolor{LightCyan}{HTML}{81ecec} 302 | } 303 | 304 | \newpalette{uk}{ 305 | % Shades 306 | \definecolor{White}{HTML}{f5f6fa} 307 | \definecolor{LightGrey}{HTML}{dcdde1} 308 | \definecolor{Grey}{HTML}{7f8fa6} 309 | \definecolor{DarkGrey}{HTML}{718093} 310 | \definecolor{Black}{HTML}{2f3640} 311 | % Primary Colours 312 | \definecolor{Red}{HTML}{e84118} 313 | \definecolor{DarkRed}{HTML}{c23616} 314 | 315 | \definecolor{Yellow}{HTML}{fbc531} 316 | \definecolor{DarkYellow}{HTML}{e1b12c} 317 | 318 | \definecolor{Blue}{HTML}{00a8ff} 319 | \definecolor{DarkBlue}{HTML}{0097e6} 320 | % tertiary Colours 321 | \definecolor{Green}{HTML}{4cd137} 322 | \definecolor{DarkGreen}{HTML}{44bd32} 323 | 324 | 325 | \definecolor{Purple}{HTML}{9c88ff} 326 | \definecolor{DarkPurple}{HTML}{8c7ae6} 327 | % secondary+ Colours 328 | } 329 | 330 | \newpalette{ca}{ 331 | % Shades 332 | \definecolor{LightGrey}{HTML}{c8d6e5} 333 | \definecolor{Grey}{HTML}{8395a7} 334 | \definecolor{DarkGrey}{HTML}{576574} 335 | \definecolor{Black}{HTML}{222f3e} 336 | % Primary Colours 337 | \definecolor{Red}{HTML}{ee5253} 338 | \definecolor{LightRed}{HTML}{ff6b6b} 339 | 340 | \definecolor{Yellow}{HTML}{feca57} 341 | 342 | \definecolor{Blue}{HTML}{2e86de} 343 | \definecolor{LightBlue}{HTML}{54a0ff} 344 | % tertiary Colours 345 | \definecolor{Green}{HTML}{1dd1a1} 346 | \definecolor{DarkGreen}{HTML}{10ac84} 347 | 348 | \definecolor{Orange}{HTML}{ff9f43} 349 | 350 | \definecolor{Purple}{HTML}{5f27cd} 351 | \definecolor{LightPurple}{HTML}{aaaaaa} 352 | \definecolor{DarkPurple}{HTML}{341f97} 353 | % secondary+ Colours 354 | \definecolor{Cyan}{HTML}{0abde3} 355 | \definecolor{LightCyan}{HTML}{48dbfb} 356 | } 357 | 358 | \newpalette{cn}{ 359 | % Shades 360 | \definecolor{White}{HTML}{ffffff} 361 | \definecolor{LightGrey}{HTML}{a4b0be} 362 | \definecolor{Grey}{HTML}{747d8c} 363 | \definecolor{DarkGrey}{HTML}{57606f} 364 | \definecolor{Black}{HTML}{2f3542} 365 | % Primary Colours 366 | \definecolor{Red}{HTML}{ff4757} 367 | \definecolor{LightRed}{HTML}{ff6b81} 368 | 369 | \definecolor{Yellow}{HTML}{eccc68} 370 | \definecolor{DarkYellow}{HTML}{ffa502} 371 | 372 | \definecolor{Blue}{HTML}{5352ed} 373 | \definecolor{LightBlue}{HTML}{70a1ff} 374 | % tertiary Colours 375 | \definecolor{Green}{HTML}{2ed573} 376 | \definecolor{LightGreen}{HTML}{7bed9f} 377 | 378 | \definecolor{Orange}{HTML}{ff7f50} 379 | \definecolor{DarkOrange}{HTML}{ff6348} 380 | 381 | \definecolor{Purple}{HTML}{5352ed} 382 | % secondary+ Colours 383 | \definecolor{Cyan}{HTML}{1e90ff} 384 | } 385 | 386 | \newpalette{nl}{ 387 | % Primary Colours 388 | \definecolor{Red}{HTML}{EA2027} 389 | 390 | \definecolor{Yellow}{HTML}{FFC312} 391 | \definecolor{DarkYellow}{HTML}{F79F1F} 392 | 393 | \definecolor{Blue}{HTML}{0652DD} 394 | \definecolor{DarkBlue}{HTML}{1B1464} 395 | % tertiary Colours 396 | \definecolor{Green}{HTML}{A3CB38} 397 | \definecolor{LightGreen}{HTML}{C4E538} 398 | \definecolor{DarkGreen}{HTML}{009432} 399 | 400 | \definecolor{Orange}{HTML}{EE5A24} 401 | 402 | \definecolor{Purple}{HTML}{9980FA} 403 | \definecolor{LightPurple}{HTML}{D980FA} 404 | \definecolor{DarkPurple}{HTML}{5758BB} 405 | % secondary+ Colours 406 | \definecolor{Cyan}{HTML}{1289A7} 407 | \definecolor{LightCyan}{HTML}{12CBC4} 408 | \definecolor{DarkCyan}{HTML}{006266} 409 | } 410 | 411 | \newpalette{fr}{ 412 | % Shades 413 | \definecolor{Grey}{HTML}{3c6382} 414 | \definecolor{DarkGrey}{HTML}{0a3d62} 415 | % Primary Colours 416 | \definecolor{Red}{HTML}{eb2f06} 417 | \definecolor{LightRed}{HTML}{e55039} 418 | \definecolor{DarkRed}{HTML}{b71540} 419 | 420 | \definecolor{Yellow}{HTML}{f6b93b} 421 | \definecolor{LightYellow}{HTML}{fad390} 422 | 423 | \definecolor{Blue}{HTML}{1e3799} 424 | \definecolor{LightBlue}{HTML}{4a69bd} 425 | \definecolor{DarkBlue}{HTML}{0c2461} 426 | % tertiary Colours 427 | \definecolor{Green}{HTML}{78e08f} 428 | \definecolor{LightGreen}{HTML}{b8e994} 429 | 430 | \definecolor{Orange}{HTML}{fa983a} 431 | \definecolor{LightOrange}{HTML}{f8c291} 432 | \definecolor{DarkOrange}{HTML}{e58e26} 433 | 434 | % secondary+ Colours 435 | \definecolor{Cyan}{HTML}{38ada9} 436 | \definecolor{DarkCyan}{HTML}{079992} 437 | } 438 | 439 | \newpalette{in}{ 440 | % Shades 441 | \definecolor{White}{HTML}{F8EFBA} 442 | \definecolor{Grey}{HTML}{CAD3C8} 443 | \definecolor{Black}{HTML}{2C3A47} 444 | % Primary Colours 445 | 446 | \definecolor{DarkYellow}{HTML}{EAB543} 447 | 448 | % tertiary Colours 449 | \definecolor{Green}{HTML}{55E6C1} 450 | \definecolor{LightGreen}{HTML}{9AECDB} 451 | \definecolor{DarkGreen}{HTML}{58B19F} 452 | 453 | \definecolor{Orange}{HTML}{F97F51} 454 | \definecolor{LightOrange}{HTML}{FEA47F} 455 | 456 | \definecolor{Purple}{HTML}{B33771} 457 | \definecolor{LightPurple}{HTML}{82589F} 458 | \definecolor{DarkPurple}{HTML}{6D214F} 459 | % secondary+ Colours 460 | } 461 | 462 | \newpalette{ru}{ 463 | % Shades 464 | \definecolor{Grey}{HTML}{596275} 465 | \definecolor{DarkGrey}{HTML}{303952} 466 | % Primary Colours 467 | \definecolor{Red}{HTML}{e66767} 468 | \definecolor{LightRed}{HTML}{ea8685} 469 | 470 | \definecolor{Yellow}{HTML}{f5cd79} 471 | \definecolor{LightYellow}{HTML}{f7d794} 472 | 473 | \definecolor{Blue}{HTML}{546de5} 474 | \definecolor{LightBlue}{HTML}{778beb} 475 | % tertiary Colours 476 | 477 | \definecolor{Orange}{HTML}{f19066} 478 | \definecolor{LightOrange}{HTML}{f3a683} 479 | 480 | \definecolor{Purple}{HTML}{574b90} 481 | \definecolor{LightPurple}{HTML}{786fa6} 482 | % secondary+ Colours 483 | \definecolor{Cyan}{HTML}{3dc1d3} 484 | \definecolor{LightCyan}{HTML}{63cdda} 485 | } 486 | 487 | \newpalette{es}{ 488 | % Shades 489 | \definecolor{White}{HTML}{f7f1e3} 490 | \definecolor{LightGrey}{HTML}{d1ccc0} 491 | \definecolor{Grey}{HTML}{aaa69d} 492 | \definecolor{DarkGrey}{HTML}{84817a} 493 | % Primary Colours 494 | \definecolor{LightRed}{HTML}{ff5252} 495 | \definecolor{DarkRed}{HTML}{b33939} 496 | 497 | \definecolor{Yellow}{HTML}{ffb142} 498 | \definecolor{LightYellow}{HTML}{ffda79} 499 | \definecolor{DarkYellow}{HTML}{cc8e35} 500 | 501 | \definecolor{Blue}{HTML}{34ace0} 502 | \definecolor{DarkBlue}{HTML}{227093} 503 | % tertiary Colours 504 | \definecolor{Green}{HTML}{33d9b2} 505 | \definecolor{DarkGreen}{HTML}{218c74} 506 | 507 | \definecolor{Orange}{HTML}{ff793f} 508 | \definecolor{DarkOrange}{HTML}{cd6133} 509 | 510 | \definecolor{Purple}{HTML}{474787} 511 | \definecolor{LightPurple}{HTML}{706fd3} 512 | \definecolor{DarkPurple}{HTML}{40407a} 513 | % secondary+ Colours 514 | } 515 | 516 | \newpalette{se}{ 517 | % Shades 518 | \definecolor{LightGrey}{HTML}{d2dae2} 519 | \definecolor{Grey}{HTML}{808e9b} 520 | \definecolor{DarkGrey}{HTML}{485460} 521 | \definecolor{Black}{HTML}{1e272e} 522 | % Primary Colours 523 | \definecolor{Red}{HTML}{ff3f34} 524 | \definecolor{LightRed}{HTML}{ff5e57} 525 | 526 | \definecolor{Yellow}{HTML}{ffd32a} 527 | \definecolor{LightYellow}{HTML}{ffdd59} 528 | 529 | \definecolor{Blue}{HTML}{0fbcf9} 530 | \definecolor{LightBlue}{HTML}{4bcffa} 531 | \definecolor{DarkBlue}{HTML}{3c40c6} 532 | % tertiary Colours 533 | \definecolor{Green}{HTML}{05c46b} 534 | \definecolor{LightGreen}{HTML}{0be881} 535 | 536 | \definecolor{Orange}{HTML}{ffc048} 537 | \definecolor{LightOrange}{HTML}{ffa801} 538 | 539 | \definecolor{Purple}{HTML}{3c40c6} 540 | % secondary+ Colours 541 | \definecolor{Cyan}{HTML}{00d8d6} 542 | \definecolor{LightCyan}{HTML}{34e7e4} 543 | } 544 | 545 | \newpalette{tr}{ 546 | % Shades 547 | \definecolor{Grey}{HTML}{4b4b4b} 548 | \definecolor{DarkGrey}{HTML}{3d3d3d} 549 | % Primary Colours 550 | \definecolor{Red}{HTML}{ff3838} 551 | \definecolor{LightRed}{HTML}{ff4d4d} 552 | 553 | \definecolor{Yellow}{HTML}{fff200} 554 | \definecolor{LightYellow}{HTML}{fffa65} 555 | 556 | \definecolor{Blue}{HTML}{17c0eb} 557 | \definecolor{LightBlue}{HTML}{18dcff} 558 | % tertiary Colours 559 | \definecolor{Green}{HTML}{3ae374} 560 | \definecolor{LightGreen}{HTML}{32ff7e} 561 | 562 | \definecolor{Orange}{HTML}{ff9f1a} 563 | \definecolor{LightOrange}{HTML}{ffaf40} 564 | 565 | \definecolor{Purple}{HTML}{c56cf0} 566 | \definecolor{LightPurple}{HTML}{cd84f1} 567 | \definecolor{DarkPurple}{HTML}{7d5fff} 568 | % secondary+ Colours 569 | \definecolor{Cyan}{HTML}{67e6dc} 570 | \definecolor{LightCyan}{HTML}{7efff5} 571 | } 572 | 573 | % End FUI paletes 574 | 575 | \newpalette{sol}{ 576 | % Shades 577 | \definecolor{White}{HTML}{fdf6e3} 578 | \definecolor{Cream}{HTML}{eee8d5} 579 | \definecolor{LightGrey}{HTML}{93a1a1} 580 | \definecolor{Grey}{HTML}{586e75} 581 | \definecolor{DarkGrey}{HTML}{073642} 582 | \definecolor{Black}{HTML}{002b36} 583 | % Primary Colours 584 | \definecolor{Red}{HTML}{dc322f} 585 | \definecolor{Yellow}{HTML}{b58900} 586 | \definecolor{Blue}{HTML}{268bd2} 587 | % tertiary Colours 588 | \definecolor{Green}{HTML}{859900} 589 | \definecolor{Orange}{HTML}{cb4b16} 590 | \definecolor{Purple}{HTML}{6c71c4} 591 | % secondary+ Colours 592 | \definecolor{Cyan}{HTML}{2aa198} 593 | } 594 | 595 | \newpalette{mon}{ 596 | % Primary Colours 597 | \definecolor{Red}{HTML}{FA6287} 598 | \definecolor{Yellow}{HTML}{FDD76C} 599 | \definecolor{Blue}{HTML}{7EDBE7} 600 | % tertiary Colours 601 | \definecolor{Green}{HTML}{AADB79} 602 | \definecolor{Orange}{HTML}{F89769} 603 | \definecolor{Purple}{HTML}{A99CF0} 604 | % secondary+ Colours 605 | } 606 | 607 | \usepalette{\bmc@palette} 608 | 609 | % set link colour 610 | \AtEndPreamble{ 611 | \ifbool{bmc@dark}{ 612 | \@ifundefined{\string\color@href}{\colorlet{href}{secondary}}{} 613 | \@ifundefined{\string\color@inlinemath}{\colorlet{inlinemath}{tertiary!50!text}}{} 614 | }{ 615 | \@ifundefined{\string\color@href}{\colorlet{href}{tertiary}}{} 616 | \@ifundefined{\string\color@inlinemath}{\colorlet{inlinemath}{secondary!50!text}}{} 617 | } 618 | } 619 | -------------------------------------------------------------------------------- /bmc-fonts.sty: -------------------------------------------------------------------------------- 1 | %══════════════════════════════════════════% 2 | % % 3 | % BMC % 4 | % A Bespoke, Multipurpose Class % 5 | % -- Fonts Functionality -- % 6 | % -~=~- % 7 | % Authored by tecosaur % 8 | % % 9 | %══════════════════════════════════════════% 10 | 11 | \NeedsTeXFormat{LaTeX2e} 12 | \ProvidesPackage{bmc-fonts}[2019/06/09 Fonts functionality used in the BMC class] 13 | 14 | \ifdefined\@bmc\else 15 | \RequirePackage{etoolbox} 16 | \RequirePackage{kvoptions} 17 | \SetupKeyvalOptions{family=bmc, prefix=bmc@} 18 | 19 | \DeclareBoolOption{serif} 20 | \DeclareBoolOption{sans} 21 | \DeclareBoolOption{mono} 22 | \DeclareStringOption[serif]{body} % serif, sans, or mono 23 | \DeclareBoolOption{noto} 24 | 25 | \DeclareStringOption{math}[serif] % serif, sans, or mono 26 | 27 | \DeclareBoolOption{headingsSerif} 28 | \DeclareBoolOption{headingsSans} 29 | \DeclareBoolOption{headingsMono} 30 | \DeclareStringOption[sans]{headings} % serif, sans, or mono 31 | 32 | % process values 33 | 34 | \ifbool{bmc@serif}{ 35 | \renewcommand{\bmc@body}{serif} 36 | }{} 37 | \ifbool{bmc@sans}{ 38 | \renewcommand{\bmc@body}{sans} 39 | }{} 40 | \ifbool{bmc@mono}{ 41 | \renewcommand{\bmc@body}{mono} 42 | }{} 43 | 44 | \ifbool{bmc@headingsSerif}{ 45 | \renewcommand{\bmc@headings}{serif} 46 | }{} 47 | \ifbool{bmc@headingsSans}{ 48 | \renewcommand{\bmc@headings}{sans} 49 | }{} 50 | \ifbool{bmc@headingsMono}{ 51 | \renewcommand{\bmc@headings}{mono} 52 | }{} 53 | 54 | \newcommand{\ifdefstringx}[2]{% 55 | \begingroup 56 | \edef\x{#1}% 57 | \ifdefstring{\x}{#2}{\endgroup\@firstoftwo}{\endgroup\@secondoftwo}% 58 | } 59 | \fi 60 | 61 | % ================ 62 | % Setup Font 63 | % ================ 64 | 65 | \RequirePackage[T1]{fontenc} 66 | \RequirePackage[utf8]{inputenc} 67 | 68 | \RequirePackage[activate={true,nocompatibility},final,kerning=true,spacing=true,factor=2000]{microtype} % ,factor=1100,stretch=15,shrink=15 69 | \microtypecontext{spacing=nonfrench} 70 | \RequirePackage{setspace} 71 | 72 | % Load fonts 73 | \ifdefempty{\bmc@math}{}{ 74 | \DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n} 75 | % \ifdefstringx{\bmc@math}{sans}{ 76 | % \PassOptionsToPackage{sansmath}{libertinust1math} 77 | % }{} 78 | % \RequirePackage{libertinust1math} 79 | \let\circledS\undefined % here - PS 80 | } 81 | 82 | 83 | 84 | \ifbool{bmc@noto}{ 85 | \RequirePackage{noto} 86 | }{ 87 | \RequirePackage{plex-serif} 88 | \RequirePackage{plex-sans} 89 | \RequirePackage{plex-mono} 90 | } 91 | 92 | % semibold is nicer as standard bold 93 | \def\bfseries@rm{sb} 94 | \def\bfseries@sf{sb} 95 | \def\bfseries@tt{sb} 96 | 97 | \RequirePackage{fontawesome5} 98 | 99 | \newcommand*{\ditto}{\enspace\ensuremath{\prime\prime}\enspace} 100 | 101 | % Math Font & Setup 102 | % ================= 103 | 104 | % \setlength{\mathLetterPadding}{1mm} 105 | 106 | % 1mu padding 107 | 108 | \ifbool{bmc@noto}{}{ 109 | 110 | \ifdefstringx{\bmc@math}{serif}{ 111 | \renewcommand{\familydefault}{\rmdefault} 112 | \RequirePackage[basic,italic,symbolgreek]{mathastext} 113 | 114 | % 115 | % \@for\@tempa:=a,b,c,d,e,h,i,k,l,m,n,o,q,r,t,u,v,w\do{ 116 | % \MTsetmathskips{\@tempa}{0.5mu}{0.5mu}} 117 | % 118 | 119 | 120 | \MTsetmathskips{a}{-0.20mu}{1.50mu} 121 | \MTsetmathskips{b}{-0.50mu}{1.50mu} 122 | \MTsetmathskips{c}{-0.50mu}{1.70mu} 123 | \MTsetmathskips{d}{-0.30mu}{1.70mu} 124 | \MTsetmathskips{e}{-0.50mu}{1.70mu} 125 | \MTsetmathskips{f}{2.40mu}{1.70mu} 126 | \MTsetmathskips{g}{0.50mu}{1.60mu} 127 | \MTsetmathskips{h}{-0.50mu}{1.00mu} 128 | \MTsetmathskips{i}{-0.50mu}{1.80mu} 129 | \MTsetmathskips{j}{2.20mu}{1.80mu} 130 | \MTsetmathskips{k}{-0.50mu}{1.50mu} 131 | \MTsetmathskips{l}{-0.80mu}{1.80mu} 132 | \MTsetmathskips{m}{-0.40mu}{1.00mu} 133 | \MTsetmathskips{n}{-0.40mu}{1.00mu} 134 | \MTsetmathskips{o}{-0.20mu}{1.30mu} 135 | \MTsetmathskips{p}{0.20mu}{1.50mu} 136 | \MTsetmathskips{q}{-0.20mu}{1.30mu} 137 | \MTsetmathskips{r}{-0.80mu}{1.80mu} 138 | \MTsetmathskips{s}{0.10mu}{1.50mu} 139 | \MTsetmathskips{t}{-1.00mu}{1.50mu} 140 | \MTsetmathskips{u}{-1.10mu}{1.30mu} 141 | \MTsetmathskips{v}{-1.10mu}{1.80mu} 142 | \MTsetmathskips{w}{-1.00mu}{1.80mu} 143 | \MTsetmathskips{x}{0.50mu}{1.70mu} 144 | \MTsetmathskips{y}{1.20mu}{1.80mu} 145 | \MTsetmathskips{z}{0.40mu}{1.30mu} 146 | 147 | \MTsetmathskips{A}{1.40mu}{1.40mu} 148 | \MTsetmathskips{B}{0.60mu}{1.70mu} 149 | \MTsetmathskips{C}{-0.80mu}{1.50mu} 150 | \MTsetmathskips{D}{0.50mu}{1.70mu} 151 | \MTsetmathskips{E}{0.60mu}{1.60mu} 152 | \MTsetmathskips{F}{0.60mu}{1.60mu} 153 | \MTsetmathskips{G}{-1.00mu}{1.60mu} 154 | \MTsetmathskips{H}{0.60mu}{1.70mu} 155 | \MTsetmathskips{I}{0.60mu}{1.70mu} 156 | \MTsetmathskips{J}{1.80mu}{1.70mu} 157 | \MTsetmathskips{K}{0.50mu}{1.70mu} 158 | \MTsetmathskips{L}{0.50mu}{1.60mu} 159 | \MTsetmathskips{M}{0.60mu}{1.70mu} 160 | \MTsetmathskips{N}{0.60mu}{1.70mu} 161 | \MTsetmathskips{O}{-1.00mu}{1.70mu} 162 | \MTsetmathskips{P}{0.30mu}{1.70mu} 163 | \MTsetmathskips{Q}{-0.90mu}{1.70mu} 164 | \MTsetmathskips{R}{0.20mu}{1.70mu} 165 | \MTsetmathskips{S}{-0.20mu}{1.70mu} 166 | \MTsetmathskips{T}{-1.30mu}{1.70mu} 167 | \MTsetmathskips{U}{-1.80mu}{1.70mu} 168 | \MTsetmathskips{V}{-1.30mu}{1.70mu} 169 | \MTsetmathskips{W}{-1.30mu}{1.70mu} 170 | \MTsetmathskips{X}{1.00mu}{1.70mu} 171 | \MTsetmathskips{Y}{-1.00mu}{1.70mu} 172 | \MTsetmathskips{Z}{1.00mu}{1.70mu} 173 | }{} 174 | \ifdefstringx{\bmc@math}{sans}{ 175 | \renewcommand{\familydefault}{\sfdefault} 176 | \RequirePackage[basic,italic,symbolgreek]{mathastext} 177 | 178 | % 179 | % \@for\@tempa:=a,b,c,d,e,h,i,k,l,m,n,o,q,r,s,t,u,v,w,x\do{ 180 | % \MTsetmathskips{\@tempa}{0.5mu}{0.5mu}} 181 | % 182 | 183 | \MTsetmathskips{a}{0.00mu}{0.00mu} 184 | \MTsetmathskips{b}{0.30mu}{0.00mu} 185 | \MTsetmathskips{c}{0.00mu}{0.80mu} 186 | \MTsetmathskips{d}{0.00mu}{1.00mu} 187 | \MTsetmathskips{e}{0.00mu}{0.60mu} 188 | \MTsetmathskips{f}{2.60mu}{1.00mu} 189 | \MTsetmathskips{g}{1.30mu}{1.00mu} 190 | \MTsetmathskips{h}{0.40mu}{-0.10mu} 191 | \MTsetmathskips{i}{0.00mu}{1.00mu} 192 | \MTsetmathskips{j}{2.90mu}{1.00mu} 193 | \MTsetmathskips{k}{0.30mu}{0.90mu} 194 | \MTsetmathskips{l}{0.00mu}{1.00mu} 195 | \MTsetmathskips{m}{0.30mu}{-0.10mu} 196 | \MTsetmathskips{n}{0.30mu}{-0.10mu} 197 | \MTsetmathskips{o}{0.20mu}{0.10mu} 198 | \MTsetmathskips{p}{1.20mu}{0.00mu} 199 | \MTsetmathskips{q}{0.00mu}{0.30mu} 200 | \MTsetmathskips{r}{0.30mu}{1.00mu} 201 | \MTsetmathskips{s}{0.80mu}{0.30mu} 202 | \MTsetmathskips{t}{-0.20mu}{1.00mu} 203 | \MTsetmathskips{u}{-0.20mu}{0.30mu} 204 | \MTsetmathskips{v}{-0.30mu}{1.00mu} 205 | \MTsetmathskips{w}{-0.50mu}{1.00mu} 206 | \MTsetmathskips{x}{1.70mu}{1.00mu} 207 | \MTsetmathskips{y}{1.50mu}{1.00mu} 208 | }{} 209 | \ifdefstringx{\bmc@math}{mon}{ 210 | \renewcommand{\familydefault}{\ttdefault} 211 | \RequirePackage[basic,italic,symbolgreek]{mathastext} 212 | }{} 213 | 214 | } 215 | 216 | % Text Font 217 | % ========= 218 | 219 | \linespread{1.15} 220 | \@beginparpenalty=10000 % don't like it when a paragraph title is on a different page to the start of the content 221 | \hyphenpenalty=500 % not a huge fan of hyphens, but they are worthwhile 222 | % See Bringhurst (2004) ¶ 2.4.1 223 | \lefthyphenmin=2 224 | \righthyphenmin=3 225 | 226 | \ifdefstringx{\bmc@body}{serif}{ 227 | \renewcommand{\familydefault}{\rmdefault} 228 | }{} 229 | \ifdefstringx{\bmc@body}{sans}{ 230 | \renewcommand{\familydefault}{\sfdefault} 231 | }{} 232 | \ifdefstringx{\bmc@body}{mono}{ 233 | \renewcommand{\familydefault}{\ttdefault} 234 | }{} 235 | 236 | % Section font 237 | % ============ 238 | 239 | \ifdefstringx{\bmc@headings}{serif}{ 240 | \newcommand{\headingsFont}{\rmdefault} 241 | \newcommand{\titleFont}{\rmdefault} 242 | }{} 243 | \ifdefstringx{\bmc@headings}{sans}{ 244 | \newcommand{\headingsFont}{\sfdefault} 245 | \newcommand{\titleFont}{\sfdefault} 246 | }{} 247 | \ifdefstringx{\bmc@headings}{mono}{ 248 | \newcommand{\headingsFont}{\ttdefault} 249 | \newcommand{\titleFont}{\ttdefault} 250 | }{} 251 | 252 | % Small Caps - source: https://tex.stackexchange.com/a/225078/167605 253 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 254 | 255 | % have \textsc use \fauxsc if \scshape not avalible 256 | \let\textsc\relax 257 | \DeclareRobustCommand{\textsc}[1]{% 258 | \ifcsname \f@encoding/\f@family/\f@series/sc\endcsname 259 | {\scshape #1}% 260 | \else 261 | \fauxsc{#1}% 262 | \fi 263 | } 264 | 265 | \newlength\fake@f 266 | \newlength\fake@c 267 | \def\fakesc#1{% 268 | \begingroup% 269 | \xdef\fake@name{\csname\curr@fontshape/\f@size\endcsname}% 270 | \fontsize{\fontdimen8\fake@name}{\baselineskip}\selectfont% 271 | \uppercase{#1}% 272 | \endgroup% 273 | } 274 | 275 | 276 | \newcommand\fauxsc[1]{\protect\fauxschelper#1 \relax\relax} 277 | \def\fauxschelper#1 #2\relax{% 278 | \fauxschelphelp#1\relax\relax 279 | \if\relax#2\relax\else\ \fauxschelper#2\relax\fi 280 | } 281 | \def\Hscale{.83}\def\Vscale{.72}\def\Cscale{1.00} 282 | \def\fauxschelphelp#1#2\relax{% 283 | \ifnum`#1>``\ifnum`#1<`\{\scalebox{\Hscale}[\Vscale]{\fauxfontheavier\uppercase{#1}}\else 284 | \scalebox{\Cscale}[1]{#1}\fi\else\scalebox{\Cscale}[1]{#1}\fi 285 | \ifx\relax#2\relax\else\fauxschelphelp#2\relax\fi} 286 | 287 | \newcommand\fauxfontheavier{% 288 | \sbox0{x\xdef\testF{\the\font}}% 289 | \sbox0{\fontseries{sb}\selectfont x\xdef\testFsb{\the\font}}% 290 | \sbox0{\fontseries{mb}\selectfont x\xdef\testFmb{\the\font}}% 291 | \sbox0{\fontseries{tx}\selectfont x\xdef\testFtx{\the\font}}% 292 | \sbox0{\fontseries{m}\selectfont x\xdef\testFm{\the\font}}% 293 | \ifx\testF\testFsb\fontseries{b}\selectfont\fi 294 | \ifx\testF\testFmb\fontseries{sb}\selectfont\fi 295 | \ifx\testF\testFtx\fontseries{mb}\selectfont\fi 296 | \ifx\testF\testFm\fontseries{tx}\selectfont\fi 297 | } 298 | 299 | % Slant Box 300 | \newsavebox\theslantbox 301 | \newcommand{\fauxsl}[2][.2]{\mbox{% 302 | \sbox{\theslantbox}{#2}% 303 | \hskip\wd\theslantbox 304 | \pdfsave 305 | \pdfsetmatrix{1 0 #1 1}% 306 | \llap{\usebox{\theslantbox}}% 307 | \pdfrestore 308 | }} 309 | 310 | % Add colour to inline math 311 | \renewrobustcmd{\(}{\@ifstar\@inlinemath\@@inlinemath} 312 | \DeclareRobustCommand{\@inlinemath}{\relax\ifmmode\@badmath\else$\fi} 313 | \DeclareRobustCommand{\@@inlinemath}{\relax\ifmmode\@badmath\else$\fi\color{inlinemath}} 314 | 315 | % Roman Numerals 316 | \AtEndPreamble{ 317 | \providecommand*{\RN}[1]{\expandafter\@slowromancap\romannumeral #1@} 318 | \providecommand*{\Rn}[1]{\romannumeral#1\relax} 319 | } 320 | -------------------------------------------------------------------------------- /bmc-maths.sty: -------------------------------------------------------------------------------- 1 | %══════════════════════════════════════════% 2 | % % 3 | % BMC % 4 | % A Bespoke, Multipurpose Class % 5 | % -- Maths Functionality -- % 6 | % -~=~- % 7 | % Authored by tecosaur % 8 | % % 9 | %══════════════════════════════════════════% 10 | 11 | \NeedsTeXFormat{LaTeX2e} 12 | \ProvidesPackage{bmc-maths}[2019/06/09 Maths functionality used in the BMC class] 13 | 14 | \newif\ifbmc@nomathsfont 15 | \newif\ifbmc@plainmathsdd 16 | \bmc@nomathsfontfalse 17 | \bmc@plainmathsddfalse 18 | \DeclareOption{nofont}{\bmc@nomathsfonttrue} 19 | \DeclareOption{plaindd}{\bmc@plainmathsddtrue} 20 | \ProcessOptions\relax 21 | 22 | % various math packages 23 | \RequirePackage{amsmath,amssymb} 24 | \ifbmc@nomathsfont\else 25 | \RequirePackage[varbb]{newpxmath} 26 | \fi 27 | \RequirePackage{xfrac} 28 | \RequirePackage[makeroom]{cancel} 29 | \RequirePackage{mathtools} 30 | 31 | % deliminators 32 | \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} 33 | \DeclarePairedDelimiter{\norm}{\lVert}{\rVert} 34 | 35 | \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} 36 | \DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor} 37 | \DeclarePairedDelimiter{\round}{\lfloor}{\rceil} 38 | % number sets 39 | \newcommand{\RR}[1][]{\ensuremath{\ifstrempty{#1}{\mathbb{R}}{\mathbb{R}^{#1}}}} 40 | \newcommand{\NN}[1][]{\ensuremath{\ifstrempty{#1}{\mathbb{N}}{\mathbb{N}^{#1}}}} 41 | \newcommand{\ZZ}[1][]{\ensuremath{\ifstrempty{#1}{\mathbb{Z}}{\mathbb{Z}^{#1}}}} 42 | \newcommand{\QQ}[1][]{\ensuremath{\ifstrempty{#1}{\mathbb{Q}}{\mathbb{Q}^{#1}}}} 43 | \newcommand{\CC}[1][]{\ensuremath{\ifstrempty{#1}{\mathbb{C}}{\mathbb{C}^{#1}}}} 44 | \newcommand{\PP}[1][]{\ensuremath{\ifstrempty{#1}{\mathbb{P}}{\mathbb{P}^{#1}}}} 45 | \newcommand{\HH}[1][]{\ensuremath{\ifstrempty{#1}{\mathbb{H}}{\mathbb{H}^{#1}}}} 46 | % expected value 47 | \newcommand{\EE}{\ensuremath{\mathbb{E}}} 48 | 49 | % commonly used macros 50 | % - differentials 51 | \ifbmc@plainmathsdd 52 | \newcommand{\dd}[1][]{\ensuremath{\,\mathsl{d}^{#1}}} 53 | \else 54 | \newsavebox\diffdbox 55 | \newcommand{\slantedromand}{{\mathpalette\makesl{d}}} 56 | \newcommand{\makesl}[2]{% 57 | \begingroup 58 | \sbox{\diffdbox}{$\mathsurround=0pt#1\mathrm{#2}$}% 59 | \pdfsave 60 | \pdfsetmatrix{1 0 0.2 1}% 61 | \rlap{\usebox{\diffdbox}}% 62 | \pdfrestore 63 | \hskip\wd\diffdbox 64 | \endgroup 65 | } 66 | \newcommand{\dd}[1][]{\ensuremath{\mathop{}\!\ifstrempty{#1}{% 67 | \slantedromand\@ifnextchar^{\hspace{0.2ex}}{\hspace{0.1ex}}}% 68 | {\slantedromand\hspace{0.2ex}^{#1}}}} 69 | \fi 70 | \ProvideDocumentCommand\dv{o m g}{% 71 | \ensuremath{% 72 | \IfValueTF{#3}{% 73 | \IfNoValueTF{#1}{% 74 | \frac{\dd #2}{\dd #3}% 75 | }{% 76 | \frac{\dd^{#1} #2}{\dd #3^{#1}}% 77 | }% 78 | }{% 79 | \IfNoValueTF{#1}{% 80 | \frac{\dd}{\dd #2}% 81 | }{% 82 | \frac{\dd^{#1}}{\dd #2^{#1}}% 83 | }% 84 | }% 85 | }% 86 | } 87 | \providecommand*{\pdv}[3][]{\frac{\partial^{#1}#2}{\partial#3^{#1}}} 88 | % - others 89 | \DeclareMathOperator{\Lap}{\mathcal{L}} 90 | \DeclareMathOperator{\Var}{Var} % varience 91 | \DeclareMathOperator{\Cov}{Cov} % covarience 92 | \DeclareMathOperator{\E}{E} % expected 93 | 94 | % Since the amsthm package isn't loaded 95 | \newcommand*{\qed}{\hfill\ensuremath{\blacksquare}} 96 | \newcommand*{\qedhere}{\hfill\ensuremath{\square}} 97 | 98 | % I prefer the slanted \leq 99 | \let\oldleq\leq % save them in case they're every wanted 100 | \let\oldgeq\geq 101 | \renewcommand{\leq}{\leqslant} 102 | \renewcommand{\geq}{\geqslant} 103 | 104 | % redefine matrix env to allow for alignment, use r as default 105 | \renewcommand*\env@matrix[1][r]{\hskip -\arraycolsep 106 | \let\@ifnextchar\new@ifnextchar 107 | \array{*\c@MaxMatrixCols #1}} 108 | -------------------------------------------------------------------------------- /bmc-ref.sty: -------------------------------------------------------------------------------- 1 | %══════════════════════════════════════════% 2 | % % 3 | % BMC % 4 | % A Bespoke, Multipurpose Class % 5 | % -- Reference Functionality -- % 6 | % -~=~- % 7 | % Authored by tecosaur % 8 | % % 9 | %══════════════════════════════════════════% 10 | 11 | \ProvidesPackage{bmc-ref}[2019/07/27 Load and configure hyperref, hyperxmp, and cleveref] 12 | \NeedsTeXFormat{LaTeX2e} 13 | 14 | \ifdefined\@bmc\else 15 | \RequirePackage{etoolbox} 16 | \fi 17 | 18 | \renewcommand{\@title}{} 19 | \renewcommand{\@author}{} 20 | 21 | \pdfstringdefDisableCommands{% 22 | % misc 23 | \def\acr#1{#1}% 24 | \def\kern #1{}% 25 | % font stuff 26 | \def\fontseries#1{}% 27 | \def\selectfont{}% 28 | \def\Huge{}% 29 | \def\huge{}% 30 | \def\LARGE{}% 31 | \def\Large{}% 32 | \def\large{}% 33 | \def\normalsize{}% 34 | \def\small{}% 35 | \def\footnotesize{}% 36 | \def\scriptsize{}% 37 | \def\tiny{}% 38 | % space 39 | \def\hspace#1{}% 40 | \def\hphantom#1{}% 41 | \def\sbox0#1{}% 42 | \def\newline{}% 43 | \def\\{}% 44 | % MATHS 45 | \def\({}% 46 | \def\){}% 47 | \def\qopname#1#2#3{#3}% 48 | % brackets 49 | \def\left{}% 50 | \def\right{}% 51 | \def\vert{|}% 52 | \def\lvert{|}% 53 | \def\rvert{|}% 54 | \def\|{∥}% 55 | \def\Vert{∥}% 56 | \def\lVert{∥}% 57 | \def\rVert{∥}% 58 | \def\lfloor{⌊}% 59 | \def\rfloor{⌋}% 60 | \def\lceil{⌈}% 61 | \def\rceil{⌉}% 62 | \def\backslash{\textbackslash}% 63 | % constructs 64 | \def\frac#1#2{#1/#2}% 65 | \def\sqrt#1{√#1}% 66 | \def\overline#1{#1}% 67 | \def\underline#1{#1}% 68 | \def\widehat#1{#1}% 69 | \def\widetilde#1{#1}% 70 | \def\overrightarrow#1{#1}% 71 | \def\overleftarrow#1{#1}% 72 | \def\binom#1#2{#1𝑪#2}% 73 | % variable size symbols 74 | \def\coprod{∐}% 75 | \def\biguplus{⨄}% 76 | \def\bigcup{⋃}% 77 | \def\bigoplus{⨁}% 78 | \def\bigotimes{⨂}% 79 | \def\bigodot{⨀}% 80 | \def\bigvee{⋁}% 81 | \def\bigwedge{⋀}% 82 | \def\bigsqcup{⨆}% 83 | % accents 84 | \def\dot#1{\.#1}% 85 | \def\ddot#1{\"#1}% 86 | \def\tilde#1{\~#1}% 87 | \def\acute#1{\'#1}% 88 | \def\grave#1{\`#1}% 89 | \def\hat#1{\^#1}% 90 | \def\check#1{\v#1}% 91 | \def\breve#1{\u#1}% 92 | \def\bar#1{\=#1}% 93 | \def\vec#1{#1}% 94 | % ams extra greek characters 95 | \def\varepsilon{ε}% 96 | \def\vartheta{ϑ}% 97 | \def\varpi{ϖ}% 98 | \def\varsigma{ς}% 99 | \def\varphi{φ}% 100 | \def\varGamma{Γ}% 101 | \def\varDelta{∆}% 102 | \def\varTheta{Θ}% 103 | \def\varLambda{Λ}% 104 | \def\varXi{Ξ}% 105 | \def\varPi{Π}% 106 | \def\varSigma{Σ}% 107 | \def\varUpsilon{Υ}% 108 | \def\varPhi{Φ}% 109 | \def\varPsi{Ψ}% 110 | \def\varOmega{Ω}% 111 | } 112 | 113 | % \RequirePackage{hyperxmp} 114 | 115 | \AtEndPreamble{ 116 | \hypersetup{ 117 | % pdftitle={\@title}, 118 | % pdfauthor={\@author}, 119 | % % pdfsubtitle={\@subtitle}, 120 | % % pdfsubject={\@subtitle}, 121 | % pdfcreator=pdfLaTeX, 122 | % pdfproducer={\@author}, 123 | % % pdfkeywords={{a}{b}}, 124 | % pdfapart=3, 125 | % pdfaconformance=U, 126 | linktoc=all, 127 | colorlinks=true, 128 | linkcolor=href, 129 | anchorcolor=href, 130 | citecolor=href, 131 | menucolor=primary, 132 | runcolor=href, 133 | urlcolor=href, 134 | filecolor=href, 135 | breaklinks=true 136 | } 137 | } 138 | \urlstyle{same} 139 | -------------------------------------------------------------------------------- /bmc-sectioning.sty: -------------------------------------------------------------------------------- 1 | %══════════════════════════════════════════% 2 | % % 3 | % BMC % 4 | % A Bespoke, Multipurpose Class % 5 | % -- Sectioning Functionality -- % 6 | % -~=~- % 7 | % Authored by tecosaur % 8 | % % 9 | %══════════════════════════════════════════% 10 | 11 | \ProvidesPackage{bmc-sectioning}[2019/06/09 Sectioning functionality used in the BMC class] 12 | \NeedsTeXFormat{LaTeX2e} 13 | 14 | \ifdefined\@bmc\else 15 | \RequirePackage{kvoptions} 16 | \SetupKeyvalOptions{family=bmc, prefix=bmc@} 17 | 18 | % General 19 | \DeclareBoolOption{solid} 20 | \DeclareBoolOption{stripe} 21 | 22 | \DeclareBoolOption{article} 23 | 24 | \DeclareBoolOption{paragraph} 25 | 26 | % color 27 | 28 | \DeclareBoolOption{dark} 29 | 30 | % other stuff 31 | 32 | \DeclareBoolOption{serif} 33 | \DeclareBoolOption{sans} 34 | \DeclareBoolOption{mono} 35 | \DeclareStringOption[serif]{body} % serif, sans, or mono 36 | 37 | \DeclareBoolOption{headingsSerif} 38 | \DeclareBoolOption{headingsSans} 39 | \DeclareBoolOption{headingsMono} 40 | \DeclareStringOption[sans]{headings} % serif, sans, or mono 41 | 42 | % process values 43 | 44 | \ifbool{bmc@serif}{ 45 | \renewcommand{\bmc@body}{serif} 46 | }{} 47 | \ifbool{bmc@sans}{ 48 | \renewcommand{\bmc@body}{sans} 49 | }{} 50 | \ifbool{bmc@mono}{ 51 | \renewcommand{\bmc@body}{mono} 52 | }{} 53 | 54 | \ifbool{bmc@headingsSerif}{ 55 | \renewcommand{\bmc@headings}{serif} 56 | }{} 57 | \ifbool{bmc@headingsSans}{ 58 | \renewcommand{\bmc@headings}{sans} 59 | }{} 60 | \ifbool{bmc@headingsMono}{ 61 | \renewcommand{\bmc@headings}{mono} 62 | }{} 63 | 64 | \newcommand{\ifdefstringx}[2]{% 65 | \begingroup 66 | \edef\x{#1}% 67 | \ifdefstring{\x}{#2}{\endgroup\@firstoftwo}{\endgroup\@secondoftwo}% 68 | } 69 | \fi 70 | 71 | % Titling 72 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 73 | 74 | \ifbool{bmc@article}{ 75 | }{ 76 | \addtokomafont{chapter}{% 77 | \fontfamily{\headingsFont}\fontsize{1.7cm}{1.4cm}\fontseries{tx}\selectfont% 78 | \ifbool{bmc@dark}{\color{primaryVariant}\colorlet{inlinemath}{primaryVariant}} 79 | {\color{alternativePrimary}\colorlet{inlinemath}{alternativePrimary}}% 80 | } 81 | 82 | \renewcommand\chapterformat{% 83 | \fontseries{m}\fontsize{6.5cm}{1ex}\selectfont% 84 | \ifbool{bmc@solid}{\color{page}}{\color{primary}}% 85 | \thechapter 86 | } 87 | 88 | 89 | \renewcommand{\chapterlinesformat}[3]{% 90 | % TODO: find way to combine \newgeometry and \thispagestyle 91 | % \newgeometry{right=2.7cm, marginparwidth=0cm, marginparsep=0mm} 92 | \thispagestyle{empty} 93 | \begin{tikzpicture}[remember picture, overlay] 94 | \titleBackground 95 | \node[anchor=east] at ([yshift=-7.5cm, xshift=8.7cm] current page.north west) {#2}; 96 | \node[anchor=north west,text width=\paperwidth-7cm-\leftmargin] at ([yshift=-4.8cm, xshift=7.7cm] current page.north west) {\raggedright #3}; 97 | \end{tikzpicture} 98 | } 99 | } 100 | 101 | 102 | \addtokomafont{section}{\color{primary}\colorlet{inlinemath}{primary}% 103 | \Huge\bfseries\fontfamily{\headingsFont}\selectfont} 104 | \addtokomafont{subsection}{\color{primary}\colorlet{inlinemath}{primary}% 105 | \huge\fontseries{sb}\fontfamily{\headingsFont}\selectfont} 106 | \addtokomafont{subsubsection}{\color{primary}\colorlet{inlinemath}{primary}% 107 | \LARGE\fontseries{sb}\fontfamily{\headingsFont}\selectfont} 108 | \addtokomafont{paragraph}{\color{primary!70!text}\colorlet{inlinemath}{primary!70!text}% 109 | \fontseries{mb}\fontfamily{\headingsFont}\selectfont} 110 | \addtokomafont{subparagraph}{\color{primary!70!text}\colorlet{inlinemath}{primary!70!text}% 111 | \fontseries{mb}\fontfamily{\headingsFont}\selectfont} 112 | 113 | \renewcommand{\sectionformat}{% 114 | \fontseries{sb}\selectfont\itshape\thesection\autodot\enskip 115 | } 116 | 117 | \renewcommand{\subsectionformat}{% 118 | \fontseries{sb}\selectfont\itshape\thesubsection\autodot\enskip 119 | } 120 | 121 | \renewcommand{\subsubsectionformat}{% 122 | \fontseries{sb}\selectfont\itshape\thesubsubsection\autodot\enskip 123 | } 124 | 125 | \ifbool{bmc@article}{ 126 | \renewcommand{\sectionlinesformat}[4]{ 127 | #4 \hfill #3 128 | \vspace*{-.5\baselineskip} 129 | \mbox{} 130 | \textcolor{primary}{\rule{\textwidth}{.4pt}}\par\nobreak 131 | } 132 | }{} 133 | 134 | \RedeclareSectionCommands[indent=0em]{section,subsection,subsubsection} 135 | 136 | % Make parahraphs and subparagraphs more like sections (unless disabled) 137 | \ifbool{bmc@paragraph}{}{ 138 | \ifx\paragraph\undefined\else 139 | \let\oldparagraph\paragraph 140 | \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} 141 | \fi 142 | \ifx\subparagraph\undefined\else 143 | \let\oldsubparagraph\subparagraph 144 | \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} 145 | \fi 146 | } 147 | 148 | 149 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 150 | % ToC and Mini-ToC 151 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 152 | \RequirePackage{titletoc} 153 | \RequirePackage{framed} 154 | \RequirePackage[absolute,overlay]{textpos} 155 | 156 | \newcommand{\fancytoc}{ 157 | \thispdfpagelabel{Contents} 158 | % \titleBackground 159 | {\hypersetup{linkcolor=text} 160 | \setcounter{tocdepth}{0} 161 | \begingroup 162 | \let\clearpage\relax 163 | \tableofcontents 164 | \endgroup 165 | } 166 | \begin{textblock*}{5cm}(1.6cm,6cm) % {block width} (coords) 167 | \fontsize{4cm}{2em}\selectfont 168 | \rotatebox[origin=c]{90}{\color{primaryVariant}Contents} 169 | \end{textblock*} 170 | \newpage 171 | } 172 | 173 | % ToC 174 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 175 | 176 | \ifbool{bmc@article}{ 177 | \renewcommand{\contentsname}{Contents} 178 | }{ 179 | \renewcommand{\contentsname}{} 180 | } 181 | % \pretocmd{\tableofcontents}{\hypertarget{contents}{}}{}{} 182 | 183 | \newenvironment{tocChapterText}{ 184 | \def\FrameCommand{ 185 | \ifbool{bmc@notes}{ 186 | \hspace*{\dimexpr13.3cm-1\leftmargin\relax} 187 | }{ 188 | \hspace*{\dimexpr9.7cm-1\leftmargin\relax} 189 | } 190 | } 191 | \MakeFramed{ 192 | % \parshape 1 0cm .75\textwidth \relax\FrameRestore 193 | \parshape 1 0cm 12.5cm \relax 194 | } 195 | }{\endMakeFramed} 196 | \titlecontents{chapter}[0em]{\vspace*{1\baselineskip}}{ 197 | \parbox{7.5cm-\leftmargin}{\hfill{\ifbool{bmc@solid}{\hypersetup{linkcolor=contrastColour}}{\hypersetup{linkcolor=primary}}\fontsize{1.5cm}{1ex}\selectfont\color{page}\thecontentspage}\hspace*{3mm}} 198 | \vspace*{-1.48cm}\fontfamily{\headingsFont}\selectfont\tocChapterText{\large Chapter~\thecontentslabel} 199 | \\[-3mm] 200 | \huge\fontfamily{\familydefault}\selectfont 201 | }{}{\endtocChapterText\vskip-5mm} 202 | 203 | % Mini-ToC 204 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 205 | 206 | \newcommand{\printMiniToc}{ 207 | \vspace*{12cm} 208 | \hspace*{\dimexpr-1\leftmargin+6.7cm\relax} 209 | \parbox[t]{\paperwidth-7cm-\leftmargin}{ 210 | \hspace*{-3mm}\raisebox{0.25mm}{\fontsize{0.6cm}{1ex}\selectfont\ifbool{bmc@solid}{\color{contrastColour}}{\color{primary}}\faList} 211 | \ifstrequal{\bmc@body}{serif}{\hspace*{5.5mm}}{\hspace*{6.5mm}} {\fontfamily{\headingsFont}\fontseries{tx}\selectfont\huge{Summary}} 212 | \vspace*{3mm} 213 | \startcontents[chapters] 214 | \hypersetup{linkcolor=text} 215 | \begin{spacing}{1.1} 216 | \printcontents[chapters]{p}{1}{\setcounter{tocdepth}{1}} 217 | \end{spacing} 218 | } 219 | } 220 | 221 | 222 | % Redefining toc style so that it dont get indented in partialTocs 223 | \titlecontents{psection}[3em] 224 | {} {\large{\ifbool{bmc@solid}{\color{contrastColour}}{\color{primary}}\bfseries\contentslabel{3.5em}}} {} {, \thecontentspage} 225 | 226 | \titlecontents{psubsection}[3em] 227 | {} {\large{\ifbool{bmc@solid}{\color{contrastColour}}{\color{primary}}\bfseries\contentslabel{3.5em}}} {} {, \thecontentspage} %\contentslabel{4.2em} to right-align 228 | 229 | \ifbool{bmc@solid}{ 230 | \newcommand{\titleBackground}{ 231 | \fill[fill=primary] (current page.south west) rectangle ++(7.5cm, \paperheight); 232 | } 233 | }{} 234 | 235 | \ifbool{bmc@stripe}{ 236 | \newcommand{\titleBackground}{ 237 | \fill[fill=primary] ([xshift=7.42cm]current page.south west) rectangle ++(1mm, \paperheight); 238 | } 239 | }{} 240 | 241 | \ifboolexpr{not bool {bmc@solid} and not bool {bmc@stripe}}{ 242 | \newcommand{\titleBackground}{} 243 | }{} 244 | 245 | %%%%%%%%%%%%%%%%%% 246 | 247 | % Automatically add to \chapter 248 | \xapptocmd{\scr@@startchapter}{\printMiniToc\vfill\newpage}{}{} 249 | 250 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 251 | % Header and Footer 252 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 253 | 254 | \ifdraft{ 255 | \AfterPackage*{scrlayer-scrpage}{% 256 | \DeclareNewLayer[ 257 | head, 258 | height=0pt, 259 | foreground, 260 | contents=\textcolor{text!60!page}{\layercontentsmeasure} 261 | ]{head.ruler} 262 | \DeclareNewLayer[ 263 | foot, 264 | height=0pt, 265 | addvoffset=\footheight-\dp\strutbox, 266 | background, 267 | contents=\textcolor{text!60!page}{\layercontentsmeasure} 268 | ]{foot.ruler} 269 | \AddLayersAtBeginOfPageStyle{scrheadings}{head.ruler,foot.ruler} 270 | \AddLayersAtBeginOfPageStyle{plain.scrheadings}{head.ruler,foot.ruler} 271 | } 272 | }{ 273 | 274 | \clearpairofpagestyles 275 | \cfoot*{\hyperlink{contents}{\pagemark}} 276 | 277 | \ifbool{bmc@article}{ 278 | \chead{\hypersetup{allcolors=.}\hyperlink{section.\arabic{section}}{\headmark}} 279 | }{ 280 | \chead{\hypersetup{allcolors=.}\hyperlink{chapter.\arabic{chapter}}{\headmark}} 281 | } 282 | 283 | \addtokomafont{pagehead}{\fontfamily{\headingsFont}\selectfont\bfseries\upshape% 284 | \ifbool{bmc@solid}{\color{contrastColour}\colorlet{inlinemath}{contrastColour}}{\color{primary}\colorlet{inlinemath}{primary}}} 285 | \addtokomafont{pagenumber}{\fontfamily{\headingsFont}\fontseries{sb}\selectfont\color{primary}} 286 | 287 | % shift the predefined head layers 288 | \ifbool{bmc@print}{ 289 | \ForEachLayerOfPageStyle*{scrheadings}{% 290 | \Ifstrstart{#1}{scrheadings.head.} 291 | {\ModifyLayer[addvoffset=-.45in-.5\voffset-.5\topmargin]{#1}} 292 | {}% 293 | } 294 | \ForEachLayerOfPageStyle*{plain.scrheadings}{% 295 | \Ifstrstart{#1}{plain.scrheadings.head.} 296 | {\ModifyLayer[addvoffset=-.45in-.5\voffset-.5\topmargin]{#1}} 297 | {}% 298 | } 299 | }{ 300 | \ForEachLayerOfPageStyle*{scrheadings}{% 301 | \Ifstrstart{#1}{scrheadings.head.} 302 | {\ModifyLayer[addvoffset=-.5in-.5\voffset-.5\topmargin]{#1}} 303 | {}% 304 | } 305 | \ForEachLayerOfPageStyle*{plain.scrheadings}{% 306 | \Ifstrstart{#1}{plain.scrheadings.head.} 307 | {\ModifyLayer[addvoffset=-.5in-.5\voffset-.5\topmargin]{#1}} 308 | {}% 309 | } 310 | } 311 | 312 | % Defining the Layer 313 | \DeclareLayer[ 314 | background, 315 | topmargin, 316 | addheight=\headheight, 317 | contents={% 318 | \ifbool{bmc@solid}{\color{primary}}{\color{page}} 319 | \rule{\layerwidth}{\layerheight}% 320 | }% 321 | ]{my.head.background} 322 | 323 | %Adding the Layer to the pagestyles 324 | \AddLayersAtBeginOfPageStyle{scrheadings}{my.head.background} 325 | \AddLayersAtBeginOfPageStyle{plain.scrheadings}{my.head.background} 326 | 327 | } 328 | -------------------------------------------------------------------------------- /bmc.cls: -------------------------------------------------------------------------------- 1 | %══════════════════════════════════════════% 2 | % % 3 | % BMC % 4 | % A Bespoke, Multipurpose Class % 5 | % -~=~- % 6 | % Authored by tecosaur % 7 | % Insired by Yves Zumbach % 8 | % % 9 | %══════════════════════════════════════════% 10 | 11 | 12 | %% bmc.cls 13 | %% Copyright 2019 tecosaur (https://github.com/tecosaur) 14 | % 15 | % This work may be distributed and/or modified under the 16 | % conditions of the LaTeX Project Public License, either version 1.3 17 | % of this license or (at your option) any later version. 18 | % The latest version of this license is in 19 | % http://www.latex-project.org/lppl.txt 20 | % and version 1.3 or later is part of all distributions of LaTeX 21 | % version 2005/12/01 or later. 22 | % 23 | % This work has the LPPL maintenance status `maintained'. 24 | % 25 | % The Current Maintainer of this work is tecosaur 26 | % 27 | % This work consists of the files bmc.cls, accompanying bmc-*.sty files, 28 | % and modifications made to infoBulle.sty and marginInfoBulle.sty 29 | 30 | 31 | \ProvidesClass{bmc}[1/1/2019 Bespoke Multipurpose Class] 32 | \NeedsTeXFormat{LaTeX2e} 33 | 34 | \newcommand*{\@bmc}{true} 35 | 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | % Options 38 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 39 | \RequirePackage{etoolbox} 40 | \RequirePackage{kvoptions} 41 | 42 | \SetupKeyvalOptions{family=bmc, prefix=bmc@} 43 | 44 | % General 45 | \DeclareBoolOption{solid} 46 | \DeclareBoolOption{stripe} 47 | 48 | \DeclareBoolOption{article} 49 | 50 | \DeclareBoolOption{paragraph} 51 | 52 | \DeclareBoolOption{landscape} 53 | \DeclareBoolOption{print} 54 | 55 | % extras 56 | \DeclareBoolOption{notes} 57 | \DeclareBoolOption{chem} 58 | \DeclareBoolOption{code} 59 | \DeclareBoolOption{plot} 60 | \DeclareBoolOption{gloss} 61 | \DeclareBoolOption{externalise} 62 | 63 | % text font 64 | \DeclareBoolOption{serif} 65 | \DeclareBoolOption{sans} 66 | \DeclareBoolOption{mono} 67 | \DeclareStringOption[serif]{body} % serif, sans, or mono 68 | \DeclareBoolOption{noto} 69 | 70 | \DeclareStringOption{math}[serif] % serif, sans, or mono 71 | \DeclareStringOption{maths}[serif] % alias 72 | 73 | \DeclareBoolOption{headingsSerif} 74 | \DeclareBoolOption{headingsSans} 75 | \DeclareBoolOption{headingsMono} 76 | \DeclareStringOption[sans]{headings} % serif, sans, or mono 77 | 78 | % colour options 79 | \DeclareBoolOption[true]{light} 80 | \DeclareBoolOption{dark} 81 | \DeclareStringOption[de]{palette} 82 | 83 | \DeclareDefaultOption{ 84 | \ifbool{bmc@article}{ 85 | \PassOptionsToClass{\CurrentOption}{scrartcl} 86 | }{ 87 | \PassOptionsToClass{\CurrentOption}{scrreprt} 88 | } 89 | } 90 | 91 | \ProcessKeyvalOptions* 92 | 93 | % process values 94 | 95 | \newcommand{\ifdefstringx}[2]{% 96 | \begingroup 97 | \edef\x{#1}% 98 | \ifdefstring{\x}{#2}{\endgroup\@firstoftwo}{\endgroup\@secondoftwo}% 99 | } 100 | 101 | \ifdefempty{\bmc@maths}{}{ 102 | \def\bmc@math{\bmc@maths} 103 | } 104 | 105 | \ifbool{bmc@serif}{ 106 | \renewcommand{\bmc@body}{serif} 107 | }{} 108 | \ifbool{bmc@sans}{ 109 | \renewcommand{\bmc@body}{sans} 110 | }{} 111 | \ifbool{bmc@mono}{ 112 | \renewcommand{\bmc@body}{mono} 113 | }{} 114 | 115 | \ifbool{bmc@headingsSerif}{ 116 | \renewcommand{\bmc@headings}{serif} 117 | }{} 118 | \ifbool{bmc@headingsSans}{ 119 | \renewcommand{\bmc@headings}{sans} 120 | }{} 121 | \ifbool{bmc@headingsMono}{ 122 | \renewcommand{\bmc@headings}{mono} 123 | }{} 124 | 125 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 126 | % Basic settings, options processing 127 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 128 | 129 | \ifbool{bmc@article}{ 130 | \LoadClass[numbers=noenddot]{scrartcl} 131 | }{ 132 | \LoadClass[numbers=noenddot]{scrreprt} 133 | } 134 | 135 | % % Ignore Certain Warnings 136 | % comment out till issue reolved: https://tex.stackexchange.com/questions/507911/hyperref-silence-inline-maths-doesnt-compile 137 | % \RequirePackage{silence} 138 | % \WarningFilter{microtype}{You are using the `ragged2e' package} 139 | % \WarningFilter{mathdesign}{Package 'amsfonts' shouldn't be used in conjonction with package mdput} 140 | % \WarningFilter{mathdesign}{Package 'amssymb' shouldn't be used in conjonction with package mdput} 141 | 142 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 143 | % Some nice packages 144 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 145 | 146 | % we need to handle colour before anything that loads hyperref 147 | % as otherwise hyperref loads xcolor with clashing options 148 | \RequirePackage{ifdraft} 149 | \RequirePackage{bmc-color} 150 | 151 | % apparently pdfx should be loaded first 152 | \RequirePackage[ 153 | pdfa, 154 | unicode=true, % loads with unicode support 155 | pdfencoding=unicode, 156 | psdextra, % loads replacements for some maths 157 | % a4paper=true, % 158 | pdftex, % 159 | backref, % 160 | pagebackref=false, % creates backward references too 161 | bookmarks=true, % generate bookmarks in PDF files 162 | bookmarksopen=false, % when starting with AcrobatReader, the Bookmarkcolumn is opened 163 | pdfpagemode=UseNone,% UseNone, UseOutlines, UseThumbs, FullScreen 164 | pdftoolbar=false, 165 | pdfmenubar=true, 166 | pdffitwindow=false, 167 | pdfdisplaydoctitle, 168 | pdfborder={1 1 0}, 169 | breaklinks, % (here, onwards) for pdfx 170 | colorlinks, 171 | bookmarksopen, 172 | hyperindex]{hyperref} 173 | \ifbool{bmc@print}{ 174 | \RequirePackage[x-3,pdf17]{pdfx} 175 | }{ 176 | \RequirePackage[a-3u,pdf17]{pdfx} 177 | } 178 | 179 | \RequirePackage{morewrites} 180 | \RequirePackage[automark,draft=false,headwidth=textwithmarginpar,footwidth=head]{scrlayer-scrpage} 181 | \RequirePackage{calc} 182 | 183 | \RequirePackage{tikz} 184 | \ifbool{bmc@externalise}{ 185 | \usetikzlibrary{external} 186 | \tikzexternalize[ 187 | prefix=tikz/, 188 | mode=list and make, 189 | only named=true, 190 | optimize=false 191 | ] 192 | % \tikzset{external/system call={pdflatex \tikzexternalcheckshellescape 193 | % -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"} 194 | % } 195 | }{} 196 | \ifbool{bmc@plot}{ 197 | \RequirePackage{pgfplots} 198 | \usetikzlibrary{plotmarks} 199 | \usepgfplotslibrary{fillbetween} 200 | \usetikzlibrary{arrows.meta,calc} 201 | \pgfplotsset{ 202 | compat=newest, 203 | % only marks, 204 | % -- LEGEND 205 | legend pos=outer north east, 206 | legend style={ 207 | draw=none, 208 | fill opacity=0.75, 209 | fill=text!6!page, 210 | text opacity=1 211 | }, 212 | legend cell align={left}, 213 | % -- AXIS 214 | axis lines=middle, 215 | axis on top, 216 | % -- AXIS ARROWS 217 | inner axis line style={draw=none}, 218 | clip mode=individual, 219 | execute at end axis={ 220 | \path[tips=proper] let \p1=($(rel axis cs:1,1)-(current axis.origin)$), 221 | \p2=($(current axis.origin)-(rel axis cs:0,0)$) 222 | in %\pgfextra{\typeout{\x1,\x2,\y1,\y2}} 223 | \ifdim\x1>1.5pt 224 | (current axis.origin) edge[-{Latex[round,length=\ifdim\x1<3mm 1.2mm\else 2mm\fi]}] 225 | ($({rel axis cs:1,0} |- {current axis.origin})+($(1.36mm,0)-(0,0)$)$) 226 | \fi 227 | \ifdim\x2>1.5pt 228 | (current axis.origin) edge[-{Latex[round,length=\ifdim\x2<3mm 1.2mm\else 2mm\fi]}] 229 | ($({rel axis cs:0,0} |- {current axis.origin})+($(-1.36mm,0)-(0,0)$)$) 230 | \fi 231 | \ifdim\y1>1.5pt 232 | (current axis.origin) edge[-{Latex[round,length=\ifdim\y1<3mm 1.2mm\else 2mm\fi]}] 233 | ($({rel axis cs:0,1} -| {current axis.origin})+($(0,1.36mm)-(0,0)$)$) 234 | \fi 235 | \ifdim\y2>1.5pt 236 | (current axis.origin) edge[-{Latex[round,length=\ifdim\y2<3mm 1.2mm\else 2mm\fi]}] 237 | ($({rel axis cs:0,0} -| {current axis.origin})+($(0,-1.36mm)-(0,0)$)$) 238 | \fi; 239 | }, 240 | % % -- TICKS 241 | minor x tick num=1, 242 | % xtick pos=left, 243 | % ytick pos=left, 244 | enlarge x limits=false, 245 | every x tick/.style={color=text, thin}, 246 | every y tick/.style={color=text, thin}, 247 | tick align=outside, 248 | % xtick placement tolerance=-1mm, 249 | % ytick placement tolerance=-1mm, 250 | % -- LABELS 251 | yticklabel style={/pgf/number format/fixed}, 252 | every tick label/.append style={font=\fontfamily{\headingsFont}\selectfont}, 253 | xlabel near ticks, 254 | ylabel near ticks, 255 | % -- COLOURS / STYLES 256 | cycle multi list={solid,{dotted,mark options={solid}},{dashed,mark options={solid}}\nextlist quaternary,secondary,primary,tertiary}, 257 | % 258 | every axis plot/.append style={ 259 | very thick, 260 | line cap=round 261 | }, 262 | samples=100, 263 | enlargelimits={abs=1pt}, % prevent clipping of plot lines 264 | % inner axis line style={shorten >=0.6pt, shorten <=0.6pt}, 265 | % -- ASYMPTOTES 266 | asym gap/.initial=0.02, 267 | v asym/.style={unbounded coords=jump, 268 | /utils/exec={\foreach \aympX [count=\asympcount] in {#1} { 269 | \ifnum\asympcount=1 270 | \xdef\bmc@plotasymfilter{abs(x-\aympX)<\pgfkeysvalueof{/pgfplots/asym gap}} 271 | \else 272 | \xdef\bmc@plotasymfilter{\bmc@plotasymfilter || abs(x-\aympX)<\pgfkeysvalueof{/pgfplots/asym gap}} 273 | \fi}}, 274 | y filter/.expression = {\bmc@plotasymfilter ? inf:y}, 275 | execute at end plot visualization={ 276 | \begin{scope} 277 | \clip (rel axis cs:0,0) rectangle (rel axis cs:1,1); 278 | \foreach \aympX in {#1} 279 | {\draw[current plot style,densely dashed,thin] 280 | ({rel axis cs:0,0} -| {axis cs:\aympX,0}) -- ({rel axis cs:0,1} -| {axis cs:\aympX,0});} 281 | \end{scope} 282 | } 283 | }, 284 | h asym/.style={unbounded coords=jump, 285 | execute at end plot visualization/.append={ 286 | \begin{scope} 287 | \clip (rel axis cs:0,0) rectangle (rel axis cs:1,1); 288 | \draw[current plot style,densely dashed,thin] 289 | ({rel axis cs:0,0} |- {axis cs:0,#1}) -- ({rel axis cs:1,0} |- {axis cs:0,#1}); 290 | \end{scope} 291 | } 292 | }, 293 | % tick label style = {font=\small}, 294 | % every axis label = {font=\sffamily}, 295 | % legend style = {font=\sffamily}, 296 | % label style = {font=\headingsFont}, 297 | } 298 | % \ifdraft{ 299 | % \let\oldtikzpicture\tikzpicture 300 | % \let\oldendtikzpicture\endtikzpicture 301 | % \renewenvironment{tikzpicture}{% 302 | % \expandafter\oldtikzpicture% 303 | % \renewenvironment{axis}{% 304 | % \draw[dashed] (0,0) rectangle (0.5\textwidth,0.3\textwidth); 305 | % \draw (0.25\textwidth,0.15\textwidth) node[align=center] {\small PGFPlot Figure Here}; 306 | % \comment}{\endcomment}% 307 | % }{% 308 | % \oldendtikzpicture% 309 | % } 310 | % }{} 311 | }{} 312 | 313 | \RequirePackage{booktabs} 314 | \RequirePackage{tabularx} 315 | \RequirePackage{longtable} 316 | 317 | \RequirePackage{multicol} 318 | % \RequirePackage[abbreviations,free-standing-units,use-xspace]{siunitx} 319 | 320 | \RequirePackage{graphicx} 321 | \RequirePackage{grffile} % fix allowed filenames 322 | 323 | \RequirePackage{subcaption} 324 | \RequirePackage[hypcap=true]{caption} 325 | 326 | \RequirePackage{fontawesome5} 327 | \RequirePackage{bmc-boxes} 328 | % \RequirePackage{marginInfoBulle} 329 | 330 | % \RequirePackage[check=warning]{widows-and-orphans} % wait till texlive 2019 331 | 332 | \RequirePackage{xpatch} 333 | 334 | \ifbool{bmc@chem}{ 335 | \RequirePackage[version=4]{mhchem} 336 | \RequirePackage{chemfig} 337 | \setchemfig{ 338 | chemfig style={line width=0.06642 em}, % 'Line Width' 339 | angle increment=30, 340 | double bond sep=0.35700 em, % 'Bond Spacing' 341 | atom sep=1.78500 em, % 'Fixed Length' 342 | bond offset=0.18265 em % 'Margin Width' 343 | } 344 | \renewcommand*\printatom[1]{\small\ensuremath{\mathsf{#1}}} 345 | 346 | % X arrow, Arguments: 347 | % #1, #2, #3, #4, #5, #6: Labels as shown in the output figure 348 | % #7: yshift for the arrow, positive for upwards shift, vice versa 349 | % #8: radius of arc (default 0.333) 350 | % #9: angle for arc (default 60) 351 | % src: https://tex.stackexchange.com/a/372947/167605 352 | \definearrow9{-X>}{% 353 | \CF@arrow@shift@nodes{#7}% 354 | \expandafter\draw\expandafter[\CF@arrow@current@style](\CF@arrow@start@node)--(\CF@arrow@end@node)node[midway](Xarrow@arctangent){};% 355 | \CF@ifempty{#8} 356 | {\def\CF@Xarrow@radius{0.333}} 357 | {\def\CF@Xarrow@radius{#8}}% 358 | \CF@ifempty{#9}% 359 | {\def\CF@Xarrow@absangle{60}} 360 | {\pgfmathsetmacro\CF@Xarrow@absangle{abs(#9)}} 361 | % Draw top arrow (start) 362 | \edef\CF@tmp@str{[\CF@ifempty{#1}{draw=none}{\unexpanded\expandafter{\CF@arrow@current@style}},-]}% 363 | \expandafter\draw\CF@tmp@str (Xarrow@arctangent)% 364 | arc[radius=\CF@compound@sep*\CF@current@arrow@length*\CF@Xarrow@radius,start angle=\CF@arrow@current@angle-90,delta angle=-\CF@Xarrow@absangle]node(Xarrow1@start){}; 365 | % Draw bottom arrow (end) 366 | \edef\CF@tmp@str{[\CF@ifempty{#2}{draw=none}{\unexpanded\expandafter{\CF@arrow@current@style}},-CF]}% 367 | \expandafter\draw\CF@tmp@str (Xarrow@arctangent)% 368 | arc[radius=\CF@compound@sep*\CF@current@arrow@length*\CF@Xarrow@radius,% 369 | start angle=\CF@arrow@current@angle-90,% 370 | delta angle=\CF@Xarrow@absangle]% 371 | node(Xarrow1@end){}; 372 | % Draw bottom arrow (start) 373 | \edef\CF@tmp@str{[\CF@ifempty{#4}{draw=none}{\unexpanded\expandafter{\CF@arrow@current@style}},-]}% 374 | \expandafter\draw\CF@tmp@str (Xarrow@arctangent)% 375 | arc[radius=\CF@compound@sep*\CF@current@arrow@length*\CF@Xarrow@radius,start angle=\CF@arrow@current@angle+90,delta angle=\CF@Xarrow@absangle]node(Xarrow2@start){}; 376 | % Draw bottom arrow (end) 377 | \edef\CF@tmp@str{[\CF@ifempty{#5}{draw=none}{\unexpanded\expandafter{\CF@arrow@current@style}},-CF]}% 378 | \expandafter\draw\CF@tmp@str (Xarrow@arctangent)% 379 | arc[radius=\CF@compound@sep*\CF@current@arrow@length*\CF@Xarrow@radius,% 380 | start angle=\CF@arrow@current@angle+90,% 381 | delta angle=-\CF@Xarrow@absangle]% 382 | node(Xarrow2@end){}; 383 | % Insert labels 384 | \pgfmathsetmacro\CF@tmp@stra{\CF@Xarrow@radius*cos(\CF@arrow@current@angle)<0?"-":"+"}% 385 | \pgfmathsetmacro\CF@tmp@strb{\CF@Xarrow@radius*cos(\CF@arrow@current@angle)<0?"+":"-"}% 386 | \ifdim\CF@Xarrow@radius pt>\z@ 387 | \CF@arrow@display@label{#1}{0}\CF@tmp@stra{Xarrow1@start}{#2}{1}\CF@tmp@stra{Xarrow1@end}% 388 | \CF@arrow@display@label{#4}{0}\CF@tmp@strb{Xarrow2@start}{#5}{1}\CF@tmp@strb{Xarrow2@end}% 389 | \CF@arrow@display@label{#3}{0.5}\CF@tmp@stra\CF@arrow@start@node{}{}{}\CF@arrow@end@node% 390 | \CF@arrow@display@label{#6}{0.5}\CF@tmp@strb\CF@arrow@start@node{}{}{}\CF@arrow@end@node% 391 | \else 392 | \CF@arrow@display@label{#2}{0}\CF@tmp@stra{Xarrow1@start}{#1}{1}\CF@tmp@stra{Xarrow1@end}% 393 | \CF@arrow@display@label{#5}{0}\CF@tmp@strb{Xarrow2@start}{#4}{1}\CF@tmp@strb{Xarrow2@end}% 394 | \CF@arrow@display@label{#3}{0.5}\CF@tmp@stra\CF@arrow@start@node{}{}{}\CF@arrow@end@node% 395 | \CF@arrow@display@label{#6}{0.5}\CF@tmp@strb\CF@arrow@start@node{}{}{}\CF@arrow@end@node% 396 | \fi 397 | } 398 | 399 | % \ifbool{bmc@externalise}{ % source: https://tex.stackexchange.com/questions/245015/precompile-molecules-for-faster-compilation/ 400 | 401 | % \def\CF@chemfig@iii[#1][#2]{% 402 | % \edef\CF@tmp@str{\noexpand\begin{tikzpicture}[remember picture,every node/.style={anchor=base,inner sep=\z@,outer sep=\z@,minimum size=\z@\ifx\@empty#2\@empty\else,#2\fi},baseline\ifx\@empty#1\@empty\else,#1\fi]}% 403 | % \begingroup 404 | % \everyeof{\@nil}\endlinechar\m@ne 405 | % \CF@sanitize@catcode 406 | % \CF@chemfig@iv 407 | % } 408 | 409 | % \def\CF@chemfig@iv#1{% 410 | % \CF@tmp@str 411 | % \let\CF@hook@list\@empty 412 | % \ifx\CF@atom@sep\@empty\def\CF@atom@sep{3em}\fi 413 | % \ifx\CF@cram@basewidth\@empty\def\CF@cram@basewidth{1.5ex}\fi 414 | % \CF@incyclefalse 415 | % \CF@cnt@groupnumber\z@ 416 | % \let\CF@last@action\z@% 0=d\'ebut du dessin 1=trac\'e d'un noeud 2=trac\'e d'une liaison 417 | % \let\CF@start@offset\@empty 418 | % \let\CF@end@offset\@empty 419 | % \let\CF@bond@outcontentsaved\@empty 420 | % \def\CF@cycle@anglecorrection{180/\CF@cycle@num}% 421 | % \def\CF@default@angle{0}% 422 | % \def\CF@default@stringangle{:0}% angle pris par d\'efaut si le champ est vide 423 | % \def\CF@default@length{1}% 424 | % \let\CF@default@fromatom\@empty% numero de l'atome d'o\`u partent les liaisons par d\'efaut 425 | % \let\CF@default@toatom\@empty% num\'ero de l'atome o\`u arrivent les laisons par d\'efaut 426 | % \let\CF@default@tikz\@empty 427 | % \let\CF@previous@bondangle\empty 428 | % \let\CF@joinbond\z@ 429 | % \let\CF@previous@tikz\empty 430 | % \expandafter\assign@tonil\expandafter\CF@remain@molecule\scantokens{#1}% 431 | % \expandafter\CF@chemfig@v\expandafter{\CF@remain@molecule}% 432 | % \end{tikzpicture}% 433 | % \endgroup 434 | % \let\CF@split@state\z@ 435 | % } 436 | % \def\CF@chemfig@vi{% 437 | % \let\CF@next@action\CF@chemfig@vi% \`a priori, on reboucle 438 | % \ifx\CF@remain@molecule\@empty 439 | % \let\CF@next@action\empty 440 | % \else 441 | % \CF@seek@submol 442 | % \expandafter\CF@seek@node\expandafter{\CF@remain@molecule}\CF@current@atomgroup\CF@remain@molecule 443 | % \ifx\@empty\CF@current@atomgroup% pas de noeud pour commencer ? 444 | % \def\CF@bond@outnode{n\CF@last@groupnumber-% 445 | % \ifx\CF@current@fromatom\@empty 446 | % \ifdim\CF@current@angle pt<90pt \number\CF@cnt@atomingroup 447 | % \else\ifdim\CF@current@angle pt>270pt \number\CF@cnt@atomingroup\else1\fi 448 | % \fi 449 | % \else\CF@current@fromatom 450 | % \fi}% 451 | % \expandafter\futurelet\expandafter\CF@toks@a\expandafter\CF@gobble@tonil\CF@remain@molecule\relax\@nil 452 | % \CF@if@firsttokin@i{-=<>~}% la suite est une liaison 453 | % {\ifnum\CF@last@action=\tw@% c'est la deuxi\`eme liaison cons\'ecutive ? 454 | % \CF@insert@emptygroup\CF@remain@molecule% ins\`ere un groupe vide 455 | % \edef\CF@bond@outnode{\CF@bond@outnode}% 456 | % \else 457 | % \ifCF@incycle\advance\CF@cnt@cycle\@ne\fi 458 | % \expandafter\CF@analyse@bond\expandafter{\CF@remain@molecule}\CF@bond@type 459 | % \edef\CF@bond@outnode{\CF@bond@outnode}% 460 | % \let\CF@remain@molecule\CF@remain@afterbond 461 | % \ifCF@incycle 462 | % \ifnum\CF@cnt@cycle=\CF@cycle@num\relax 463 | % \expandafter\expandafter\expandafter\@firstoftwo 464 | % \else 465 | % \ifnum\CF@cnt@cycle=\@ne 466 | % \let\CF@cycle@firsttikz\CF@current@tikz 467 | % \unless\ifx\CF@start@offset\@empty\let\CF@cycle@joinlast\z@\fi 468 | % \fi 469 | % \expandafter\expandafter\expandafter\@secondoftwo 470 | % \fi 471 | % \else 472 | % \expandafter\@secondoftwo 473 | % \fi 474 | % {\let\CF@next@action\endgroup 475 | % \CF@draw@bond\CF@bond@type{\CF@bond@outnode}{\CF@hook@cycle}\CF@previous@atomgroup\CF@hook@atomgroup 476 | % }% 477 | % {\node[at=(\CF@bond@outnode\ifCF@incycle\else\ifCF@macrofixedbondlength.\CF@current@angle\fi\fi),shift=(\ifcase\CF@split@state\or180-\or-\fi\CF@current@angle:\CF@current@length*\CF@atom@sep)](CF@node){}; 478 | % \let\CF@previous@angle\CF@current@angle 479 | % \let\CF@last@action\tw@ 480 | % }% 481 | % \fi 482 | % \ifcat\relax\detokenize\expandafter{\romannumeral-`\.\expandafter\noexpand\CF@remain@molecule}\relax 483 | % % s'il ne reste plus rien apr\`es la liaison (sans tenir compte de l'espace devant)-> ins\`ere un groupe vide 484 | % \CF@insert@emptygroup\CF@remain@molecule 485 | % \fi 486 | % }% 487 | % {\edef\CF@bond@outnode{\CF@bond@outnode}% \'evalue le l'atome de d\'epart de liaison 488 | % \CF@ifx(\CF@toks@a% une parenth\`ese pour commencer ? 489 | % {\ifnum\CF@last@action=\tw@% il y avait une liaison juste avant ? 490 | % \CF@insert@emptygroup\CF@remain@molecule 491 | % \else 492 | % \expandafter\CF@grab@submol\expandafter{\CF@remain@molecule}% 493 | % \begingroup 494 | % \ifCF@incycle\let\CF@last@action\thr@@\fi% on \'etait dans un cycle 495 | % \CF@incyclefalse 496 | % \aftergroup\CF@chemfig@vi 497 | % \def\CF@next@action{\expandafter\CF@chemfig@v\expandafter{\CF@sub@mol}}% 498 | % \fi 499 | % }% 500 | % {\ifx\CF@remain@molecule\@empty 501 | % \let\CF@next@action\endgroup 502 | % \else% ce qui reste apr\`es le noeud courant n'est pas vide, ne commence pas par "-=~", ni par une parenth\`ese 503 | % \CF@ifx*\CF@toks@a% un cycle ? 504 | % {\ifnum\CF@last@action=\tw@ 505 | % \CF@insert@emptygroup\CF@remain@molecule% ins\`ere un groupe vide 506 | % \else 507 | % \ifCF@incycle\let\CF@last@action\thr@@\fi% on \'etait dans un cycle 508 | % \ifnum\CF@last@action=\thr@@\let\CF@lastcycle@num\CF@cycle@num\fi 509 | % \CF@expafterarg@ntimes2\CF@if@firsttokmatch{\expandafter\@gobble\CF@remain@molecule}*% un 2\`e "*" ? 510 | % {\CF@expafterarg@ntimes2{\def\CF@remain@molecule}{\expandafter\@gobble\CF@remain@molecule}% enl\`eve la 1er \'etoile 511 | % \CF@expafterarg@ntimes2\CF@if@firsttokmatch{\expandafter\@gobble\CF@remain@molecule}[% un crochet ensuite ? 512 | % {\expandafter\CF@cycle@parsepreamblewithoptarg\CF@remain@molecule\@nil% \begingroup inclus 513 | % }% 514 | % {\def\CF@cyclearc@startangle{0}\def\CF@cyclearc@endangle{360}% 515 | % \let\CF@cyclearc@directtikz\@empty 516 | % \expandafter\CF@cycle@parsepreamble\CF@remain@molecule\@nil% \begingroup inclus 517 | % }% 518 | % \CF@cyclearctrue 519 | % }% 520 | % {\expandafter\CF@cycle@parsepreamble\CF@remain@molecule\@nil% \begingroup inclus 521 | % \CF@cyclearcfalse 522 | % }% 523 | % \CF@cnt@cycle\z@ 524 | % \edef\CF@hook@cycle{\CF@bond@outnode}% 525 | % \let\CF@hook@atomgroup\CF@previous@atomgroup 526 | % \ifx\CF@hook@atomgroup\CF@empty@node 527 | % \let\CF@cycle@joinlast\@ne% joindre le dernier 528 | % \else 529 | % \let\CF@cycle@joinlast\z@ 530 | % \fi 531 | % \CF@incycletrue 532 | % \ifnum\CF@last@action=\thr@@ 533 | % \pgfmathparse{360/\CF@lastcycle@num-180}% c'est un cycle dans un cycle 534 | % \else 535 | % \pgfmathparse{-180/\CF@cycle@num-90+\CF@cycle@anglecorrection}% 536 | % \fi 537 | % \let\CF@initcycle@angle\pgfmathresult 538 | % \aftergroup\CF@chemfig@vi 539 | % \def\CF@next@action{\expandafter\CF@chemfig@v\expandafter{\CF@sub@mol}}% 540 | % \fi 541 | % }% 542 | % {\errmessage{Package \CF@package@name\space Error: something went wrong here: \detokenize\expandafter{\CF@remain@molecule}^^JIf you think it's a bug, please, send a Minimal Example to the author.}}% 543 | % \fi}% 544 | % }% 545 | % \else 546 | % \CF@expand@second{\CF@expand@second{\CF@expand@second\CF@draw@atomgroup\CF@current@angle}\CF@current@toatom}\CF@current@atomgroup 547 | % \fi 548 | % \fi 549 | % \CF@next@action 550 | % } 551 | 552 | % % \edef\CF@tmp@str{\noexpand\begin{tikzpicture}[remember picture,every node/.style={anchor=base,inner sep=1pt,outer sep=\z@,minimum size=\z@\ifx\@empty#2\@empty\else,#2\fi},baseline\ifx\@empty#1\@empty\else,#1\fi]}% 553 | 554 | % }{} 555 | }{} 556 | 557 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 558 | % Layout 559 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 560 | 561 | \setlength{\leftmargin}{2.5cm} 562 | 563 | \ifdraft{ 564 | \PassOptionsToPackage{showframe}{geometry} 565 | }{} 566 | \if@twoside 567 | % \PassOptionsToPackage{asymmetric}{geometry} 568 | \setlength{\leftmargin}{1cm} 569 | \fi 570 | \ifbool{bmc@notes}{ 571 | \setlength{\rightmargin}{1cm} 572 | \PassOptionsToPackage{includemp}{geometry} 573 | \PassOptionsToPackage{marginparwidth=5cm, marginparsep=5mm}{geometry} 574 | }{ 575 | \setlength{\rightmargin}{2.7cm} 576 | \PassOptionsToPackage{marginparwidth=0cm, marginparsep=0mm}{geometry} 577 | } 578 | \ifbool{bmc@landscape}{ 579 | \PassOptionsToPackage{landscape}{geometry} 580 | }{} 581 | \RequirePackage[a4paper, ignoreheadfoot, left=\leftmargin, right=\rightmargin, top=2cm, bottom=3.5cm, headsep=1cm]{geometry} 582 | 583 | \setlength{\skip\footins}{1cm} 584 | \setlength{\footnotesep}{2mm} 585 | \setlength{\parskip}{1ex} 586 | % we don't want paragraphs to indent, but we do want \indent to work 587 | \newlength\tindent 588 | \setlength{\tindent}{\parindent} 589 | \setlength{\parindent}{0pt} 590 | \renewcommand{\indent}{\hspace*{\tindent}} 591 | 592 | % set caption style 593 | \setkomafont{caption}{\fontfamily{\headingsFont}\small\color{text}} 594 | \setkomafont{captionlabel}{\fontfamily{\headingsFont}\fontseries{tx}\selectfont\upshape\color{text}} 595 | \captionsetup{justification=raggedright,singlelinecheck=true} 596 | 597 | % ensure tables have correct text colour 598 | \AtBeginEnvironment{tabular}{\color{text}} 599 | 600 | % Code blocks 601 | \ifbool{bmc@code}{ 602 | \RequirePackage{minted} 603 | \RequirePackage[many]{tcolorbox} 604 | 605 | \setminted{ 606 | frame=none, 607 | % framesep=2mm, 608 | baselinestretch=1.2, 609 | fontsize=\footnotesize, 610 | highlightcolor=page!95!text!80!primary, 611 | linenos, 612 | breakanywhere=true, 613 | breakautoindent=true, 614 | breaklines=true, 615 | tabsize=4, 616 | xleftmargin=3.5em, 617 | autogobble=true, 618 | obeytabs=true, 619 | python3=true, 620 | % texcomments=true, 621 | framesep=2mm, 622 | breakbefore=\\\.+, 623 | breakafter=\, 624 | } 625 | 626 | \BeforeBeginEnvironment{minted}{ 627 | \begin{tcolorbox}[ 628 | enhanced, 629 | overlay={\fill[page!90!text] (frame.south west) rectangle ([xshift=2.8em]frame.north west);}, 630 | colback=page!95!text, 631 | colframe=page!95!text, % make frame colour same as background 632 | breakable,% Allow page breaks 633 | arc=0pt,outer arc=0pt,sharp corners, % sharp corners 634 | boxsep=0pt,left=0pt,right=0pt,top=0pt,bottom=0pt % no margin/paddding 635 | ] 636 | } 637 | \AfterEndEnvironment{minted}{\end{tcolorbox}} 638 | 639 | \ifbool{bmc@dark}{ 640 | \setminted{ 641 | style=monokai, 642 | breaksymbol=\color{page!80!text}\tiny\ensuremath{\hookrightarrow}, 643 | breakanywheresymbolpre=\,\footnotesize\ensuremath{_{\color{page!80!text}\rfloor}}, 644 | breakbeforesymbolpre=\,\footnotesize\ensuremath{_{\color{page!80!text}\rfloor}}, 645 | breakaftersymbolpre=\,\footnotesize\ensuremath{_{\color{page!80!text}\rfloor}}, 646 | } 647 | }{ 648 | \setminted{ 649 | style=autumn, 650 | breaksymbol=\color{page!60!text}\tiny\ensuremath{\hookrightarrow}, 651 | breakanywheresymbolpre=\,\footnotesize\ensuremath{_{\color{page!60!text}\rfloor}}, 652 | breakbeforesymbolpre=\,\footnotesize\ensuremath{_{\color{page!60!text}\rfloor}}, 653 | breakaftersymbolpre=\,\footnotesize\ensuremath{_{\color{page!60!text}\rfloor}}, 654 | } 655 | } 656 | 657 | \renewcommand\theFancyVerbLine{\color{text!60!page}\arabic{FancyVerbLine}} % minted line numbering 658 | 659 | \let\mintinlineold\mintinline 660 | \setmintedinline{breaklines,bgcolor={}} 661 | % FIXME: issue with line breaking (it doesn't) 662 | \DeclareTotalTCBox{\mintinline}{v v}{ 663 | nobeforeafter,tcbox raise base, 664 | enhanced, frame hidden, arc=3pt, 665 | boxsep=0pt,left=3pt,right=3pt,top=2pt,bottom=2pt, % minimal margin/paddding 666 | colback=page!94!text, 667 | outer arc=0pt, 668 | leftrule=0pt,rightrule=0pt,toprule=0pt,bottomrule=0pt 669 | }{\mintinlineold{#1}{#2}} 670 | 671 | }{} 672 | 673 | % % Set Image Max Dimentions 674 | % \makeatletter 675 | % \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} 676 | % \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} 677 | % \makeatother 678 | % % Scale images if necessary, so that they will not overflow the page 679 | % % margins by default, and it is still possible to overwrite the defaults 680 | % % using explicit options in \includegraphics[width, height, ...]{} 681 | % \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} 682 | 683 | % Time Format for \today 684 | % ====================== 685 | 686 | \renewcommand{\today}{ 687 | \ifnum\number\day<10 0\fi \number\day% 688 | \ifnum\number\day>3 \textsuperscript{th} \else\ifnum\number\day=3 \textsuperscript{rd} \else\ifnum\number\day=2 \textsuperscript{nd} \else\ifnum\number\day=1 \textsuperscript{st} \fi\fi\fi\fi % 689 | \ifcase \month \or January\or February\or March\or April\or May% 690 | \or June\or July\or August\or September\or October\or November\or December\fi% 691 | \space% 692 | \number \year% 693 | } 694 | 695 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 696 | % Colors & Font 697 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 698 | 699 | % and fill the row(s) after \toprule 700 | \newbool{tabularTitleRow} 701 | \boolfalse{tabularTitleRow} 702 | \colorlet{tableheadcolor}{text!5!page} % Table header colour = 5% gray 703 | 704 | % region headerfill 705 | 706 | % from https://tex.stackexchange.com/a/494959/167605 707 | 708 | \renewcommand{\toprule}{% 709 | \showrowcolors 710 | \arrayrulecolor{text}\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}% 711 | \arrayrulecolor{tableheadcolor}\specialrule{\belowrulesep}{0pt}{0pt}% 712 | \arrayrulecolor{text}% 713 | \rowcolor{tableheadcolor}% 714 | } 715 | 716 | \apptocmd\midrule{\hiderowcolors}{}{\FAILED} 717 | 718 | \let\@BTrule@ORI=\@BTrule 719 | \let\my@BTrule=\@BTrule 720 | 721 | % Modified version of \@BTrule that doesn't do \vskip\@aboverulesep, for use 722 | % when the corresponding vertical space should be coloured. 723 | \patchcmd{\my@BTrule}{% 724 | \ifnum\@lastruleclass=\z@\vskip\@aboverulesep\else 725 | }{% 726 | \ifnum\@lastruleclass=\z@\else 727 | }{}{\FAILED} 728 | 729 | \let\@arraycrORI=\@arraycr 730 | 731 | % The “master counter” hackery is explained in the TeXbook appendix D (Dirty 732 | % Tricks), pp. 385-386. It is also mentioned in the array.sty implementation 733 | % notes concerning \@arraycr. 734 | \renewcommand*{\@arraycr}{% 735 | % Increase the master counter. This is needed to prevent TeX from 736 | % prematurely finishing the alignment entry in case \\ was followed by '&' 737 | % (when the \futurelet from \@ifnextchar causes TeX to read a '&', this 738 | % finishes the entry unless the master counter has a different value than it 739 | % had when the entry was started). 740 | \relax\iffalse{\fi\ifnum 0=`}\fi 741 | % Each of the two branches takes care of decreasing the master counter. 742 | \@ifnextchar\midrule 743 | {\@firstoftwo{\my@endtablehead}}% gobble the following \midrule 744 | \my@closebrace@and@arraycrORI 745 | } 746 | 747 | \newcommand*{\my@endtablehead}{% 748 | \ifnum 0=`{}\fi % the second brace decreases the master counter 749 | \@arraycrORI[\aboverulesep]% this colours the additional space with the 750 | % current row color 751 | \noalign{\global\let\@BTrule\my@BTrule}% temporarily modify \@BTrule 752 | \midrule 753 | \noalign{\global\let\@BTrule\@BTrule@ORI}% restore it 754 | } 755 | 756 | \newcommand*{\my@closebrace@and@arraycrORI}{% 757 | \ifnum 0=`{}\fi % the second brace decreases the master counter 758 | \@arraycrORI 759 | } 760 | 761 | \rowcolors{1}{tableheadcolor}{tableheadcolor} 762 | 763 | \AtBeginDocument{ 764 | \setbox0=\hbox{\begin{tabular}{l}\hiderowcolors\end{tabular}} 765 | } 766 | % endregion headerfill 767 | 768 | 769 | \RequirePackage{bmc-fonts} 770 | \ifdefempty{\bmc@math}{}{ 771 | \RequirePackage{bmc-maths} 772 | } 773 | 774 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 775 | % Titling 776 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 777 | 778 | \RequirePackage{bmc-sectioning} 779 | 780 | % Cover Page 781 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 782 | 783 | % \newcommand\subtitle[1]{\renewcommand\@foo{#1}} 784 | % \newcommand\@subtitle{\@latex@error{No \noexpand\subtitle given}\@ehc} 785 | 786 | \newcommand{\maketitlefullpage}{% 787 | \thispdfpagelabel{Cover} 788 | 789 | \ifbool{bmc@solid}{ 790 | \pagecolor{primary}} 791 | {\pagecolor{page}} 792 | 793 | \begin{titlepage} 794 | \newgeometry{left=4cm,right=2.7cm, top=1.5cm} 795 | 796 | \ifbool{bmc@solid}{ 797 | \ifbool{bmc@dark}{ 798 | \color{page}} 799 | {\color{contrastColour}}} 800 | {\color{primary}} 801 | 802 | \fontfamily{\titleFont}\selectfont 803 | 804 | \ifdefempty{\@titlehead}{}{% 805 | \begin{center} 806 | \LARGE 807 | % \ifbool{bmc@solid}{ 808 | % \color{alternativePrimary} 809 | % }{ 810 | \color{primary!60!contrastColour} 811 | % } 812 | \expandafter\textsc\expandafter{\@titlehead} 813 | % 814 | \end{center}% 815 | } 816 | 817 | \vspace*{3.5cm} 818 | 819 | \fontsize{2cm}{4em}\fontseries{sb}\selectfont 820 | \@title 821 | \vspace{-1.1cm} 822 | 823 | \noindent\makebox[\linewidth]{ 824 | \hspace{2.64cm} 825 | \ifbool{bmc@solid}{ 826 | \ifbool{bmc@dark}{ 827 | \color{contrastColour}} 828 | {\color{alternativePrimary}}} 829 | {\color{primaryVariant}} 830 | \rule{\paperwidth-2.64cm}{2pt}} 831 | 832 | \hspace*{-0.25mm}\fontseries{m}\selectfont\huge\@subtitle 833 | 834 | \vspace{2.5cm} 835 | 836 | \fontseries{l}\selectfont 837 | \@author 838 | 839 | \vfill 840 | 841 | % @\subject 842 | 843 | \vspace{1.5cm} 844 | 845 | % \@publishers 846 | 847 | \fontseries{m}\selectfont\Large 848 | \@date 849 | 850 | \restoregeometry 851 | \end{titlepage} 852 | 853 | \newpage 854 | \pagecolor{page}% 855 | } 856 | \ifbool{bmc@article}{ 857 | \renewcommand{\maketitle}{ 858 | \thispagestyle{plain} 859 | \begin{centering} 860 | \ifbool{bmc@solid}{ 861 | \ifbool{bmc@dark}{ 862 | \color{page}} 863 | {\color{primary}}} 864 | {\color{primary}} 865 | \fontfamily{\titleFont}\selectfont 866 | 867 | \vspace*{-1cm} 868 | {% 869 | \fontseries{m}\selectfont\Large 870 | \ifdefempty{\@titlehead}{% 871 | \ifdefempty{\@date}{\vspace{-1.3cm}}{}% 872 | }{% 873 | \expandafter\textsc\expandafter{\@titlehead}% 874 | }% 875 | \hfill 876 | \@date 877 | } 878 | \vspace{0.3cm} 879 | 880 | \fontsize{1.4cm}{1.4cm}\fontseries{sb}\selectfont 881 | \@title 882 | 883 | \ifdefempty{\@subtitle}{}{ 884 | \fontseries{m}\selectfont\huge\@subtitle 885 | } 886 | 887 | \vspace{0.2cm} 888 | 889 | \fontseries{l}\selectfont 890 | \LARGE 891 | \@author 892 | 893 | % @\subject 894 | 895 | % \@publishers 896 | \vspace{0.4cm} 897 | \end{centering} 898 | } 899 | }{\renewcommand{\maketitle}{\maketitlefullpage}} 900 | 901 | \RequirePackage{scrhack} 902 | 903 | \AtBeginDocument{% 904 | \color{text} 905 | \pagecolor{page} 906 | } 907 | 908 | % at the end because of \endofdump 909 | \newcommand{\acr}[1]{\protect\scalebox{.91}[.84]{\textls*[70]{\protect\fauxfontheavier#1}}} 910 | \ifbool{bmc@gloss}{ 911 | \AtEndPreamble{ 912 | % \endofdump if using mylatexformat 913 | \ifdefined\endofdump\endofdump\fi 914 | 915 | \usepackage[automake, smallcaps, numberedsection=nolabel, style=long3col]{glossaries} 916 | \makeglossaries 917 | \ifdefined\bmcaftergloss\bmcaftergloss\fi 918 | 919 | \newglossarystyle{mylist}{% 920 | \setglossarystyle{long3col} 921 | 922 | \newlength\glsnamewidth 923 | \setlength{\glsnamewidth}{0.28\textwidth} 924 | \setlength{\glsdescwidth}{0.64\textwidth} 925 | \setlength{\glspagelistwidth}{0.08\textwidth} 926 | 927 | \renewenvironment{theglossary}% 928 | {\begin{longtable}{>{\raggedright}p{\glsnamewidth}>{\raggedright}p{\glsdescwidth}>{\raggedright}p{\glspagelistwidth}}}% 929 | {\end{longtable}}% 930 | \renewcommand*{\glossentry}[2]{% 931 | \normalfont\fontseries{m}\selectfont\slshape \glsentryitem{##1}% 932 | \glstarget{##1}{\glossentryname{##1}} &% 933 | \glossentrydesc{##1}\glspostdescription & ##2% 934 | \tabularnewline[1ex]}% 935 | } 936 | \setglossarystyle{mylist} 937 | 938 | \renewcommand{\acronymfont}[1]{\acr{#1}} 939 | 940 | \newcommand{\newdefinedacronym}[4]{ 941 | \newglossaryentry{#1}{ 942 | text={#2}, 943 | long={#3}, 944 | name={#3 (\acronymfont{#2})}, 945 | first={#3 (\acronymfont{#2})}, 946 | plural={#2\glspluralsuffix}, 947 | firstplural={#3\glspluralsuffix{} (\acronymfont{#2}\protect\scalebox{0.9}{\protect\fauxfontheavier\glspluralsuffix})}, 948 | description={#4} 949 | } 950 | } 951 | 952 | % \setglossarysection{chapter} 953 | } 954 | }{} 955 | \AtEndPreamble{ 956 | \@ifpackageloaded{biblatex}{ 957 | % \DeclarePrintbibliographyDefaults{heading=bibnumbered} % Wait for updated package 958 | \ifbool{bmc@article}{}{ 959 | \defbibenvironment{bibliography}{% 960 | \ifboolexpr{bool {bmc@solid} or bool {bmc@stripe}}{\newpage}{\vspace*{2cm}} 961 | \list{}{% 962 | \setlength{\leftmargin}{\bibhang}% 963 | \setlength{\itemindent}{-\leftmargin}% 964 | \setlength{\itemsep}{\bibitemsep}% 965 | \setlength{\parsep}{\bibparsep}}} 966 | {\endlist} 967 | {\item} 968 | }{} 969 | } 970 | } 971 | 972 | \RequirePackage{bmc-ref} 973 | -------------------------------------------------------------------------------- /documentation/bmc-demo-img.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc4083a41871714475f711799d0b341803fcc2287a97d93d0059944522c8a8cc 3 | size 254183 4 | -------------------------------------------------------------------------------- /documentation/bmc.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:90326ebf5a4232d52b5691695b7605700661fa4b0fbeee559e76b98ccb6afaa9 3 | size 1215135 4 | -------------------------------------------------------------------------------- /documentation/bmc.svg: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> 3 | 4 | <svg 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" 6 | xmlns:cc="http://creativecommons.org/ns#" 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 8 | xmlns:svg="http://www.w3.org/2000/svg" 9 | xmlns="http://www.w3.org/2000/svg" 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" 11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" 12 | width="20.144924mm" 13 | height="7.6495619mm" 14 | viewBox="0 0 20.144924 7.6495619" 15 | version="1.1" 16 | id="svg2184" 17 | inkscape:version="0.92.4 5da689c313, 2019-01-14" 18 | sodipodi:docname="bmc.svg"> 19 | <defs 20 | id="defs2178" /> 21 | <sodipodi:namedview 22 | id="base" 23 | pagecolor="#ffffff" 24 | bordercolor="#666666" 25 | borderopacity="1.0" 26 | inkscape:pageopacity="0.0" 27 | inkscape:pageshadow="2" 28 | inkscape:zoom="11.2" 29 | inkscape:cx="9.2585958" 30 | inkscape:cy="5.9442397" 31 | inkscape:document-units="mm" 32 | inkscape:current-layer="layer1" 33 | showgrid="false" 34 | inkscape:window-width="2560" 35 | inkscape:window-height="1338" 36 | inkscape:window-x="0" 37 | inkscape:window-y="34" 38 | inkscape:window-maximized="1" /> 39 | <metadata 40 | id="metadata2181"> 41 | <rdf:RDF> 42 | <cc:Work 43 | rdf:about=""> 44 | <dc:format>image/svg+xml</dc:format> 45 | <dc:type 46 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> 47 | <dc:title /> 48 | </cc:Work> 49 | </rdf:RDF> 50 | </metadata> 51 | <g 52 | inkscape:label="Layer 1" 53 | inkscape:groupmode="layer" 54 | id="layer1" 55 | transform="translate(-74.594207,-87.556168)"> 56 | <g 57 | aria-label="bmc" 58 | style="font-style:normal;font-weight:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:none;fill-opacity:1;stroke:#019875;stroke-width:0.26499999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99719902;paint-order:normal" 59 | id="text817-0"> 60 | <path 61 | d="m 77.377708,94.308418 c -0.521932,0 -0.966349,-0.186035 -1.333252,-0.552938 -0.366902,-0.37207 -0.542602,-0.816487 -0.542602,-1.338419 0,-0.521932 0.180867,-0.966349 0.542602,-1.333252 0.366903,-0.366903 0.81132,-0.552938 1.333252,-0.552938 0.258382,0 0.501262,0.04651 0.728638,0.139527 0.227376,0.09302 0.434082,0.232544 0.620117,0.418579 0.366903,0.366902 0.54777,0.81132 0.54777,1.338419 0,0.521932 -0.180867,0.966349 -0.54777,1.333252 -0.366902,0.366903 -0.816487,0.552938 -1.348755,0.552938 z m 0,-4.547526 c -0.237711,0 -0.470255,0.03101 -0.702799,0.09819 -0.232544,0.06718 -0.454753,0.155029 -0.666626,0.279052 -0.08785,0.05168 -0.1757,0.118856 -0.26355,0.186035 -0.08785,0.06718 -0.170532,0.139527 -0.248047,0.217041 v -2.464965 c 0,-0.05684 -0.0052,-0.103353 -0.0155,-0.139527 -0.01033,-0.03617 -0.03101,-0.06718 -0.05684,-0.09302 -0.10852,-0.103353 -0.211873,-0.155029 -0.310058,-0.155029 -0.108521,0 -0.217041,0.05168 -0.325562,0.155029 -0.02067,0.02584 -0.03617,0.05684 -0.04651,0.09302 -0.01033,0.03617 -0.0155,0.08268 -0.0155,0.139527 0,0.366902 0,0.728637 0,1.085205 0,0.356567 0,0.718302 0,1.080037 v 2.165243 c 0,0.728637 0.253215,1.353922 0.780315,1.875854 0.532267,0.521932 1.157552,0.785482 1.875854,0.785482 0.733805,0 1.364258,-0.26355 1.88619,-0.785482 0.521932,-0.521932 0.780314,-1.147217 0.780314,-1.881022 0,-0.733805 -0.258382,-1.35909 -0.780314,-1.881022 -0.521932,-0.521932 -1.152385,-0.780314 -1.891358,-0.780314 z" 62 | style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Modulus;-inkscape-font-specification:'Modulus Bold';fill:none;fill-opacity:1;stroke:#019875;stroke-width:0.365;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99719902;paint-order:normal" 63 | id="path814" /> 64 | <path 65 | d="m 86.937848,89.791898 c -0.43925,0 -0.847493,0.129191 -1.219564,0.377238 -0.10852,0.07235 -0.206705,0.149862 -0.299723,0.242879 -0.09302,0.09302 -0.1757,0.196371 -0.253215,0.304891 -0.06718,-0.09819 -0.149861,-0.19637 -0.248046,-0.289388 -0.09819,-0.09302 -0.201538,-0.1757 -0.310059,-0.253214 -0.366903,-0.253215 -0.775146,-0.377238 -1.224731,-0.377238 -0.583944,0 -1.090373,0.206706 -1.51412,0.620117 -0.418579,0.408244 -0.640788,0.909505 -0.640788,1.498617 v 2.775024 c 0,0.09818 0.03617,0.186035 0.103353,0.26355 0.06718,0.07751 0.160197,0.113688 0.279053,0.113688 0.09819,0 0.186035,-0.03101 0.26355,-0.108521 0.07235,-0.06718 0.10852,-0.155029 0.10852,-0.263549 v -2.744019 c 0,-0.387573 0.144694,-0.707967 0.413412,-0.981852 0.273885,-0.273885 0.599446,-0.418579 0.98702,-0.418579 0.382405,0 0.713134,0.139526 0.987019,0.418579 0.273886,0.273885 0.408244,0.599446 0.408244,0.981852 v 2.744019 c 0,0.124023 0.04134,0.211873 0.124024,0.28422 0.07235,0.06718 0.155029,0.09302 0.248047,0.09302 0.10852,0 0.19637,-0.031 0.268717,-0.10852 0.07235,-0.07752 0.108521,-0.165365 0.108521,-0.268717 v -2.744019 c 0,-0.387573 0.139526,-0.707967 0.413411,-0.981852 0.279053,-0.279053 0.604614,-0.418579 0.992187,-0.418579 0.387574,0 0.718303,0.139526 0.992188,0.418579 0.268717,0.268717 0.403076,0.594279 0.403076,0.981852 v 2.744019 c 0,0.113688 0.03617,0.19637 0.113688,0.268717 0.08268,0.07235 0.165365,0.10852 0.26355,0.10852 0.09302,0 0.180867,-0.031 0.258382,-0.103352 0.08268,-0.06201 0.124024,-0.15503 0.124024,-0.273885 v -2.744019 c 0,-0.583944 -0.211874,-1.090373 -0.635621,-1.519287 -0.408243,-0.418579 -0.914672,-0.630452 -1.519287,-0.630452 z" 66 | style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Modulus;-inkscape-font-specification:'Modulus Bold';fill:none;fill-opacity:1;stroke:#019875;stroke-width:0.365;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99719902;paint-order:normal" 67 | id="path816" /> 68 | <path 69 | d="m 94.539451,93.93118 c -0.06718,-0.08785 -0.155029,-0.139526 -0.263549,-0.155029 h -0.05168 c -0.07751,0 -0.149861,0.03101 -0.222208,0.08785 -0.335897,0.273885 -0.728638,0.413411 -1.178223,0.413411 -0.516764,0 -0.956014,-0.180867 -1.317749,-0.542602 -0.366903,-0.361735 -0.54777,-0.800985 -0.54777,-1.317749 0,-0.511597 0.180867,-0.950846 0.54777,-1.317749 0.366903,-0.366903 0.806152,-0.54777 1.317749,-0.54777 0.206706,0 0.408244,0.03617 0.609782,0.10852 0.201538,0.07235 0.387573,0.1757 0.558105,0.304891 0.07752,0.05684 0.15503,0.08268 0.232544,0.08268 h 0.05168 c 0.05684,-0.0052 0.103353,-0.02067 0.139526,-0.04134 0.03617,-0.02067 0.07235,-0.05168 0.103353,-0.08785 0.02584,-0.04134 0.04651,-0.08268 0.06201,-0.129191 0.0155,-0.04651 0.02584,-0.09302 0.02584,-0.139526 -0.01033,-0.07235 -0.02584,-0.129191 -0.05168,-0.170532 -0.02584,-0.04134 -0.06201,-0.08268 -0.10852,-0.118856 -0.232544,-0.180868 -0.485759,-0.320394 -0.764811,-0.418579 -0.279053,-0.09819 -0.568441,-0.149862 -0.868164,-0.149862 -0.718303,0 -1.33842,0.258382 -1.860352,0.769979 -0.511597,0.506429 -0.769979,1.126546 -0.769979,1.855184 0,0.718302 0.253215,1.343587 0.769979,1.860351 0.516764,0.516765 1.142049,0.764812 1.860352,0.764812 0.625284,0 1.173055,-0.196371 1.648478,-0.589112 l -0.0052,0.0052 c 0.09302,-0.05168 0.144694,-0.139526 0.149862,-0.258382 0,-0.05684 -0.0052,-0.103353 -0.0155,-0.144694 -0.01033,-0.04134 -0.03101,-0.07752 -0.05684,-0.113688 0,-0.0052 0,-0.0052 0,-0.0052 0,0 0,0 0,-0.0052 z" 70 | style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Modulus;-inkscape-font-specification:'Modulus Bold';fill:none;fill-opacity:1;stroke:#019875;stroke-width:0.365;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99719902;paint-order:normal" 71 | id="path818" /> 72 | </g> 73 | </g> 74 | </svg> 75 | -------------------------------------------------------------------------------- /documentation/bmc.tex: -------------------------------------------------------------------------------- 1 | \documentclass[solid,math,chem,code,plot,gloss]{bmc} 2 | 3 | \titlehead{Bespoke Multipurpose Class} 4 | \title{\texorpdfstring{BMC \hfill \fontsize{1.35cm}{1.35cm}\fontseries{t}\selectfont \emph{v}0.2.2*}{BMC v0.2.2*}} 5 | \subtitle{Pretentiousness Given Form} 6 | \author{tecosaur \footnotesize \newline of GitHub} 7 | 8 | \usepackage[symbol*]{footmisc} 9 | \renewcommand{\thefootnote}{\fnsymbol{footnote}} 10 | \usepackage[normalem]{ulem} 11 | 12 | \newcommand*{\fullref}[1]{\hyperref[{#1}]{\ref*{#1} \nameref*{#1}}} 13 | 14 | \usepackage[style=apa,backend=biber]{biblatex} 15 | \bibliography{refs} 16 | 17 | \begin{document} 18 | 19 | \newglossaryentry{tracking} 20 | { 21 | name=tracking, 22 | description={Tracking is the typographer's term for letter-spacing. Tracking adjusts the letter-spacing uniformly over a range of characters.} 23 | } 24 | 25 | \maketitle 26 | 27 | \thispdfpagelabel{Preface} 28 | \section*{Preface} 29 | 30 | \vspace{1cm} 31 | 32 | Like with most things I didn't start out with the intent to end up this way. 33 | Initially I had a slowly growing template that I used for most documents; 34 | every so often I'd discover a package that did something I liked, 35 | or a setting that I preferred to be non-default. 36 | \emph{Every} time that happened I'd want to go through the current documents 37 | I was working on and apply the latest revelations. 38 | Then when revisiting old documents I'd want to get them `up to scratch'. 39 | There would always be the odd document I forgot about, or line missed, 40 | and so I quickly became tired of this process. 41 | 42 | After realising that if I made a class and shoved it in my \verb|texmf| 43 | directory that I'd be able to as many improvements as I like and they'd all 44 | be applied when I recompiled, \emph{as well} as make initial configuration 45 | greatly simplified --- I couldn't see a reason not to do it. 46 | 47 | This class is very much written with my personal taste, and specific use case in mind. 48 | While I try to keep things general, it is very much built around my particular perspective. 49 | As such it is reasonable to think that to the community as a whole the 50 | self-importance in the name is a tad exaggerated or undeserved. 51 | Considering that is also designed to not just convey information but also 52 | designed to visually impress, the tagline `Pretentiousness given form' 53 | seems somewhat appropriate. 54 | 55 | I'm pleased to say that I consider this a project a success (in those respects). 56 | As I have largely drawn upon snippets of LaTeX floating around online 57 | I though the least I could do is give others that same opportunity. 58 | As such here you have an overview of my personal class 59 | designed to work for all of the documents I produce. 60 | In other words a \emph{bespoke, multipurpose class} --- or \acr{BMC} for short. 61 | 62 | \vspace{1cm} 63 | 64 | Enjoy! 65 | 66 | \vfill 67 | 68 | tecosaur 69 | 70 | \vspace{3cm} 71 | 72 | \newpage 73 | \fancytoc{} 74 | 75 | \chapter{What This Does} 76 | 77 | \section{Typography} 78 | 79 | \subsection{Typefaces} 80 | 81 | This package loads three typefaces. 82 | \begin{enumerate} 83 | \item IBM Plex Serf 84 | \item IBM Plex Sans 85 | \item IBM Plex Mono 86 | \end{enumerate} 87 | I wanted a selection where serif, sans, and mono all mix well. 88 | Ideally with a few weight variants. 89 | Additionally I wanted a typographic style that meshed well with the 90 | large class of documents I indented to use this for. IBM Plex seems like a good fit 91 | (For more info see \fullref{sec:why-typefaces}). For all three of these a linespread 92 | of 1.15 is used. 93 | 94 | \newcommand\setrow[1]{\gdef\rowmac{#1}#1\ignorespaces} 95 | \newcommand\clearrow{\global\let\rowmac\relax} 96 | \clearrow 97 | \begin{table}[!htb] 98 | \centering 99 | \setlength{\tabcolsep}{4pt} 100 | \begin{tabular}{ 101 | l 102 | >{\rowmac\ifbool{tabularTitleRow}{}{\fontseries{b}\selectfont}}l 103 | >{\rowmac\ifbool{tabularTitleRow}{}{\fontseries{sb}\selectfont}}l 104 | >{\rowmac\ifbool{tabularTitleRow}{}{\fontseries{mb}\selectfont}}l 105 | >{\rowmac\ifbool{tabularTitleRow}{}{\fontseries{tx}\selectfont}}l 106 | >{\rowmac}l 107 | >{\rowmac\ifbool{tabularTitleRow}{}{\fontseries{l}\selectfont}}l 108 | >{\rowmac\ifbool{tabularTitleRow}{}{\fontseries{el}\selectfont}}l 109 | >{\rowmac\ifbool{tabularTitleRow}{}{\fontseries{t}\selectfont}}l 110 | } 111 | \toprule 112 | Typeface & Bold & Semibold & Medium & Text & Regular & Light & Extra L & Thin \\ 113 | \setrow{\ttfamily\scriptsize}\verb|\selectfont| & b & sb & mb & tx & m & l & el & t \\ 114 | \midrule 115 | \setrow{\rmfamily}\!Plex Serif & Words & Words & Words & Words & Words & Words & Words & Words \\ 116 | \setrow{\rmfamily\itshape}\!Plex Serif & Words & Words & Words & Words & Words & Words & Words & Words \\ 117 | \arrayrulecolor{page}\midrule 118 | \setrow{\sffamily}Plex Sans & Words & Words & Words & Words & Words & Words & Words & Words \\ 119 | \setrow{\sffamily\itshape}Plex Sans & Words & Words & Words & Words & Words & Words & Words & Words \\ 120 | \midrule 121 | \setrow{\plexsanscondensed}Condensed & Words & Words & Words & Words & Words & Words & Words & Words \\ 122 | \setrow{\plexsanscondensed\itshape}Condensed & Words & Words & Words & Words & Words & Words & Words & Words \\ 123 | \midrule\arrayrulecolor{text} 124 | \setrow{\ttfamily}Plex Mono & Words & Words & Words & Words & Words & Words & Words & Words \\ 125 | \setrow{\ttfamily\itshape}Plex Mono & Words & Words & Words & Words & Words & Words & Words & Words \\ 126 | \bottomrule 127 | \end{tabular} 128 | \caption{IBM Plex; Font Styles and Weights} 129 | \label{table:font-styles} 130 | \end{table} 131 | 132 | \begin{info}[][Some Typeface Considerations][tf-consid] 133 | While this is the default, you can still load another font as 134 | usual in the preamble, e.g. 135 | \mintinline{tex}{\usepackage{lmodern}} 136 | to switch to Latin Modern. 137 | Bear in mind that varying font weights are using throughout 138 | this class, so a font without the \mintinline{tex}{sb}, 139 | \mintinline{tex}{tx}, etc.\ weights will report warnings 140 | along the lines of \mintinline{text}{Font shape `T1/FONT_HERE/STYLE/n' undefined}. 141 | \end{info} 142 | 143 | \subsection{Roman Numerals} 144 | 145 | While biblatex does provide handy roman numeral command, 146 | it's nice to have them available regardless. 147 | Hence this class provides them if they aren't already available. 148 | To get upper case roman numerals use \mintinline{tex}{\RN{1978}} 149 | to produce \RN{1978}, and \mintinline{tex}{\Rn{1978}} 150 | to produce \Rn{1978}. 151 | 152 | \begin{minted}[firstnumber=304]{tex} 153 | \providecommand*{\RN}[1]{\expandafter\@slowromancap\romannumeral #1@} 154 | \providecommand*{\Rn}[1]{\romannumeral#1\relax} 155 | \end{minted} 156 | 157 | \subsection{Faux Small Caps} 158 | Some fonts (such as IBM Plex) are not kind enough to provide small caps. 159 | Simply using downscaled capitals is a barbaric and decidedly inferior solution. 160 | So \mintinline{tex}{\fauxsc{}} is defined which, while not as nice as \emph{true} 161 | small caps, is a darn sight better than just reducing the font size. 162 | \mintinline{tex}{\fauxsc{}} is \emph{automatically} used when \mintinline{tex}{\textsc{}} 163 | is called if the current font does not have small caps. 164 | \vspace{-6pt} 165 | \begin{center} 166 | \parbox{0cm}{ 167 | \begin{tabbing} 168 | \texttt{\small \textbackslash textsc} using \texttt{\small \textbackslash fauxsc}:\quad \= \textsc{Small Caps} \\ 169 | Barbaric Solution: \> S{\footnotesize MALL} C{\footnotesize APS} 170 | \end{tabbing}} 171 | \end{center} 172 | 173 | \begin{warning}[Small Caps][Usage Warning][sc-usage] 174 | If using this in macros or the like, 175 | you may get errors such as 176 | {\ttfamily\small ``Improper alphabetic constant''}, 177 | {\ttfamily\small ``Missing = inserted for \texttt{\small \textbackslash ifnum}''}, 178 | and {\ttfamily\small ``Missing number, treated \\ as zero''}. 179 | 180 | Here you will likely need to use 181 | \texttt{\small \textbackslash expandafter\textbackslash textsc\textbackslash expandafter} instead. 182 | \end{warning} 183 | 184 | \subsection{Penalties} 185 | The class sets new penalties. 186 | \begin{minted}[firstnumber=209]{tex} 187 | \@beginparpenalty=10000 % don't like it when a paragraph title is on a different page to the start of the content 188 | \hyphenpenalty=500 % not a huge fan of hyphens, but they are worthwhile 189 | \lefthyphenmin=2 190 | \righthyphenmin=3 191 | \end{minted} 192 | 193 | \subsection{Captions} 194 | Caption labels are made to be upright sans-serif in the `text' style, 195 | while captions are italic in the style of the body. 196 | When captions flow beyond a single line, ragged right alignment is used. 197 | 198 | \begin{minted}[firstnumber=464]{tex} 199 | \setkomafont{caption}{\itshape\color{text}} 200 | \setkomafont{captionlabel}{\fontfamily{\headingsFont}\fontseries{tx}\selectfont\upshape\color{text}} 201 | \captionsetup{justification=raggedright,singlelinecheck=true} 202 | \end{minted} 203 | 204 | \subsection{Terms and Acronyms} 205 | With the \mintinline{tex}{gloss} option, this class loads and configures the 206 | \mintinline{tex}{glossaries} package. Three things are changed 207 | \newacronym{bmc}{BMC}{Bespoke Multipurpose Class} 208 | \begin{enumerate} 209 | \item A new command \mintinline{tex}{\acr{TEXT}} is added. This 210 | \begin{enumerate} 211 | \item Selects the next higher font weight 212 | \item Scales the text vertically by a factor of 0.84, and horizontally by 0.91 213 | \item Increases \gls{tracking} by 7\acr{M}/100\footnote{See \P~2.1.6 of~\cite{Bringhurst_2004}} 214 | \end{enumerate} 215 | \item Acronyms are typeset in the style of \mintinline{tex}{\acr}, e.g. \gls{bmc} 216 | \item The glossary style in configured to a variant of \mintinline{tex}{long3col} 217 | \item A new command \mintinline{tex}{\newdefinedacronym{label}{short}{long}{description}} is added 218 | \end{enumerate} 219 | 220 | \section{Boxes} 221 | 222 | A collection of boxed environments are defined using \mintinline{tex}{tcolorbox}, 223 | there have been two so far: \autoref{info:tf-consid} and \autoref{warn:sc-usage}. 224 | You can use these environments like so: 225 | \begin{minted}{tex} 226 | \begin{example} 227 | This is an example. The next one is \autoref{eg:box-demo}. 228 | \end{example} 229 | \end{minted} 230 | \begin{example} 231 | This is an example. The next one is \autoref{eg:box-demo}. 232 | \end{example} 233 | These environments also accept three optional arguments. 234 | \begin{enumerate} 235 | \item The subtitle. This appears after the bold title ({\sffamily\fontseries{sb}\selectfont Example N}). 236 | \item The title, if this is set the counter value is shown in the right corner, 237 | as seen in the example below. 238 | \item The label suffix, defaulting to the counter value. 239 | The full label is \mintinline{tex}{<prefix>:<suffix>}. 240 | \end{enumerate} 241 | \begin{minted}{tex} 242 | \begin{example}[sub-title][title][box-demo] 243 | This is another example, following up from \autoref{eg:1}. 244 | \end{example} 245 | \end{minted} 246 | \begin{example}[sub-title][title][box-demo] 247 | This is another example, following up from \autoref{eg:1}. 248 | \end{example} 249 | 250 | A decent variety of environments are already defined (see \autoref{table:boxed-envs} and \autoref{table:boxed-envs-maths}). 251 | 252 | \begin{table}[!htb] 253 | \centering 254 | \begin{tabular}{clll} 255 | \toprule 256 | Icon & Environment Name & Title & Label Prefix \\ 257 | \midrule 258 | \renewcommand{\arraystretch}{1.5} 259 | \faAbstractIcon{exampleColor}{\faClipboard} \faAbstractIcon{page}{\faClipboard}[exampleColor!70!page] 260 | & \ttfamily\small example & Example & \ttfamily\small eg:\\ 261 | \faAbstractIcon{criticalColor}{\faTimes} \faAbstractIcon{page}{\faTimes}[criticalColor!70!page] 262 | & \ttfamily\small critical & Critical & \ttfamily\small crit:\\ 263 | \faAbstractIcon{questionColor}{\faQuestion} \faAbstractIcon{page}{\faQuestion}[questionColor!70!page] 264 | & \ttfamily\small question & Question & \ttfamily\small qu:\\ 265 | \faAbstractIcon{informationColor}{\faInfo} \faAbstractIcon{page}{\faInfo}[informationColor!70!page] 266 | & \ttfamily\small info & Information & \ttfamily\small info:\\ 267 | \faAbstractIcon{checkColor}{\faCheck} \faAbstractIcon{page}{\faCheck}[checkColor!70!page] 268 | & \ttfamily\small check & Check & \ttfamily\small check:\\ 269 | \faAbstractIcon{warningColor}{\faExclamation} \faAbstractIcon{page}{\faExclamation}[warningColor!70!page] 270 | & \ttfamily\small warning & Warning & \ttfamily\small warn:\\ 271 | \faAbstractIcon{tipColor}{\faLightbulb} \faAbstractIcon{page}{\faLightbulb}[tipColor!70!page] 272 | & \ttfamily\small tip & Tip & \ttfamily\small tip:\\ 273 | \faAbstractIcon{mathematicalColor}{\bmcBoxMathIcon} \faAbstractIcon{page}{\bmcBoxMathIcon}[mathematicalColor!70!page] 274 | & \small (maths environments) \\ 275 | \bottomrule 276 | \end{tabular} 277 | \caption{Boxed Environments} 278 | \label{table:boxed-envs} 279 | \end{table} 280 | 281 | \begin{table}[!htb] 282 | \centering 283 | \begin{tabular}{ll} 284 | \toprule 285 | Maths Environment & Label Prefix \\ 286 | \midrule 287 | \ttfamily\small proof & \ttfamily\small prf: \\ 288 | \ttfamily\small theorem & \ttfamily\small thr: \\ 289 | \ttfamily\small lemma & \ttfamily\small lem: \\ 290 | \ttfamily\small corollary & \ttfamily\small cor: \\ 291 | \ttfamily\small definition & \ttfamily\small def: \\ 292 | \ttfamily\small axiom & \ttfamily\small axi: \\ 293 | \ttfamily\small proposition & \ttfamily\small prop: \\ 294 | \bottomrule 295 | \end{tabular} 296 | \caption{Boxed Mathematics Environments} 297 | \label{table:boxed-envs-maths} 298 | \end{table} 299 | 300 | In addition to those provided, you can also define your own using the same 301 | helper function: 302 | \begin{minted}{tex} 303 | \newBmcBox{<env name>}{<colour>}{<title name>}[<reference prefix>][<icon>] 304 | \end{minted} 305 | 306 | 307 | \section{Colour} 308 | \subsection{Theme Colours} 309 | \newcommand{\colorBox}[2][page]{\begin{tikzpicture} 310 | \fill [#2] (0, 0) rectangle (2, 1); 311 | \node[text width=2] at (0.2,0.2) {\tiny\color{#1} \textsf{#2}}; 312 | \end{tikzpicture}} 313 | 314 | This class makes use of the following defined colours. 315 | 316 | \begin{center} 317 | \colorBox{primary}\colorBox{secondary}\colorBox{tertiary}\colorBox{quaternary} 318 | \quad 319 | \colorBox{alternativePrimary}\colorBox{primaryVariant}\colorBox[text]{contrastColour} 320 | \end{center} 321 | 322 | Modifying these colours in the preamble affects the entire document. 323 | 324 | \subsection{Colour Palette} 325 | While \mintinline{tex}{xcolor} does already come with some `nice' 326 | shades, nice colour themes may be found at \url{https://flatuicolors.com}. 327 | These shades do not use the pretentious names listed, we just call them what they are 328 | (e.g.\ nephritis \(*\to \) green). Instead of overwriting the pre-existing colour, these colours 329 | have been differentiated by capitalisation, i.e.\ `Green' instead of `green'. 330 | The default colour palette is shown below, however you can easily switch to another 331 | --- see \fullref{subsec:palettes} for more information. 332 | 333 | \begin{multicols}{2} 334 | \centering 335 | \colorBox{Grey} \qquad \colorBox{LightGrey} \colorBox{DarkGrey} \\[-0.7mm] 336 | \colorBox{Red} \qquad \colorBox{LightRed} \colorBox{DarkRed} \\[-0.7mm] 337 | \colorBox{Yellow} \qquad \colorBox{LightYellow} \colorBox{DarkYellow} \\[-0.7mm] 338 | \colorBox{Blue} \qquad \colorBox{LightBlue} \colorBox{DarkBlue} \\[-0.7mm] 339 | \colorBox{Green} \qquad \colorBox{LightGreen} \colorBox{DarkGreen} \\[-0.7mm] 340 | \colorBox{Orange} \qquad \colorBox{LightOrange} \colorBox{DarkOrange} \\[-0.7mm] 341 | \colorBox{Purple} \qquad \colorBox{LightPurple} \colorBox{DarkPurple} \\[-0.7mm] 342 | \colorBox{Cyan} \qquad \colorBox{LightCyan} \colorBox{DarkCyan} 343 | \end{multicols} 344 | 345 | It's important to note that the palette only affects these named colours, and 346 | that the primary, secondary, etc.\ colours are not affected. 347 | 348 | \subsection{Functional Colours} 349 | This package has a few special colours that describe a particular aspect of a document, 350 | such as \verb|href| and \verb|inlinemath|. For more information see \fullref{subsec:config-colours}. 351 | 352 | \section{Mathematics} 353 | 354 | This class makes a few additions, and one or two modifications to Mathematics. 355 | 356 | \paragraph{Demo} 357 | \[ 358 | \frac{1}{2\pi i} \int\limits_\gamma f\Bigl(x^{\mathbf{N}\in\mathbb{C}^{N\times 10}}\Bigr) 359 | = \sum_{k=1}^m n(\gamma;a_k) \operatorname{Res} (f;a_k)\,. 360 | \] 361 | \[ 362 | \iiiint\limits_{Q}f(w,x,y,z) \dd w \dd x \dd y \dd z 363 | \leq 364 | \oint_{\partial Q} f'\Biggl(\max\Biggl\{ 365 | \frac{\Vert w\Vert}{\vert w^2+x^2\vert}; 366 | \frac{\Vert z\Vert}{\vert y^2+z^2\vert}; 367 | \frac{\Vert w\oplus z\Vert}{\vert x\oplus y\vert} 368 | \Biggr\}\Biggr)\,. 369 | \] 370 | 371 | \subsection{Modifications} 372 | 373 | \paragraph{Less/greater than or equal} 374 | The less than or equal, and greater than or equal symbols are changed as such: 375 | \vspace{-6pt} 376 | \begin{center} 377 | \parbox{0cm}{ 378 | \begin{tabbing} 379 | \(*\leq \) \quad \= new\quad \= \(*\geq \) \kill 380 | \(*\oldleq \) \> old \> \(*\oldgeq \) \\ 381 | \(*\leq \) \> new \> \(*\geq \) 382 | \end{tabbing}} 383 | \end{center} 384 | 385 | \paragraph{Inline math colour} 386 | After interspersing maths and text a fair bit I've begun to think there's some 387 | merit to the Beamer `make all maths a different colour' approach. 388 | So I've redefined the LaTeX inline maths command such that 389 | \mintinline{tex}{\(a^x + bx + c\)} now becomes \(ax^2 + bx + c\). 390 | Avoiding this is easy, just change the colour of \mintinline{tex}{inlinemath} 391 | in the preamble like so \mintinline{tex}{\colorlet{inlinemath}{text}} 392 | and you won't notice this exists. 393 | For once-offs I've defined a stared variant \mintinline{tex}{\(* a^x + bx + c\)} 394 | which produces the normal \(*ax^2 + bx + c\). 395 | 396 | \begin{minted}[firstnumber=296]{tex} 397 | \renewrobustcmd{\(}{\@ifstar\@inlinemath\@@inlinemath} 398 | \DeclareRobustCommand{\@inlinemath}{\relax\ifmmode\@badmath\else$\fi} 399 | \DeclareRobustCommand{\@@inlinemath}{\relax\ifmmode\@badmath\else$\fi\color{inlinemath}} 400 | \end{minted} 401 | 402 | \paragraph{Matrix environment} 403 | The default for matrices (using \mintinline{tex}{\begin{bmatrix}} or similar) 404 | is left aligned values, with no option to change this. 405 | This class adds an optional parameter to change the alignment, 406 | (\mintinline{tex}{\begin{bmatrix}[r]}), and defaults to right aligned. 407 | 408 | \begin{multicols}{2} 409 | \subparagraph{Old} 410 | \[ 411 | \begin{bmatrix}[l] 412 | 3 & -2 \\ 413 | -1 & 7 \\ 414 | \end{bmatrix} 415 | \] 416 | 417 | \columnbreak 418 | 419 | \subparagraph{New} 420 | \[ 421 | \begin{bmatrix} 422 | 3 & -2 \\ 423 | -1 & 7 \\ 424 | \end{bmatrix} 425 | \] 426 | \end{multicols} 427 | 428 | \subsection{Additions} 429 | 430 | \paragraph{\rlap{Deliminators}\hspace*{8em}} 431 | \begin{tabular}{p{4.2em}>{\(*\to\quad \)}p{4em}} 432 | \mintinline{tex}{\abs{x}} & \(*\abs{x} \) \\ 433 | \mintinline{tex}{\norm{x}} & \(*\norm{x}\) \\ 434 | \mintinline{tex}{\ceil{x}} & \(*\ceil{x}\) \\ 435 | \mintinline{tex}{\floor{x}} & \(*\floor{x}\) \\ 436 | \mintinline{tex}{\round{x}} & \(*\round{x}\) \\ 437 | \end{tabular} 438 | 439 | \footnotetext[2]{Can also be used outside of maths mode.\label{fn:1}} 440 | \paragraph{\rlap{Sets\textsuperscript{\rmfamily\mbox{\ref{fn:1}}}}\hspace*{8em}} 441 | \begin{tabular}{p{4.2em}>{\(*\to\quad \)}p{4em}p{4em}>{\(*\to\quad \)}p{4em}} % chktex 21 442 | \mintinline{tex}{\RR} & \RR & \mintinline{tex}{\RR[n]} & \RR[n] \\ 443 | \mintinline{tex}{\NN} & \NN & \mintinline{tex}{\NN[n]} & \NN[n] \\ 444 | \mintinline{tex}{\ZZ} & \ZZ & \mintinline{tex}{\ZZ[n]} & \ZZ[n] \\ 445 | \mintinline{tex}{\QQ} & \QQ & \mintinline{tex}{\QQ[n]} & \QQ[n] \\ 446 | \mintinline{tex}{\CC}& \CC & \mintinline{tex}{\CC[n]} & \CC[n] \\ 447 | \mintinline{tex}{\PP} & \PP & \mintinline{tex}{\PP[n]} & \PP[n] \\ 448 | \mintinline{tex}{\HH} & \HH & \mintinline{tex}{\HH[n]} & \HH[n] \\ 449 | \end{tabular} 450 | 451 | \paragraph{\rlap{Differentials\textsuperscript{\rmfamily\mbox{\ref{fn:1}}}}\hspace*{8em}} 452 | \begin{tabular}{p{4.2em}>{\(*\to\quad \)}p{4em}} 453 | \mintinline{tex}{\dd} & \(*\dd \) \\ % chktex 21 454 | \mintinline{tex}{\dv{t}{y}} & \(*\dv{t} \) \\[2pt] 455 | \mintinline{tex}{\dv{x}{y}} & \(*\dv{x}{y} \) \\ 456 | \mintinline{tex}{\pdv{f}{x}} & \(*\pdv{f}{x} \) 457 | \end{tabular} 458 | 459 | \paragraph{\rlap{Stats Operators}\hspace*{8em}} 460 | \begin{tabular}{p{4.2em}>{\(*\to\quad \)}p{4em}} 461 | \mintinline{tex}{\Var} & \(*\Var \) \\ 462 | \mintinline{tex}{\Cov} & \(*\Cov \) \\ 463 | \mintinline{tex}{\E} & \(*\E \) 464 | \end{tabular} 465 | 466 | \paragraph{\rlap{Others}\hspace*{8em}} 467 | \begin{tabular}{p{4.2em}>{\(*\to\quad \)}p{4em}} 468 | \mintinline{tex}{\qed}\footref{fn:1} & \(*\qed \) \\ 469 | \mintinline{tex}{\qedhere}\footref{fn:1} & \(*\qedhere \) \\ 470 | \mintinline{tex}{\Lap} & \(*\Lap \) 471 | \end{tabular} 472 | 473 | \subsection{Plotting} 474 | 475 | Plot are nice, hence some effort has been put into making them look nice. 476 | 477 | \begin{minted}{tex} 478 | \begin{tikzpicture} 479 | \begin{axis}[domain=0:pi] 480 | \addplot+{x^2/8}; 481 | \addplot+{(x-1)/(x+1)}; 482 | \addplot+{sin(deg(x))}; 483 | \addplot+{cos(deg(x))}; 484 | \pgfplotsinvokeforeach{2,...,5}{ 485 | \addplot+{1/#1*sin(#1*deg(x))};} 486 | \end{axis} 487 | \end{tikzpicture} 488 | \end{minted} 489 | \begin{center} 490 | \begin{tikzpicture} 491 | \begin{axis}[domain=0:pi] 492 | \addplot+{x^2/8}; 493 | \addplot+{(x-1)/(x+1)}; 494 | \addplot+{sin(deg(x))}; 495 | \addplot+{cos(deg(x))}; 496 | \pgfplotsinvokeforeach{2,...,5}{ 497 | \addplot+{1/#1*sin(#1*deg(x))};} 498 | \end{axis} 499 | \end{tikzpicture} 500 | \end{center} 501 | 502 | \paragraph{Asymptopes} 503 | A notable addition made is some nice asymptote-related pgf keys that have been added. 504 | There are three relevant keys 505 | \begin{itemize} 506 | \item[] \mintinline{tex}{v asym} locations(s) of vertical asymptotes 507 | \item[] \mintinline{tex}{h asym} locations(s) of horizontal asymptotes 508 | \item[] \mintinline{tex}{asym gap} distance around vertical asymptote which is cleared 509 | \end{itemize} 510 | 511 | \begin{minipage}{\linewidth} 512 | \begin{minted}{tex} 513 | \begin{tikzpicture} 514 | \begin{axis}[domain=0:3,small] 515 | \addplot+[asym gap=0.05,v asym={0.5,1.5,2.5}]{tan(deg(pi*x))}; 516 | \end{axis} 517 | \end{tikzpicture} 518 | \begin{tikzpicture} 519 | \begin{axis}[domain=-1:3,small] 520 | \addplot+[asym gap=0.1,v asym=1,h asym=5]{1/(x-1)+5}; 521 | \end{axis} 522 | \end{tikzpicture} 523 | \end{minted} 524 | \begin{center} 525 | \begin{tikzpicture} 526 | \begin{axis}[domain=0:3,small] 527 | \addplot+[asym gap=0.05,v asym={0.5,1.5,2.5}]{tan(deg(pi*x))}; 528 | \end{axis} 529 | \end{tikzpicture} 530 | \begin{tikzpicture} 531 | \begin{axis}[domain=-1:3,small] 532 | \addplot+[asym gap=0.1,v asym=1,h asym=5]{1/(x-1)+5}; 533 | \end{axis} 534 | \end{tikzpicture} 535 | \end{center} 536 | \end{minipage} 537 | 538 | \section{Code} 539 | 540 | This package spends a few lines tweaking 541 | the minted and tcolorbox config to get code 542 | blocks to look rather nice. 543 | 544 | For example: 545 | \begin{minted}[escapeinside=||,highlightlines={8,17}]{tex} 546 | \section{Code} 547 | 548 | This package spends a few lines tweaking 549 | the minted and tcolorbox config to get code 550 | blocks to look rather nice. 551 | 552 | For example: 553 | \begin{minted}[escapeinside=||,highlightlines={8,17}]{tex} 554 | \section{Code} 555 | 556 | This package spends a few lines tweaking 557 | the minted and tcolorbox config to get code 558 | blocks to look rather nice. 559 | 560 | For example: 561 | |\dots| 562 | \end||{minted} 563 | \end{minted} 564 | 565 | \section{Chemistry} 566 | When the \mintinline{tex}{chem} option is used, \mintinline{tex}{mhchem} 567 | is loaded with the configuration, however \mintinline{tex}{chemfig} 568 | undergoes a few modifications to make the results look cleaner. 569 | 570 | \begin{center} 571 | \chemfig{*6(-=-(-COOH)=-=)} 572 | \chemfig{X-[1]=^[-1]-[1]-[-1]-[1]-[-1]=^[1]-[-1]} 573 | \qquad 574 | \chemfig{-[1](=[3]O)-[-1]} 575 | \end{center} 576 | 577 | \begin{minted}[firstnumber=310]{tex} 578 | \setchemfig{ 579 | chemfig style={line width=0.06642 em}, % 'Line Width' 580 | angle increment=30, 581 | double bond sep=0.35700 em, % 'Bond Spacing' 582 | atom sep=1.78500 em, % 'Fixed Length' 583 | bond offset=0.18265 em % 'Margin Width' 584 | } 585 | \renewcommand*\printatom[1]{\small\ensuremath{\mathsf{#1}}} 586 | \end{minted} 587 | 588 | We also grabbed some nice code for a custom arrow type \mintinline{tex}{X} 589 | from a stackexchange answer so now we can do this: 590 | \begin{minted}{tex} 591 | \schemestart 592 | A 593 | \arrow{-X>[1][2][3][4][5][6]} 594 | B 595 | \schemestop 596 | \end{minted} 597 | \begin{center} 598 | \schemestart 599 | A \arrow{-X>[1][2][3][4][5][6]} B 600 | \schemestop 601 | \end{center} 602 | 603 | \section{Links and Metadata} 604 | \renewcommand{\ULthickness}{1pt} 605 | \def\soutt{\bgroup \ULdepth=-.45ex \ULset} 606 | Both the \mintinline{tex}{hyperref} and \mintinline{tex}{hyperxmp} packages are used. 607 | The widely used hyperref package of course provides hyperlinks. 608 | This is \soutt{ab}used to add a few extra links; specifically 609 | every page number is a link to the TOC, and the text of every header 610 | links to the relevant chapter page. 611 | This allows you to jump all over the document in just a few clicks. 612 | 613 | The hyperxmp package is rather handy for setting a few fields of pdf metadata. 614 | Using the \mintinline{tex}{\title}, \mintinline{tex}{\author}, and \mintinline{tex}{\subtitle} 615 | attributes it sets the relevant metadata fields. 616 | 617 | \chapter{Boring Info} 618 | 619 | \section{Implementation} 620 | 621 | While originally one giant class file, each major component has now been split off 622 | into a \mintinline{tex}{.sty} file that can also operate as a standalone package. 623 | Currently, the following packages exist: 624 | \begin{multicols}{2} 625 | \begin{itemize} 626 | \item bmc-boxes 627 | \item bmc-color 628 | \item bmc-fonts 629 | \item bmc-maths 630 | \item bmx-ref 631 | \item bmc-sectioning 632 | \end{itemize} 633 | \end{multicols} 634 | 635 | \section{Class Options} 636 | 637 | This class builds off \mintinline{tex}{scrartcl}, 638 | any other options than those listed here will just be passed through. 639 | 640 | \subsection{Main Styling} 641 | 642 | \paragraph{\ttfamily dark} 643 | Switches to a dark version of the style 644 | \paragraph{\ttfamily solid} 645 | Uses style with solid title page, and wide stripes on chapter pages, with solid colour bar at top of pages 646 | \paragraph{\ttfamily stripe} 647 | Uses plain background on title page, and thin stripes on chapter pages 648 | \paragraph{\ttfamily article} 649 | Use \mintinline{tex}{scrartcl} class instead of \mintinline{tex}{scrrept} 650 | \paragraph{\ttfamily notes} 651 | Move the margins to make room for notes 652 | 653 | \subsection{Fonts} 654 | \paragraph{Body Text} 655 | Use \mintinline{tex}{[body=<variant>]}, where variant is one of \mintinline{tex}{serif}, \mintinline{tex}{sans}, or \mintinline{tex}{mono}. 656 | \\The default is \mintinline{tex}{serif}. 657 | 658 | \paragraph{Math} 659 | Use \mintinline{tex}{[math=<variant>]}, where variant is one of \mintinline{tex}{serif}, \mintinline{tex}{sans}, or \mintinline{tex}{mono}. 660 | \\The default is \mintinline{tex}{serif}. 661 | 662 | \subsection{Headings} 663 | 664 | These options set the style of the following components 665 | \begin{itemize} 666 | \item \mintinline{tex}{\chapter} through to \mintinline{tex}{\subparagraph} 667 | \item The page head, and page number 668 | \item Caption labels 669 | \end{itemize} 670 | 671 | Use \mintinline{tex}{[headings=<variant>]}, where variant is one of \mintinline{tex}{serif}, \mintinline{tex}{sans}, or \mintinline{tex}{mono}. 672 | \\The default is \mintinline{tex}{sans}. 673 | 674 | \subsection{Package Related} 675 | 676 | \paragraph{\ttfamily chem} 677 | Load and configure \mintinline{tex}{mhchem} and \mintinline{tex}{chemfig} packages 678 | 679 | \paragraph{\ttfamily code} 680 | Load and configure minted package 681 | 682 | \paragraph{\ttfamily plot} 683 | Load and configure \mintinline{tex}{pgfplots} package 684 | 685 | \paragraph{\ttfamily math} 686 | Load and configure some mathematical packages, and set font to match main text font (also see \mintinline{tex}{math-serif} etc.) 687 | 688 | \newpage 689 | \section{Packages Used} 690 | 691 | \subsection{Overview} 692 | 693 | \begin{table}[!htb] 694 | \centering 695 | \small 696 | \setlength{\tabcolsep}{0pt} 697 | \renewcommand{\arraystretch}{1.3} 698 | \begin{tabular}{>{\hspace{3pt}\normalsize}l>{\hspace{5pt}}*{5}{p{7.9em}}l} 699 | \toprule 700 | Category & \multicolumn{5}{l}{\normalsize Packages} \\ 701 | \midrule 702 | General & \hyperref[par:etoolbox]{etoolbox} & \hyperref[par:xpatch]{xpatch} & \hyperref[par:Silence]{Silence} & \hyperref[par:ifdraft]{ifdraft} & \hyperref[par:geometry]{geometry} \\ 703 | & \hyperref[par:titlesec]{titlesec} & \hyperref[par:titletoc]{titletoc} & \hyperref[par:framed]{framed} & \hyperref[par:textpos]{textpos} & \hyperref[par:calc]{calc} \\ 704 | & \hyperref[par:xcolor]{xcolor} & \hyperref[par:tikz]{tikz} & \hyperref[par:hyperref]{hyperref} & \hyperref[par:hyperxmp]{hyperxmp} & \hyperref[par:scrlayer-scrpage]{scrlayer-scrpage} \\ 705 | Text & \hyperref[par:microtype]{microtype} & \hyperref[par:setspace]{setspace} & \hyperref[par:plex-serif]{plex-serif} & \hyperref[par:plex-sans]{plex-sans} & \hyperref[par:plex-mono]{plex-mono} \\[4pt] 706 | & \hyperref[par:multicol]{multicol} & \\ 707 | Table & \hyperref[par:booktabs]{booktabs} & \hyperref[par:tabularx]{tabularx} & \hyperref[par:longtable]{longtable} \\[4pt] 708 | Graphics & \hyperref[par:graphicx]{graphicx} & \hyperref[par:grffile]{grffile} & \hyperref[par:subcaption]{subcaption} & \hyperref[par:caption]{caption} \\[4pt] 709 | infoBulle & \hyperref[par:infoBulle]{infoBulle} & \hyperref[par:marginInfoBulle]{marginInfoBulle} & \hyperref[par:fontawesome5]{fontawesome5}\\[4pt] 710 | Chemistry & \hyperref[par:mhchem]{mhchem} & \hyperref[par:chemfig]{chemfig} \\[4pt] 711 | Code & \hyperref[par:minted]{minted} & \hyperref[par:tcolorbox]{tcolorbox} \\[4pt] 712 | Maths & \hyperref[par:amssymb]{amsmath} & \hyperref[par:amssymb]{amssymb} & \hyperref[par:mathdesign]{mathdesign} & \hyperref[par:xfrac]{xfrac} & \hyperref[par:cancel]{cancel} \\[4pt] 713 | & \hyperref[par:mathtools]{mathtools} & \hyperref[par:mathastext]{mathastext} & \hyperref[par:pgfplots]{pgfplots} \\ 714 | \bottomrule 715 | \end{tabular} 716 | \caption{All Packages Used by This Class} 717 | \label{table:all-packages} 718 | \end{table} 719 | 720 | \subsection{General Packages} 721 | 722 | \paragraph{\ttfamily etoolbox}\label{par:etoolbox} 723 | Provides LaTeX frontends to some of the new primitives provided by e-TeX 724 | as well as some rather useful some generic tools --- namely, 725 | \begin{itemize} 726 | \item Robust definitions 727 | \item Command Patching 728 | \item Command Protection 729 | \item Arithmetic counters and lengths 730 | \item Document Hooks 731 | \item Environment Hooks 732 | \end{itemize} 733 | \paragraph{\ttfamily xpatch}\label{par:xpatch} 734 | Extends the command patching provided by \hyperref[par:etoolbox]{etoolbox} 735 | \paragraph{\ttfamily Silence}\label{par:Silence} 736 | Allows me to ignore expected warnings. 737 | \paragraph{\ttfamily ifdraft}\label{par:ifdraft} 738 | To make it easy to change things up a bit more than usual for draft mode. 739 | \paragraph{\ttfamily scrlayer-scrpage}\label{par:scrlayer-scrpage} 740 | To allow for those lovely headers and footers. 741 | \paragraph{\ttfamily geometry}\label{par:geometry} 742 | Loaded with options, 743 | \begin{minted}[firstnumber=452]{tex} 744 | a4paper, ignoreheadfoot, left=\leftmargin, right=\rightmargin, top=2cm, bottom=3.5cm, headsep=1cm 745 | \end{minted} 746 | \paragraph{\ttfamily titlesec}\label{par:titlesec} 747 | Allows for customisation of \mintinline{tex}{\chapter} etc. 748 | Was originally used for all section commands, but now all except for 749 | \mintinline{tex}{\chapter} have been transitioned to \acr{KOMA}-script. 750 | \paragraph{\ttfamily titletoc}\label{par:titletoc} 751 | Allows significant tweaking to how the table of contents looks. 752 | \paragraph{\ttfamily framed}\label{par:framed} 753 | Facilitate the definition of new environments that take multi-line material, wrap it with some 754 | non-breakable formatting (some kind of box or decoration) and allow page breaks in the material 755 | \paragraph{\ttfamily textpos}\label{par:textpos} 756 | Facilitates placement of boxes at absolute positions on the LaTeX page. 757 | Loaded with options \mintinline{tex}{absolute,overlay} 758 | \paragraph{\ttfamily hyperref}\label{par:hyperref} 759 | Used to produce all sorts of hyperlinks in a document. 760 | Loaded with option \mintinline{tex}{pdfa} 761 | \paragraph{\ttfamily hyperxmp}\label{par:hyperxmp} 762 | Improves metadata setting with hyperref. 763 | \paragraph{\ttfamily calc}\label{par:calc} 764 | Adds infix expressions to perform arithmetic on the arguments of the LaTeX commands 765 | \mintinline{tex}{\setcounter}, \mintinline{tex}{\addtocounter}, \mintinline{tex}{\setlength}, and \mintinline{tex}{\addtolength} 766 | \paragraph{\ttfamily xcolor}\label{par:xcolor} 767 | Provides all sorts of colour use and mixing capabilities. 768 | \paragraph{\ttfamily tikz}\label{par:tikz} 769 | It's tikz. You can't draw anything without it. 770 | 771 | \subsection{Text} 772 | 773 | \paragraph{\ttfamily microtype}\label{par:microtype} 774 | Always good to have. It simply makes text look better, specificity it applies the following, 775 | \begin{itemize} 776 | \item Character protrusion 777 | \item Font expansion 778 | \item Adjustment of interword spacing and kerning 779 | \item Letterspacing 780 | \end{itemize} 781 | Configured with, 782 | \begin{minted}[firstnumber=67]{tex} 783 | activate={true,nocompatibility}, final, tracking=true, kerning=true, spacing=true, factor=2000 784 | \end{minted} 785 | \paragraph{\ttfamily plex-serif}\label{par:plex-serif} 786 | \paragraph{\ttfamily plex-sans}\label{par:plex-sans} 787 | \paragraph{\ttfamily plex-mono}\label{par:plex-mono} 788 | \paragraph{\ttfamily setspace}\label{par:setspace} 789 | Provides an easy way to set line spacing with commands such as 790 | \mintinline{tex}{\doublespacing} and \mintinline{tex}{\setstretch{1.25}}. 791 | \paragraph{\ttfamily multicol}\label{par:multicol} 792 | Split text into multiple columns (up to 10). 793 | 794 | \subsection{Table-related} 795 | 796 | \paragraph{\ttfamily booktabs}\label{par:booktabs} 797 | Contributes different width \mintinline{tex}{\hline} variants. 798 | \paragraph{\ttfamily tabularx}\label{par:tabularx} 799 | Adds the \mintinline{tex}{tabularx} environment which has its width explicitly set, 800 | \mintinline{tex}{X} column type which automatically determines its width based on its contents. 801 | \paragraph{\ttfamily longtable}\label{par:longtable} 802 | Provides a good way of allowing tables to spread over multiple pages. 803 | 804 | \subsection{Graphics and Figures} 805 | 806 | \paragraph{\ttfamily graphicx}\label{par:graphicx} 807 | Makes loading images (\mintinline{tex}{includegraphics}) work well. 808 | \paragraph{\ttfamily grffile}\label{par:grffile} 809 | This fixes the fix allowed filenames of graphicx. 810 | \paragraph{\ttfamily caption}\label{par:caption} 811 | Provides many ways to customise the captions in floating environments like figure and table, 812 | and cooperates with many other packages. 813 | Facilities include rotating captions, sideways captions, continued captions (for tables or figures that come in several parts). 814 | Loaded with option \mintinline{tex}{hypcap=true} 815 | \paragraph{\ttfamily subcaption}\label{par:subcaption} 816 | Allows for typesetting of sub-figures and sub-tables. 817 | 818 | \subsection{infoBulle} 819 | 820 | \paragraph{\ttfamily fontawesome5}\label{par:fontawesome5} 821 | Fontawesome 5, need I say any more? 822 | \paragraph{\ttfamily infoBulle}\label{par:infoBulle} 823 | \paragraph{\ttfamily marginInfoBulle}\label{par:marginInfoBulle} 824 | 825 | \subsection{Chemistry} 826 | 827 | \paragraph{\ttfamily mhchem}\label{par:mhchem} 828 | Useful for simple inline chemistry. 829 | \paragraph{\ttfamily chemfig}\label{par:chemfig} 830 | Useful for chemical diagrams. 831 | 832 | \subsection{Code} 833 | 834 | \paragraph{\ttfamily minted}\label{par:minted} 835 | Configured as follows, 836 | \begin{minted}[firstnumber=476]{tex} 837 | \setminted{ 838 | frame=none, 839 | % framesep=2mm, 840 | baselinestretch=1.2, 841 | fontsize=\footnotesize, 842 | highlightcolor=page!95!text!80!primary, 843 | linenos, 844 | breakanywhere=true, 845 | breakautoindent=true, 846 | breaklines=true, 847 | tabsize=4, 848 | xleftmargin=3.5em, 849 | autogobble=true, 850 | obeytabs=true, 851 | python3=true, 852 | % texcomments=true, 853 | framesep=2mm, 854 | breakbefore=\\\.+, 855 | breakafter=\, 856 | } 857 | \end{minted} 858 | 859 | \paragraph{\ttfamily tcolorbox}\label{par:tcolorbox} 860 | Used for prettifying the \mintinline{tex}{minted} environment. 861 | Loaded with option \mintinline{tex}{many} 862 | 863 | \subsection{Maths Related} 864 | These packages are loaded by the \mintinline{tex}{math} 865 | option (or one of its derivatives). 866 | 867 | \paragraph{\ttfamily amsmath,amssymb}\label{par:amssymb} 868 | Extends the maths commands and symbols in latex. 869 | \paragraph{\ttfamily mathdesign}\label{par:mathdesign} 870 | To use the Utopia font for maths symbols. 871 | \paragraph{\ttfamily xfrac}\label{par:xfrac} 872 | Allows split level fractions \(*\sfrac{a}{b}\) better than \mintinline{tex}{{}^{a}/{}_{b}} can produce. 873 | \paragraph{\ttfamily cancel}\label{par:cancel} 874 | Allows for easy cancelling within maths like so --- 875 | \(*\cancel{\eta}\) and \(*\cancelto{0}{\eta}\). 876 | Loaded with option \mintinline{tex}{makeroom} 877 | \paragraph{\ttfamily mathtools}\label{par:mathtools} 878 | Provides a variety of enhancements to make maths \emph{even} better. 879 | \begin{itemize} 880 | \item Extensible symbols, such as brackets, arrows, harpoons, etc.; 881 | \item Various symbols such as \mintinline{tex}{\coloneqq} (\(*\coloneqq\)); 882 | \item Easy creation of new tag forms; 883 | \item Showing equation numbers only for referenced equations; 884 | \item Extensible arrows, harpoons and hookarrows; 885 | \item Starred versions of the amsmath matrix environments for specifying the column alignment; 886 | \item More building blocks: multilined, cases-like environments, new gathered environments; 887 | \item Maths versions of \mintinline{tex}{\makebox}, \mintinline{tex}{\llap}, \mintinline{tex}{\rlap} etc.; 888 | \item Cramped maths styles; and more\dots 889 | \end{itemize} 890 | \paragraph{\ttfamily mathastext}\label{par:mathastext} 891 | Uses relevant plex font for maths letters. 892 | Uses options \mintinline{tex}{basic,italic,symbolgreek}. 893 | 894 | \paragraph{\ttfamily pgfplots}\label{par:pgfplots} 895 | Loaded by the \mintinline{tex}{plot} option. 896 | 897 | \section{Configuration} 898 | 899 | \subsection{Colours} 900 | \label{subsec:config-colours} 901 | \clearrow 902 | \begin{longtable}{l>{\rowmac}p{10em}>{\rowmac}p{10em}} 903 | \toprule 904 | Name & Default (Light) & Default (Dark) \\ 905 | \midrule 906 | \endfirsthead 907 | \toprule 908 | \setrow{\scriptsize} Name & Default (Light) & Default (Dark) \clearrow \\ 909 | \midrule 910 | \multicolumn{1}{c}{\scriptsize\vdots} & \multicolumn{1}{c}{\scriptsize\vdots} & \multicolumn{1}{c}{\scriptsize\vdots} \\ 911 | \endhead 912 | \multicolumn{1}{c}{\scriptsize\vdots} & \multicolumn{1}{c}{\scriptsize\vdots} & \multicolumn{1}{c}{\scriptsize\vdots} \\ 913 | % \midrule 914 | \bottomrule 915 | \endfoot 916 | \bottomrule 917 | \endlastfoot 918 | \mintinline{tex}{text} & \#000000 & \#FCFCFC \\ 919 | \mintinline{tex}{page} & \#FFFFFF & \#222222 \\ 920 | \mintinline{tex}{href} & tertiary & secondary \\ 921 | \mintinline{tex}{primaryVariant} & primary\linebreak[0]!75!Cream\linebreak[0]>twheel,-3,360 & \ditto \\ 922 | \mintinline{tex}{inlinemath} & secondary\linebreak[0]!50!text & tertiary\linebreak[0]!50!text \\ 923 | \rowcolor{tableheadcolor} 924 | \multicolumn{2}{l}{\fontseries{l}\selectfont infoBulle} & \\ 925 | \hiderowcolors 926 | \mintinline{tex}{infoBulleBackground} & page!90!text & \ditto \\ 927 | \mintinline{tex}{infoBulleText} & text & \ditto \\ 928 | \mintinline{tex}{marginInfoBulleBackground} & page & \ditto \\ 929 | \mintinline{tex}{marginInfoBulleText} & text & \ditto \\ 930 | \mintinline{tex}{criticalColor} & Red & \ditto \\ 931 | \mintinline{tex}{questionColor} & Purple & \ditto \\ 932 | \mintinline{tex}{informationColor} & Green & \ditto \\ 933 | \mintinline{tex}{checkColor} & Blue & \ditto \\ 934 | \mintinline{tex}{warningColor} & Orange & \ditto \\ 935 | \mintinline{tex}{tipColor} & Purple & \ditto \\ 936 | \mintinline{tex}{exampleColor} & Blue & \ditto \\ 937 | \mintinline{tex}{mathematicalColor} & Orange & \ditto \\ 938 | \mintinline{tex}{codeColor} & Grey & \ditto \\ 939 | \end{longtable} 940 | 941 | \subsection{Palettes} 942 | \label{subsec:palettes} 943 | The module \mintinline{tex}{bmc-color} has a few inbuilt pallets 944 | sourced from \url{https://flatuicolors.com}. 945 | Using the relevant country code (see website) you can select a palette two ways: 946 | \begin{enumerate} 947 | \item Passing the palette as an option when loading, \mintinline{tex}{[palette=<palette code>]} 948 | \item Setting the palette via \mintinline{tex}{\usepalette{<palette code>}} 949 | \end{enumerate} 950 | The second method can be employed anywhere in the document. 951 | 952 | \subsubsection{Creating Your Own Palette} 953 | 954 | Palettes can be created with the command \mintinline{tex}{\newpalette{<palette code>}{<colour definitions>}}. 955 | The `colour definitions' simply consist of any \mintinline{tex}{xcolor} commands that define the colour. 956 | You may wonder why not just define your own macro for your colours --- 957 | this method provides two minor features that may prove useful depending on the situation. 958 | \begin{itemize} 959 | \item `Main' colours (e.g.\ Red, Green\dots) not provided are populated from a default (\texttt{de}) 960 | \item `Derived' colours (e.g.\ LightRed, DarkGreen) are mixed from main colours if not given 961 | \end{itemize} 962 | It is a good idea to provide colours from the following list, however you can provide as many or as few 963 | colours as you like. 964 | 965 | \begin{center} 966 | % \em 967 | \fontseries{tx}\selectfont 968 | \textcolor{Black!50!text}{Black}, 969 | \textcolor{White!50!text}{White}, 970 | \textcolor{Cream!50!text}{Cream}, 971 | \textcolor{Grey!50!text}{Grey}, 972 | \textcolor{Red!50!text}{Red}, 973 | \textcolor{Yellow!50!text}{Yellow}, 974 | \textcolor{Blue!50!text}{Blue}, 975 | \textcolor{Green!50!text}{Green}, 976 | \textcolor{Orange!50!text}{Orange}, 977 | \textcolor{Purple!50!text}{Purple}, 978 | \textcolor{Cyan!50!text}{Cyan}. 979 | \\[0.5ex] 980 | \fontseries{l}\selectfont 981 | \upshape\scriptsize\slshape 982 | Note: All except for Black, White, and Cream have the 983 | accompanying Light and Dark variants. 984 | \end{center} 985 | 986 | \newpage 987 | \subsubsection{Default Pallets} 988 | \newcommand{\colorBoxSmallBW}{\begin{tikzpicture}[baseline=0.6ex,x=2.5em,y=2.5em] 989 | \fill[Black] (0,0) -- (0.15,0.5) -- (0.75,0.5) -- (0.35,0) -- cycle; 990 | \fill[White] (0.35,0) -- (0.75,0.5) -- (1.15,0.5) -- (1,0) -- cycle; 991 | \node[text width=2] at (0.28,0.3) {\tiny\color{White}\textsf{B}}; 992 | \node[text width=2] at (0.75,0.2) {\tiny\color{Black}\textsf{W}}; 993 | \end{tikzpicture}% 994 | \hspace{-0.375em}} 995 | % \newcommand{\triag}{% 996 | % \begin{tikzpicture}[baseline=0.6ex,x=2.5em,y=2.5em] 997 | % \end{tikzpicture}% 998 | % \hspace{-1.5em}} 999 | \newcommand{\colorBoxSmallLD}[2][]{% 1000 | \hspace{-0.75em}% 1001 | \begin{tikzpicture}[baseline=0.6ex,x=2.5em,y=2.5em] 1002 | \fill[White] (-0.75,-0.4) -- (-0.45,0.5) -- (1.15, 0.5) -- (0.8875, -0.4) -- cycle; 1003 | \if1#1\fill[page] (-0.75,-0.4) -- (-0.62,0) -- (-0.12, -0.4) -- cycle;\fi 1004 | \fill [#2] (0, 0) rectangle (1, 0.5); 1005 | \fill[Light#2] (0,0) -- (0.15,0.5)-- (0,0.5) -- (-0.15,0) -- cycle; 1006 | \fill[Dark#2] (1,0.5) -- (0.85,0) -- (1,0) -- (1.15,0.5) -- cycle; 1007 | \node[text width=2,align=center] at (0.2,-0.2) {\tiny\color{#2}\textsf{\fontseries{tx}\selectfont#2}}; 1008 | \end{tikzpicture}} 1009 | 1010 | \newcommand{\colorBoxSmallLDs}[2][]{% 1011 | \begin{tikzpicture}[baseline=0.6ex,x=2.5em,y=2.5em] 1012 | \fill [#2] (0, 0) rectangle (1, 0.5); 1013 | \fill[Light#2] (0,0) -- (0.4,0) -- (0,0.25) -- cycle; 1014 | \fill[Dark#2] (1,0.5) -- (0.6,0.5) -- (1,0.25) -- cycle; 1015 | \node[text width=2,align=center] at (0.2,-0.2) {\tiny\color{#2}\textsf{\fontseries{tx}\selectfont#2}}; 1016 | \end{tikzpicture}} 1017 | 1018 | \newcommand{\demoPalette}[2][]{ 1019 | \vspace{-1.8ex} 1020 | \usepalette{#2} 1021 | \paragraph{\rlap{\texttt{#2}}\hspace*{3em}} 1022 | \colorBoxSmallBW{} 1023 | \colorBoxSmallLD[1]{Grey}% 1024 | % \triag% 1025 | \colorBoxSmallLD{Red}% 1026 | \colorBoxSmallLD{Blue}% 1027 | \colorBoxSmallLD{Green}% 1028 | \colorBoxSmallLD{Yellow}% 1029 | \colorBoxSmallLD{Orange}% 1030 | \colorBoxSmallLD{Purple}% 1031 | \colorBoxSmallLD{Cyan} \\[-1.8ex] 1032 | {\scriptsize\sffamily #1} 1033 | \vspace{-1ex} 1034 | } 1035 | \vspace{2ex} 1036 | \demoPalette[German \fontseries{l}\selectfont (default)]{de} 1037 | \demoPalette[FlatUI]{fui} 1038 | \demoPalette[Australian]{au} 1039 | \demoPalette[American]{us} 1040 | \demoPalette[British]{uk} 1041 | \demoPalette[Canadian]{ca} 1042 | \demoPalette[Chinese]{cn} 1043 | \demoPalette[Dutch]{nl} 1044 | \demoPalette[French]{fr} 1045 | \demoPalette[Indian]{in} 1046 | \demoPalette[Russian]{ru} 1047 | \demoPalette[Spanish]{es} 1048 | \demoPalette[Swedish]{se} 1049 | \demoPalette[Turkish]{tr} 1050 | 1051 | {\color{primary}\rule{\textwidth}{.2mm}} 1052 | 1053 | \demoPalette[Solarized]{sol} 1054 | \demoPalette[Monokai]{mon} 1055 | 1056 | \usepalette{de} 1057 | 1058 | \chapter{Reasoning} 1059 | 1060 | \section{Layout} 1061 | 1062 | 1063 | 1064 | \section{Typefaces} 1065 | \label{sec:why-typefaces} 1066 | 1067 | \subsection{Studies} 1068 | Unfortunately large type studies on \acr{UI}/\acr{UX} and typography 1069 | seem to be exclusive to large companies that care about this 1070 | (e.g.\ microsoft, google, etc.) and don't seem to publish their results. 1071 | So, I just have a quick look at the little that is easy to find. 1072 | 1073 | It has long been known that there is a relationship between the reader's judged 1074 | aesthetic pleasingness of text, and the legibility (\cite{Tinker_Paterson_1942}). 1075 | Regardless of the underlying mechanisms, this provides strong justification for 1076 | putting in the effort to make a document have good content, \emph{and} good aesthetics. 1077 | 1078 | A study by~\cite{kaspar2015matter} presented subjects with research papers in 1079 | serif and sans-serif fonts. They found that sans-serif fonts increase reading speed. 1080 | While this was not a focus of the study, it is apparently in line with previous research. 1081 | A 2005 study by~\cite{Gasser_Boeke_Haffernan_Tan_2005} found that 1082 | sans-serif founts produced 9\% improvement in recall (\(N=149\), \(p=0.05\)). 1083 | 1084 | While~\cite{kaspar2015matter} found that while sans-serif fonts are read faster, 1085 | in every category tested, sans-serif fonts performed better. Specially serifs were 1086 | found to improve: 1087 | \begin{itemize} 1088 | \item Comprehension 1089 | \item Interest in paper and appeal of abstract 1090 | \item Perceived quality and importance 1091 | \end{itemize} 1092 | 1093 | More generally,~\cite{larson2007measuring} identified two measures that 1094 | successfully indicate aesthetic difference. Performance of creative cognitive tasks 1095 | after reading a document, and subconscious activation of the facial muscle 1096 | responsible for frowning. For both measures a method that had \(p=0.04\) was yielded. 1097 | It is rather interesting that they found that improved typography reduced frowning 1098 | and improved creative cognitive task performance. 1099 | 1100 | Semantic associations between the typeface chosen and the content also seem to be 1101 | important. \cite{web_chooserightfont} appears to give a good overview of this. 1102 | 1103 | \subsection{The Elements of Typographic Style} 1104 | While, as demonstrated previously, there are \textit{some} studies about typefaces, 1105 | they are few and far between, done on a small scale, and rarely reproduced. 1106 | Hence, one of the best resources for typographic guidances is eminent publications 1107 | on the matter. \citetitle{Bringhurst_2004} is one of the foremost books, widely held 1108 | in high esteem. Reading through it there a several useful suggestions which I have 1109 | tried to implement here. 1110 | 1111 | \paragraph{Conclusions from \P~3.2.2} 1112 | With some acronyms each letter is pronounced individually (such as the \acr{ISO} 1113 | or \acr{GNU}). To achieve this effect typographically spaced small caps are very 1114 | useful. They are also useful in a variety of other situations, for example: 1115 | \begin{center} 1116 | \acr{WWII} formally ended at 12:00 \acr{AM} on 8 May nineteen forty-five \acr{AD}. \\ 1117 | WWII formally ended at 12:00 AM on 8 May nineteen forty-five AD\@. 1118 | \end{center} 1119 | The general rule given is --- \emph{`For abbreviations and acronyms in the midst of normal 1120 | text, use spaced small caps'}. 1121 | 1122 | \paragraph{Conclusions from \P~4.4.1} 1123 | With regard to tables 1124 | \begin{enumerate} 1125 | \item Avoid shrinking font size 1126 | \item Minimise `furniture' (rules, boxes, dots, etc.) 1127 | \item Rules / tint blocks, when absolutely necessary, should run in the 1128 | reading direction 1129 | \item Rules along the (vertical) outside the table are useless 1130 | \item Ensure sufficient white space is maintained 1131 | \end{enumerate} 1132 | 1133 | \paragraph{Conclusions from \P~4.5.1} 1134 | Short texts, such as research papers generally don't benefit from much padding 1135 | at the start and end. The same does \emph{not} apply to books. 1136 | As such, \gls{bmc} implements two \mintinline{tex}{\maketitle}s. 1137 | The default full page one seen on this document, and a shorter one used when the 1138 | \mintinline{tex}{article} option is passed to the class. 1139 | 1140 | \paragraph{Conclusions from \P~5.1.3} 1141 | Use the ampersand (\&) in heads and titles. 1142 | 1143 | \paragraph{Conclusions from \P~5.1.4} 1144 | Line-end hyphens best lie in the right margin. This is achieved by use of the 1145 | \mintinline{tex}{factor=2000} option with the microtype package. 1146 | 1147 | \section{Colour} 1148 | 1149 | It seems that emotional colour associations are not universal (\cite{Laurence1991}), 1150 | and it seems like much of the clamour about colour psychology which is presented 1151 | authoritatively, really has little factual basis, as covered by~\cite{OConnnor2011}. 1152 | However I mainly care about the western european perspective, which I think is 1153 | the most heavily studied, so we should be alright. 1154 | 1155 | Looking online I saw a lot of self-professed ``colour-gurus'', the first 1156 | respectable-looking page which seemed to provide a nice summary 1157 | (i.e.\ wasn't just red vs.\ green etc.) is~\cite{web_colour} — you may recognise the 1158 | author from the previous section on fonts. 1159 | His page acknowledges complexity in the situation, and cites a bunch of articles, 1160 | which I consider to be a good sign. 1161 | The conclusions were summarised in a table, a copy of which you can find below. 1162 | 1163 | \begin{table}[!htb] 1164 | \newcommand{\high}{\color{Green!70!text}\faChevronUp} 1165 | \newcommand{\low}{\color{Red!70!text}\faChevronDown} 1166 | \newcommand{\yep}{\faCheck} 1167 | \newcommand{\cc}[1]{\hspace{-0.3em}% 1168 | \tikz{\fill[#1,rounded corners] (0,0) rectangle(1.7em,1.1em)}% 1169 | \hspace{-0.3em}} 1170 | \newcommand{\saturation}{\hspace{-0.3em}% 1171 | \tikz{\fill[left color=white!50!black,draw=page,line width=0pt, 1172 | right color=Red,rounded corners] (0,0) rectangle(1.7em,1.1em)}% 1173 | \hspace{-0.3em}} 1174 | \newcommand{\lightness}{\hspace{-0.3em}% 1175 | \tikz{\fill[left color=black,right color=white,draw=page,line width=0pt, 1176 | middle color=Red,rounded corners] (0,0) rectangle(1.7em,1.1em)}% 1177 | \hspace{-0.3em}} 1178 | \centering 1179 | \caption{Colour Associations (from Nick Kolenda)} 1180 | \begin{tabular}{ 1181 | >{\fontseries{mb}\selectfont}l 1182 | l 1183 | >{\color{Red!70!text}}c 1184 | >{\color{Orange!70!text}}c 1185 | >{\color{Yellow!70!text}}c 1186 | >{\color{Green!70!text}}c 1187 | >{\color{Blue!70!text}}c 1188 | >{\color{Purple!70!text}}c 1189 | >{\color{pink!70!text}}c 1190 | >{\color{Brown!70!text}}c 1191 | >{\color{Black!70!text}}c 1192 | >{\color{White!70!text}}c 1193 | cc} 1194 | \toprule 1195 | & & \multicolumn{10}{c}{Hue} & S & L \\ 1196 | & & \cc{Red} & \cc{Orange} & \cc{Yellow} & \cc{Green} 1197 | & \cc{Blue} & \cc{Purple} & \cc{pink} & \cc{Brown} 1198 | & \cc {Black} & \cc{White} & \saturation & \lightness \\ 1199 | \midrule 1200 | Arousal 1201 | & Relaxed & & & & \yep & \yep & \yep & & & & \yep & \high & \low \\ 1202 | & Exited & \yep & \yep & \yep & & & & & & \yep & & \low & \high \\ 1203 | \midrule 1204 | Processing 1205 | & Systematic & & & & \yep & \yep & \yep && & & \yep & \high & \low \\ 1206 | & Heuristic & \yep & \yep & \yep & & & & & & \yep & & \low & \high \\ 1207 | \midrule 1208 | Selling 1209 | & Auction & \yep & \yep & \yep & &&&& & \yep & & \low & \high \\ 1210 | & Negotiation & & & & \yep & \yep & \yep & & & & \yep & \high & \low \\ 1211 | \midrule 1212 | Traits 1213 | & Competence & & & & & \yep & & & & \yep & & & \high \\ 1214 | & Excitement & \yep & \yep & \yep & & & & & & & & \low & \high \\ 1215 | & Ruggedness & & & & \yep & & & & \yep & & & \low & \high \\ 1216 | & Sincerity & & & \yep & & & & \yep & & & \yep & \high & \low \\ 1217 | & Sophistication & & & & & & \yep & & & & \yep & \high & \\ 1218 | \midrule 1219 | Goal 1220 | & Attention & \yep & \yep & \yep & & & & & & & & \high &\low \\ 1221 | & Action & \yep & \yep & \yep & & & & & & & & \low & \high \\ 1222 | & Liking & & & & \yep & \yep & \yep & & & & & \high & \\ 1223 | \midrule 1224 | Type 1225 | & Utilitarian & & & & & \yep & \yep & & & \yep & & & \\ 1226 | & Hedonic & \yep & & \yep & & & \yep & \yep & & & & & \\ 1227 | \midrule 1228 | Message 1229 | & Prevention & \yep \\ 1230 | & Gain & & & & & \yep \\ 1231 | \midrule 1232 | Gender 1233 | & Male & & & & \yep & \yep \\ 1234 | & Female & \yep & & \yep & & \yep & \yep & \yep & & & & \low & \low \\ 1235 | \bottomrule 1236 | \end{tabular} 1237 | \label{table:nick-colour-associations} 1238 | \end{table} 1239 | 1240 | While \autoref{table:nick-colour-associations} is nice, it isn't terribly useful for 1241 | providing a holistic view of colour in design. 1242 | 1243 | \printbibliography 1244 | \printglossary 1245 | 1246 | \end{document} 1247 | -------------------------------------------------------------------------------- /documentation/refs.bib: -------------------------------------------------------------------------------- 1 | @article{Tinker_Paterson_1942, 2 | abstract = {This is a study of the esthetic properties of typography in terms of pleasingness to supplement previous investigations concerned with the relation of legibility of typography to speed of reading (see XV: 1004). Although the causal relationships were not revealed by the data, close agreement between the judged legibility (and hence speed of reading) and the judged pleasingness of the typography was found.}, 3 | author = {Tinker, M. A. and Paterson, D. G.}, 4 | language = {eng}, 5 | publisher = {American Psychological Association}, 6 | date = {1942-02}, 7 | issn = {0021-9010}, 8 | journaltitle = {Journal of Applied Psychology}, 9 | keywords = {Aesthetics ; Cognitive Processes ; Legibility ; Reading ; Reading Speed ; Cognitive Processes ; Reader Preferences ; Typography Legibility ; Esthetic Properties ; Empirical Study ; Quantitative Study ; Human ; Article;}, 10 | number = {1}, 11 | pages = {38,40}, 12 | title = {Reader preferences and typography}, 13 | volume = {26}, 14 | } 15 | 16 | @article{kaspar2015matter, 17 | author = {Kaspar, Kai and Wehlitz, Thea and von Knobelsdorff, Sara and Wulf, Tim and von Saldern, Marie Antoinette Oktavie}, 18 | publisher = {Wiley Online Library}, 19 | date = {2015}, 20 | journaltitle = {International Journal of Psychology}, 21 | number = {5}, 22 | pages = {372--378}, 23 | title = {A matter of font type: The effect of serifs on the evaluation of scientific abstracts}, 24 | volume = {50}, 25 | } 26 | 27 | @article{Gasser_Boeke_Haffernan_Tan_2005, 28 | author = {Gasser, Michael and Boeke, Julie and Haffernan, Mary and Tan, Rowena}, 29 | date = {2005}, 30 | issn = {1527-7143(Print)}, 31 | journaltitle = {North American Journal of Psychology}, 32 | number = {2}, 33 | pages = {181--188}, 34 | title = {The Influence of Font Type on Information Recall.}, 35 | volume = {7}, 36 | } 37 | 38 | @incollection{larson2007measuring, 39 | author = {Larson, Kevin and Hazlett, Richard L and Chaparro, Barbara S and Picard, Rosalind W}, 40 | publisher = {Springer}, 41 | booktitle = {People and Computers XX—Engage}, 42 | date = {2007}, 43 | pages = {41--56}, 44 | title = {Measuring the aesthetics of reading}, 45 | } 46 | 47 | @online{web_chooserightfont, 48 | author = {Kolenda, Nick}, 49 | url = {https://www.nickkolenda.com/font-psychology/}, 50 | date = {2019-07}, 51 | title = {How to Choose the Right Font (According to Science)}, 52 | } 53 | 54 | @book{Bringhurst_2004, 55 | author = {Bringhurst, Robert.}, 56 | publisher = {Hartley and Marks, Publishers}, 57 | date = {2004}, 58 | isbn = {0-88179-205-5}, 59 | title = {The elements of typographic style}, 60 | } 61 | 62 | @article{Laurence1991, 63 | abstract = {The Lüscher colour test is used to compare colour associations in China, South Korea, Japan and the United States. Respondents were asked which colour they associate with words such as expensive, happy, love and dependable. They were also asked to relate the colours to countries, such as Italy and France; institutions, such as restaurants and theatres; and product packages, such as a soft drink label and a box of headache remedy. The findings show that, while some colours seem to show cross-cultural consistency, other colours, such as purple and grey, hold opposite meanings in different cultures.}, 64 | author = {Laurence, Jacobs}, 65 | publisher = {MCB UP Ltd}, 66 | url = {https://doi.org/10.1108/02651339110137279}, 67 | date = {1991-01-01}, 68 | doi = {10.1108/02651339110137279}, 69 | issn = {0265-1335}, 70 | number = {3}, 71 | title = {Cross-cultural Colour Comparisons: Global Marketers Beware!}, 72 | volume = {8}, 73 | } 74 | 75 | @article{OConnnor2011, 76 | abstract = {Information about colour psychology and colour therapy abounds in popular culture. Articles found in mass media as well as a plethora of Internet websites are often devoted to colour and a range of psychological, biological, and behavioral effects. The information available, which varies from scant summaries with catchy titles to lengthy and comprehensive discussions, is often presented in an authoritative manner exhorting the reader to believe a range of claims such as red is physically stimulating and arousing and blue is calming, relaxing and healing. However, empirical evidence or evidence of any nature is only rarely cited and, when it is, it's often in reference to findings that are inappropriately generalized or out-of-date and superseded. This article discusses a range of colour psychology and colour therapy claims found in popular culture and notes the similarities between these claims and the writings of early theorists such as Birren, Goldstein, Gerard and Luscher. While these authors have a valid if somewhat dated place in the literature on colour, there are a number of key reasons to be wary of colour psychology and colour therapy claims made in popular culture. These reasons are discussed in some detail and provide compelling support for applying the caveat emptor principle to colour psychology and colour therapy claims found in nonacademic sources.}, 77 | author = {O'Connor, Z}, 78 | language = {eng}, 79 | url = {http://search.proquest.com/docview/889394375/}, 80 | date = {2011-04-11}, 81 | issn = {0361-2317}, 82 | journaltitle = {Color Research and Application}, 83 | keywords = {Analogies ; Color ; Colour ; Culture ; Internet ; Psychology ; Readers ; Therapy ; Instruments and Measurements (So)}, 84 | number = {3}, 85 | pages = {229,234}, 86 | title = {Colour Psychology and Colour Therapy: Caveat Emptor}, 87 | volume = {36}, 88 | } 89 | 90 | @online{web_colour, 91 | author = {Kolenda, Nick}, 92 | url = {https://www.nickkolenda.com/color-psychology}, 93 | date = {2019-10}, 94 | title = {Color Psychology: An Enormous Guide}, 95 | } -------------------------------------------------------------------------------- /infoBulle.sty: -------------------------------------------------------------------------------- 1 | 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 | % % 4 | % % 5 | % infoBulle % 6 | % % 7 | % % 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | 10 | 11 | % Copyright Yves Zumbach 2017 12 | %------------------------------------------------------------------------------- 13 | 14 | % This work is distributed under the LPPL 15 | %------------------------------------------------------------------------------- 16 | 17 | % This work may be distributed and/or modified under the 18 | % conditions of the LaTeX Project Public License, either version 1.3 19 | % of this license or (at your option) any later version. 20 | % The latest version of this license is in 21 | % http://www.latex-project.org/lppl.txt 22 | % and version 1.3 or later is part of all distributions of LaTeX 23 | % version 2005/12/01 or later. 24 | % 25 | % This work has the LPPL maintenance status `maintained'. 26 | % 27 | % The Current Maintainer of this work is Yves Zumbach 28 | 29 | % This work has been modified by tecosaur (https://github.com/tecosaur) for use with the file bmc.cls 30 | 31 | \NeedsTeXFormat{LaTeX2e} 32 | \ProvidesPackage{infoBulle}[2017/02/17 The infoBulle package typeset flat informational boxes, by Yves ZUMBACH] 33 | 34 | 35 | 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | % Required Packages 38 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 39 | 40 | \RequirePackage{pgfopts} 41 | % \RequirePackage{fontspec} 42 | \RequirePackage{calc} 43 | \RequirePackage[dvipsnames,svgnames,table,hyperref]{xcolor} 44 | % \RequirePackage{translations} 45 | \RequirePackage{mdframed} 46 | \RequirePackage{listings} 47 | \RequirePackage{xparse} 48 | \RequirePackage{tikz} 49 | \usetikzlibrary{calc} 50 | \RequirePackage{interfaces-base} 51 | \LoadInterface{pgfkeys} 52 | 53 | \RequirePackage{yMainColor} 54 | 55 | 56 | 57 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 58 | % Options 59 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 60 | 61 | % Math InfoBulle Command 62 | %------------------------------------------------------------------------------- 63 | \newif\ifinfoBulleMath 64 | \pgfkeys{ 65 | /infoBulle/.cd, 66 | mathInfoBulle/.true = {\infoBulleMathtrue}, 67 | mathInfoBulle/.false = {\infoBulleMathfalse}, 68 | mathInfoBulle = true, 69 | } 70 | 71 | % Counter Reset 72 | %------------------------------------------------------------------------------- 73 | \pgfkeys{ 74 | /infoBulle/math/.cd, 75 | counterReset/.store in=\infoBulle@mathCounterReset, 76 | counterReset = section, 77 | } 78 | 79 | % Margin Icon 80 | %------------------------------------------------------------------------------- 81 | \newif\ifinfoBulleMarginIcons 82 | \pgfkeys{ 83 | /infoBulle/.cd, 84 | marginIcons/.true = {\infoBulleMarginIconstrue}, 85 | marginIcons/.false = {\infoBulleMarginIconsfalse}, 86 | marginIcons = false, 87 | } 88 | 89 | % Icon Radius 90 | %------------------------------------------------------------------------------- 91 | \pgfkeys{ 92 | /infoBulle/icon/.cd, 93 | radius/.store as dimen, 94 | radius = 3.5mm, 95 | } 96 | 97 | % Icon Shape 98 | %------------------------------------------------------------------------------- 99 | \pgfkeys{ 100 | /infoBulle/icon/.cd, 101 | shape/.is choice, 102 | shape/round/.style = {/infoBulle/icon/radius = 3.5mm, /infoBulle/icon/shapeCommand/.code n args = {3}{\fill[##3] (##1) circle (##2);}}, 103 | shape/hexagon/.style = {/infoBulle/icon/radius = 4mm, /infoBulle/icon/shapeCommand/.code n args = {3}{\infoBulle@hexagon{##1}{##2}[##3, rotate=90];}}, 104 | shape/round, 105 | } 106 | 107 | \ProcessPgfPackageOptions{/infoBulle} 108 | 109 | 110 | 111 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 112 | % Font Configuration 113 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 114 | 115 | % \setfontfamily{\FA}{Font Awesome 5 Free Regular} 116 | % \setfontfamily{\FASolid}{Font Awesome 5 Free Solid} 117 | 118 | \usepackage{fontawesome5} 119 | 120 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 121 | % Colors 122 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 123 | 124 | \definecolor{criticalColor}{RGB}{211, 47, 47} 125 | \definecolor{questionColor}{RGB}{156, 39, 176} 126 | \definecolor{informationColor}{RGB}{139, 195, 74} 127 | \definecolor{checkColor}{RGB}{3, 169, 244} 128 | \definecolor{warningColor}{RGB}{255, 165, 0} 129 | \definecolor{tipColor}{RGB}{142, 68, 173} 130 | \definecolor{exampleColor}{RGB}{156, 39, 176} 131 | \definecolor{mathematicalColor}{RGB}{230, 126, 34} 132 | \colorlet{codeColor}{Grey} 133 | 134 | 135 | 136 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 137 | % TikZ Commands 138 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 139 | 140 | \DeclareDocumentCommand{\infoBulle@hexagon}{m m O{}}{ 141 | \fill [#3] ($ (#1) + (0:#2) $) -- ($ (#1) + (60:#2) $) -- ($ (#1) + (120:#2) $) -- ($ (#1) + (180:#2) $) -- ($ (#1) + (240:#2) $) -- ($ (#1) + (300:#2) $) -- cycle; 142 | } 143 | 144 | 145 | 146 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 147 | % Styles 148 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 149 | 150 | % infoBulle basic configuration 151 | \colorlet{infoBulleBackground}{lightGrey} 152 | \colorlet{infoBulleText}{black} 153 | 154 | \mdfdefinestyle{infoBulle} 155 | { 156 | skipabove=\baselineskip, 157 | skipbelow=\baselineskip, 158 | innertopmargin=4mm, 159 | innerbottommargin=\baselineskip, 160 | innerleftmargin=4mm, 161 | innerrightmargin=4mm, 162 | leftmargin=0mm, 163 | rightmargin=0mm, 164 | rightline=false, 165 | topline=false, 166 | bottomline=false, 167 | linewidth=1mm, 168 | backgroundcolor=infoBulleBackground, 169 | fontcolor=infoBulleText, 170 | frametitlefontcolor=infoBulleText, 171 | frametitlebelowskip=0mm, 172 | frametitleaboveskip=4mm, 173 | splittopskip=2\topsep, 174 | needspace=6em 175 | } 176 | \newmdenv[ 177 | style=infoBulle, 178 | ]{infoBulle} 179 | 180 | 181 | 182 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 183 | % Skeleton Commands 184 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 185 | 186 | % Title content 187 | %------------------------------------------------------------------------------- 188 | \newcommand{\infoBulleTitleFormat}{\large} 189 | \newlength{\yIconHorizontalOffset} 190 | \setlength{\yIconHorizontalOffset}{.73cm} 191 | % General Command 192 | \DeclareDocumentCommand{\@titleContent}{m m m}{% 193 | \fontfamily{\headingsFont}\selectfont 194 | \ifinfoBulleMarginIcons 195 | \llap{#2\hspace*{\yIconHorizontalOffset}}% 196 | \mbox{}% 197 | \infoBulleTitleFormat#3% 198 | \else 199 | \@afterindentfalse\@afterheading% 200 | \mbox{}% 201 | \parbox[t][2\pgfkeysvalueof{/infoBulle/icon/radius}]{.75cm}{% 202 | \@afterindentfalse\@afterheading% 203 | \mbox{}% 204 | #2% 205 | }\hspace*{2mm}% 206 | \parbox[t]{\linewidth-.75cm-2mm}{% 207 | \mbox{}% 208 | \infoBulleTitleFormat#3% 209 | }% 210 | \fi 211 | }% 212 | % Command for titles n two part (one in bold, the other normal) 213 | % icon color, icon, title part one, title part two 214 | \DeclareDocumentCommand{\@titleContentTwoPart}{m m m m}{% 215 | \@titleContent{#1}{#2}{#3\IfValueTF{#4}{~:\ {\normalfont#4}}{}}% 216 | } 217 | % Command for math title 218 | % icon color, icon, theorem sort (theorem, lemma, etc.), theorem counter, title 219 | \DeclareDocumentCommand{\@titleContentMath}{m m m}{% 220 | \@titleContentTwoPart{mathematicalColor}{\mathematicalIcon}{#1 \arabic{\infoBulle@mathCounterReset}.#2}{#3}% 221 | } 222 | 223 | % Command for example title 224 | \DeclareDocumentCommand{\@titleContentExample}{m m m}{% 225 | \@titleContentTwoPart{exampleColor}{\exampleIcon}{#1 \arabic{\infoBulle@mathCounterReset}.#2}{#3}% 226 | } 227 | 228 | % infoBulle skeleton 229 | % The little mess with lengths allow to keep the same parindent and parskip inside the infoBulle (this is a little bug from mdframed) 230 | \newlength{\tempparindent} 231 | \newlength{\tempparskip} 232 | \NewDocumentEnvironment{@infoBulleSkeletonEnv}{m m m}{ 233 | \setlength{\tempparindent}{\parindent} 234 | \setlength{\tempparskip}{\parskip} 235 | \begin{infoBulle}[linecolor=#1, frametitle=\@titleContent{#1}{#2}{#3}]% 236 | \setlength{\parindent}{\tempparindent}% 237 | \setlength{\parskip}{\tempparskip}% 238 | }{% 239 | \end{infoBulle}% 240 | } 241 | \DeclareDocumentCommand{\@infoBulleSkeleton}{m m m +m}{ 242 | \begin{@infoBulleSkeletonEnv}{#1}{#2}{#3} 243 | #4 244 | \end{@infoBulleSkeletonEnv} 245 | } 246 | 247 | 248 | 249 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 250 | % User Commands 251 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 252 | 253 | 254 | % infoInfo 255 | %------------------------------------------------------------------------------- 256 | \newcommand{\infoIcon}{% 257 | \infoBulleAbstractIcon{informationColor}{\faInfo} 258 | } 259 | \DeclareDocumentCommand{\infoInfo}{m +m}{\@infoBulleSkeleton{informationColor}{\infoIcon}{#1}{#2}} 260 | \NewDocumentEnvironment{InfoInfo}{m} 261 | {\begin{@infoBulleSkeletonEnv}{informationColor}{\infoIcon}{#1}} 262 | {\end{@infoBulleSkeletonEnv}} 263 | 264 | 265 | % warningInfoexclamation 266 | %------------------------------------------------------------------------------- 267 | \newcommand{\warningIcon}{% 268 | \infoBulleAbstractIcon{warningColor}{\faExclamation} 269 | } 270 | \DeclareDocumentCommand{\warningInfo}{m +m}{\@infoBulleSkeleton{warningColor}{\warningIcon}{#1}{#2}} 271 | \NewDocumentEnvironment{WarningInfo}{m} 272 | {\begin{@infoBulleSkeletonEnv}{warningColor}{\warningIcon}{#1}} 273 | {\end{@infoBulleSkeletonEnv}} 274 | 275 | 276 | % criticalInfo 277 | %------------------------------------------------------------------------------- 278 | \newcommand{\criticalIcon}{% 279 | \infoBulleAbstractIcon{criticalColor}{\faTimes} 280 | } 281 | \DeclareDocumentCommand{\criticalInfo}{m +m}{\@infoBulleSkeleton{criticalColor}{\criticalIcon}{#1}{#2}} 282 | \NewDocumentEnvironment{CriticalInfo}{m} 283 | {\begin{@infoBulleSkeletonEnv}{criticalColor}{\criticalIcon}{#1}} 284 | {\end{@infoBulleSkeletonEnv}} 285 | 286 | 287 | % checkInfo 288 | %------------------------------------------------------------------------------- 289 | \newcommand{\checkIcon}{% 290 | \infoBulleAbstractIcon{checkColor}{\faCheck} 291 | } 292 | \DeclareDocumentCommand{\checkInfo}{m +m}{\@infoBulleSkeleton{checkColor}{\checkIcon}{#1}{#2}} 293 | \NewDocumentEnvironment{CheckInfo}{m} 294 | {\begin{@infoBulleSkeletonEnv}{checkColor}{\checkIcon}{#1}} 295 | {\end{@infoBulleSkeletonEnv}} 296 | 297 | 298 | % questionInfo 299 | %------------------------------------------------------------------------------- 300 | \newcommand{\questionIcon}{% 301 | \infoBulleAbstractIcon{questionColor}{\faQuestion} 302 | } 303 | \DeclareDocumentCommand{\questionInfo}{m +m}{\@infoBulleSkeleton{questionColor}{\questionIcon}{#1}{#2}} 304 | \NewDocumentEnvironment{QuestionInfo}{m} 305 | {\begin{@infoBulleSkeletonEnv}{questionColor}{\questionIcon}{#1}} 306 | {\end{@infoBulleSkeletonEnv}} 307 | 308 | 309 | % tipInfo 310 | %------------------------------------------------------------------------------- 311 | \newcommand{\tipIcon}{% 312 | \infoBulleAbstractIcon{tipColor}{\faLightbulb} 313 | } 314 | \DeclareDocumentCommand{\tipInfo}{m +m}{\@infoBulleSkeleton{tipColor}{\tipIcon}{#1}{#2}} 315 | \NewDocumentEnvironment{TipInfo}{m} 316 | {\begin{@infoBulleSkeletonEnv}{tipColor}{\tipIcon}{#1}} 317 | {\end{@infoBulleSkeletonEnv}} 318 | 319 | % codeInfo 320 | %------------------------------------------------------------------------------- 321 | \newcommand{\codeIcon}{% 322 | \infoBulleAbstractIcon{Grey}{\faCode} 323 | } 324 | \lstnewenvironment{CodeInfoLst}[1][Python] 325 | { 326 | \lstset{ 327 | language={#1}, 328 | numbers=left, 329 | numbersep=7mm, 330 | numberstyle=\color{Black}, 331 | stepnumber=1, 332 | tabsize=3, 333 | breakatwhitespace=false, 334 | breaklines=true, 335 | captionpos=b, 336 | showstringspaces=false, 337 | basicstyle=\color{Black}\ttfamily, 338 | commentstyle=\color{LimeGreen}, 339 | keywordstyle=\color{BurntOrange}\bfseries, 340 | stringstyle=\color{WildStrawberry}, 341 | % keywords={var, func, extends}, 342 | frame=leftline, 343 | framesep=0mm, 344 | xleftmargin=0mm,% marge ajouté à gauche du tableau (à configurer en dernier pour l'alignement global du tableau) 345 | framesep=0mm, %distance texte bord du cadre (limite de la background color) 346 | framerule=0mm, 347 | abovecaptionskip=3mm, 348 | aboveskip=0pt, 349 | belowskip=0pt 350 | } 351 | } 352 | {} 353 | 354 | \NewDocumentEnvironment{CodeInfo}{m o}{ 355 | \begin{@infoBulleSkeletonEnv}{codeColor}{\codeIcon}{#1} 356 | \IfNoValueTF{#2}{}{ 357 | \lstset{caption=#2} 358 | } 359 | }{ 360 | \end{@infoBulleSkeletonEnv} 361 | } 362 | 363 | % exampleInfo 364 | %------------------------------------------------------------------------------- 365 | \newcommand{\exampleIcon}{% 366 | \infoBulleAbstractIcon{exampleColor}{\faClipboard} 367 | } 368 | 369 | \newcounter{example}[\infoBulle@mathCounterReset] 370 | \NewDocumentEnvironment{example}{o}{% 371 | \stepcounter{example}% 372 | \begin{mdframed}[% 373 | style=infoBulle, 374 | linecolor=exampleColor, 375 | frametitle=\@titleContentExample{Example}{\theexample}{#1} 376 | ]\relax% 377 | }{% 378 | \end{mdframed}% 379 | } 380 | 381 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 382 | % User Math Commands 383 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 384 | 385 | % Only declare the folowwing commands if the user wnats some infoBulle math 386 | \ifinfoBulleMath 387 | 388 | % Mathematical Icon 389 | %------------------------------------------------------------------------------- 390 | \newcommand{\mathematicalIcon}{% 391 | \infoBulleAbstractIcon{mathematicalColor}{\fontsize{.6cm}{.72cm}\selectfont$\pi$}% 392 | } 393 | 394 | % Proof commands 395 | %------------------------------------------------------------------------------- 396 | % \NewTranslation{english}{proposition}{Proof} 397 | % \NewTranslation{french}{proposition}{Proof} 398 | % \NewTranslation{german}{proposition}{Vorschlag} 399 | \newcounter{proof}[\infoBulle@mathCounterReset] 400 | \NewDocumentEnvironment{proof}{o}{% 401 | \stepcounter{proof}% 402 | \begin{mdframed}[% 403 | style=infoBulle, 404 | linecolor=mathematicalColor, 405 | frametitle=\@titleContentMath{proof}{\theproof}{#1} 406 | ]\relax% 407 | }{% 408 | \end{mdframed}% 409 | } 410 | 411 | % Theorem commands 412 | %------------------------------------------------------------------------------- 413 | % \NewTranslation{english}{theorem}{Theorem} 414 | % \NewTranslation{french}{theorem}{Théorème} 415 | % \NewTranslation{german}{theorem}{Lehrsatz} 416 | \newcounter{theorem}[\infoBulle@mathCounterReset] 417 | \NewDocumentEnvironment{theorem}{o}{% 418 | \stepcounter{theorem}% 419 | \begin{mdframed}[% 420 | style=infoBulle, 421 | linecolor=mathematicalColor, 422 | frametitle=\@titleContentMath{theorem}{\thetheorem}{#1} 423 | ]\relax% 424 | }{% 425 | \end{mdframed}% 426 | } 427 | 428 | % Lemma commands 429 | %------------------------------------------------------------------------------- 430 | % \NewTranslation{english}{lemma}{Lemma} 431 | % \NewTranslation{french}{lemma}{Lemme} 432 | % \NewTranslation{german}{lemma}{Lemma} 433 | \newcounter{lemma}[\infoBulle@mathCounterReset] 434 | \NewDocumentEnvironment{lemma}{o}{% 435 | \stepcounter{lemma}% 436 | \begin{mdframed}[% 437 | style=infoBulle, 438 | linecolor=mathematicalColor, 439 | frametitle=\@titleContentMath{lemma}{\thelemma}{#1} 440 | ]\relax% 441 | }{% 442 | \end{mdframed}% 443 | } 444 | 445 | % Corollary commands 446 | %------------------------------------------------------------------------------- 447 | % \NewTranslation{english}{corollary}{Corollary} 448 | % \NewTranslation{french}{corollary}{Corollaire} 449 | % \NewTranslation{german}{corollary}{Folge} 450 | \newcounter{corollary}[\infoBulle@mathCounterReset] 451 | \NewDocumentEnvironment{corollary}{o}{% 452 | \stepcounter{corollary}% 453 | \begin{mdframed}[% 454 | style=infoBulle, 455 | linecolor=mathematicalColor, 456 | frametitle=\@titleContentMath{corollary}{\thecorollary}{#1} 457 | ]\relax% 458 | }{% 459 | \end{mdframed}% 460 | } 461 | 462 | % Definition commands 463 | %------------------------------------------------------------------------------- 464 | % \NewTranslation{english}{definition}{Definition} 465 | % \NewTranslation{french}{definition}{Définition} 466 | % \NewTranslation{german}{definition}{Definition} 467 | \newcounter{definition}[\infoBulle@mathCounterReset] 468 | \NewDocumentEnvironment{definition}{o}{% 469 | \stepcounter{definition}% 470 | \begin{mdframed}[% 471 | style=infoBulle, 472 | linecolor=mathematicalColor, 473 | frametitle=\@titleContentMath{definition}{\thedefinition}{#1} 474 | ]\relax% 475 | }{% 476 | \end{mdframed}% 477 | } 478 | 479 | % Axiom commands 480 | %------------------------------------------------------------------------------- 481 | % \NewTranslation{english}{axiom}{Axiom} 482 | % \NewTranslation{french}{axiom}{Axiome} 483 | % \NewTranslation{german}{axiom}{Axiom} 484 | \newcounter{axiom}[\infoBulle@mathCounterReset] 485 | \NewDocumentEnvironment{axiom}{o}{% 486 | \stepcounter{axiom}% 487 | \begin{mdframed}[% 488 | style=infoBulle, 489 | linecolor=mathematicalColor, 490 | frametitle=\@titleContentMath{axiom}{\theaxiom}{#1} 491 | ]\relax% 492 | }{% 493 | \end{mdframed}% 494 | } 495 | 496 | % Proposition commands 497 | %------------------------------------------------------------------------------- 498 | % \NewTranslation{english}{proposition}{Proposition} 499 | % \NewTranslation{french}{proposition}{Proposition} 500 | % \NewTranslation{german}{proposition}{Vorschlag} 501 | \newcounter{proposition}[\infoBulle@mathCounterReset] 502 | \NewDocumentEnvironment{proposition}{o}{% 503 | \stepcounter{proposition}% 504 | \begin{mdframed}[% 505 | style=infoBulle, 506 | linecolor=mathematicalColor, 507 | frametitle=\@titleContentMath{proposition}{\theproposition}{#1} 508 | ]\relax% 509 | }{% 510 | \end{mdframed}% 511 | } 512 | \fi 513 | 514 | 515 | 516 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 517 | % Icons 518 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 519 | 520 | % Normal Icons Command 521 | %------------------------------------------------------------------------------- 522 | \DeclareDocumentCommand{\infoBulleAbstractIcon}{m m O{text=lightGrey}}{% 523 | \begin{tikzpicture}[inner sep=0mm, baseline=(iconText.base)]% 524 | \coordinate (iconCenter) at (0,0); 525 | \pgfkeys{/infoBulle/icon/shapeCommand={iconCenter}{\pgfkeysvalueof{/infoBulle/icon/radius}}{#1}} 526 | \draw (iconCenter) node[text width=.7cm, align=center, font=\fontsize{.4cm}{.48cm}, #3] (iconText) {#2}; 527 | \end{tikzpicture} 528 | } 529 | 530 | 531 | 532 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 533 | % Configuration Command 534 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 535 | 536 | \DeclareDocumentCommand{\infoBulleConfiguration}{m}{\pgfkeys{/infoBulle/.cd, #1}} 537 | 538 | 539 | 540 | \endinput 541 | -------------------------------------------------------------------------------- /marginInfoBulle.sty: -------------------------------------------------------------------------------- 1 | 2 | 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | % % 5 | % % 6 | % marginInfoBulle % 7 | % % 8 | % % 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | 11 | 12 | % Copyright Yves Zumbach 2017 13 | %------------------------------------------------------------------------------- 14 | 15 | % This work is distributed under the LPPL 16 | %------------------------------------------------------------------------------- 17 | 18 | % This work may be distributed and/or modified under the 19 | % conditions of the LaTeX Project Public License, either version 1.3 20 | % of this license or (at your option) any later version. 21 | % The latest version of this license is in 22 | % http://www.latex-project.org/lppl.txt 23 | % and version 1.3 or later is part of all distributions of LaTeX 24 | % version 2005/12/01 or later. 25 | % 26 | % This work has the LPPL maintenance status `maintained'. 27 | % 28 | % The Current Maintainer of this work is Yves Zumbach 29 | 30 | % This work has been modified by tecosaur (https://github.com/tecosaur) for use with the file bmc.cls 31 | 32 | \NeedsTeXFormat{LaTeX2e} 33 | 34 | \ProvidesPackage{marginInfoBulle}[2017/02/18 An add-on for the infoBulle package that defines commands for infoBulles in the margin of a document] 35 | 36 | 37 | 38 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 39 | % Required Packages 40 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 41 | 42 | \RequirePackage{infoBulle} 43 | \RequirePackage{yMarginDesign} 44 | 45 | 46 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 47 | % marginInfoBulle Style 48 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 49 | \colorlet{marginInfoBulleBackground}{white} 50 | \colorlet{marginInfoBulleText}{black} 51 | \mdfdefinestyle{marginInfoBulle} 52 | { 53 | skipabove=0mm, 54 | skipbelow=0mm, 55 | innertopmargin=1mm, 56 | innerbottommargin=1mm, 57 | innerleftmargin=3mm, 58 | innerrightmargin=0mm, 59 | leftmargin=0mm, 60 | rightmargin=0mm, 61 | rightline=false, 62 | topline=false, 63 | bottomline=false, 64 | linewidth=1mm, 65 | frametitlebelowskip=1mm, 66 | frametitleaboveskip=1mm, 67 | backgroundcolor=marginInfoBulleBackground, 68 | fontcolor=marginInfoBulleText, 69 | frametitlefontcolor=marginInfoBulleText 70 | } 71 | 72 | 73 | 74 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 75 | % General marginSomething Command 76 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 77 | 78 | % Arguments: 1)boolean footnotemark 2)icon 3)color 4)title default string 5)title string 6)content 79 | \DeclareDocumentCommand{\marginInfoAbstract}{s m m m m m}{% 80 | \IfBooleanF{#1}{ 81 | {% 82 | \textsuperscript{\color{#3}#2}% 83 | }% 84 | } 85 | \marginElement{% 86 | \begin{mdframed}[style=marginInfoBulle, linecolor=#3, frametitle={% 87 | \parbox{\linewidth}{% 88 | \mbox{}% 89 | \parbox[t]{.5cm}{\leavevmode\color{#3}#2}% 90 | \parbox[t]{\linewidth-.5cm}{\fontfamily{\headingsFont}\selectfont\bfseries\IfNoValueTF{#5}{#4}{#5}}% 91 | }% 92 | }]% 93 | #6% 94 | \end{mdframed}% 95 | }% 96 | } 97 | 98 | 99 | 100 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 101 | % Instantiating Special Commands 102 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 103 | 104 | % marginCritical 105 | %------------------------------------------------------------------------------- 106 | \DeclareDocumentCommand{\marginCritical}{s o m}{% 107 | \IfBooleanTF{#1} 108 | {\marginInfoAbstract*{\faTimes}{criticalColor}{\GetTranslation{difficulty}}{#2}{#3}} 109 | {\marginInfoAbstract{\faTimes}{criticalColor}{\GetTranslation{difficulty}}{#2}{#3}}% 110 | } 111 | 112 | % marginInfo 113 | %------------------------------------------------------------------------------- 114 | \DeclareDocumentCommand{\marginInfo}{s o m}{% 115 | \IfBooleanTF{#1} 116 | {\marginInfoAbstract*{\faInfo}{informationColor}{\GetTranslation{info}}{#2}{#3}} 117 | {\marginInfoAbstract{\faInfo}{informationColor}{\GetTranslation{info}}{#2}{#3}}% 118 | } 119 | 120 | % marginTip 121 | %------------------------------------------------------------------------------- 122 | \DeclareDocumentCommand{\marginTip}{s o m}{% 123 | \IfBooleanTF{#1} 124 | {\marginInfoAbstract*{\faLightbulb}{tipColor}{\GetTranslation{tip}}{#2}{#3}} 125 | {\marginInfoAbstract{\faLightbulb}{tipColor}{\GetTranslation{tip}}{#2}{#3}}% 126 | } 127 | 128 | % marginQuestion 129 | %------------------------------------------------------------------------------- 130 | \DeclareDocumentCommand{\marginQuestion}{s o m}{% 131 | \IfBooleanTF{#1} 132 | {\marginInfoAbstract*{\faQuestion}{questionColor}{\GetTranslation{question}}{#2}{#3}} 133 | {\marginInfoAbstract{\faQuestion}{questionColor}{\GetTranslation{question}}{#2}{#3}}% 134 | } 135 | 136 | % marginCheck 137 | %------------------------------------------------------------------------------- 138 | \DeclareDocumentCommand{\marginCheck}{s o m}{% 139 | \IfBooleanTF{#1} 140 | {\marginInfoAbstract*{\faCheck}{checkColor}{\GetTranslation{check}}{#2}{#3}} 141 | {\marginInfoAbstract{\faCheck}{checkColor}{\GetTranslation{check}}{#2}{#3}}% 142 | } 143 | 144 | % marginWarning 145 | %------------------------------------------------------------------------------- 146 | \DeclareDocumentCommand{\marginWarning}{s o m}{% 147 | \IfBooleanTF{#1} 148 | {\marginInfoAbstract*{\faExclamation}{warningColor}{\GetTranslation{warning}}{#2}{#3}} 149 | {\marginInfoAbstract{\faExclamation}{warningColor}{\GetTranslation{warning}}{#2}{#3}}% 150 | } 151 | 152 | \endinput 153 | -------------------------------------------------------------------------------- /yMainColor.sty: -------------------------------------------------------------------------------- 1 | 2 | 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | % % 5 | % % 6 | % yMainColor % 7 | % % 8 | % % 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | 11 | 12 | % Copyright Yves Zumbach 2017 13 | %------------------------------------------------------------------------------- 14 | 15 | % This work is distributed under the LPPL 16 | %------------------------------------------------------------------------------- 17 | 18 | % This work may be distributed and/or modified under the 19 | % conditions of the LaTeX Project Public License, either version 1.3 20 | % of this license or (at your option) any later version. 21 | % The latest version of this license is in 22 | % http://www.latex-project.org/lppl.txt 23 | % and version 1.3 or later is part of all distributions of LaTeX 24 | % version 2005/12/01 or later. 25 | % 26 | % This work has the LPPL maintenance status `maintained'. 27 | % 28 | % The Current Maintainer of this work is Yves Zumbach 29 | 30 | \NeedsTeXFormat{LaTeX2e} 31 | \ProvidesPackage{yMainColor}[2017/02/17 The yMainColor package is merely a helper that ensure that the color 'mainColor' is defined, along with three variations of grey in a document, by Yves ZUMBACH] 32 | 33 | 34 | 35 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 36 | % Define mainColor 37 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 38 | 39 | \RequirePackage{xcolor} 40 | \RequirePackage{xparse} 41 | 42 | \providecolor{mainColor}{RGB}{211, 47, 47} 43 | \providecolor{secondColor}{RGB}{142, 68, 173} 44 | 45 | \providecolor{lightGrey}{gray}{0.94} 46 | \providecolor{middleGrey}{gray}{.75} 47 | \providecolor{darkGrey}{gray}{.55} 48 | \colorlet{lightGray}{lightGrey} 49 | \colorlet{middleGray}{middleGrey} 50 | \colorlet{darkGray}{darkGrey} 51 | 52 | \endinput 53 | -------------------------------------------------------------------------------- /yMarginDesign.sty: -------------------------------------------------------------------------------- 1 | 2 | 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | % % 5 | % % 6 | % yMarginDesign % 7 | % % 8 | % % 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | 11 | 12 | % Copyright Yves Zumbach 2017 13 | %------------------------------------------------------------------------------- 14 | 15 | % This work is distributed under the LPPL 16 | %------------------------------------------------------------------------------- 17 | 18 | % This work may be distributed and/or modified under the 19 | % conditions of the LaTeX Project Public License, either version 1.3 20 | % of this license or (at your option) any later version. 21 | % The latest version of this license is in 22 | % http://www.latex-project.org/lppl.txt 23 | % and version 1.3 or later is part of all distributions of LaTeX 24 | % version 2005/12/01 or later. 25 | % 26 | % This work has the LPPL maintenance status `maintained'. 27 | % 28 | % The Current Maintainer of this work is Yves Zumbach 29 | 30 | 31 | 32 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 33 | % Required Packages 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | 36 | \RequirePackage{xparse} 37 | \RequirePackage{marginnote} 38 | \RequirePackage{marginfix} 39 | \RequirePackage{ragged2e} 40 | \RequirePackage{interfaces-base} 41 | \LoadInterface{pgfkeys} 42 | \RequirePackage{xcolor} 43 | \RequirePackage{changepage} 44 | 45 | 46 | 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | % Global Options 49 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 50 | 51 | % Configuration command 52 | \DeclareDocumentCommand{\yMarginDesignConfiguration}{m}{\pgfkeys{/yMarginDesign/.cd, #1}} 53 | 54 | % Color of the title, marginNoteMark, etc. 55 | \pgfkeys{ 56 | /yMarginDesign/.cd, 57 | color/.store as color, 58 | color=black, 59 | } 60 | 61 | % Marginpar alignment 62 | % Default: inner of the page, only compatible with memoir 63 | \pgfkeys{ 64 | /yMarginDesign/alignment/.code = {\strictpagechecktrue\checkoddpage\ifoddpage\RaggedRight\else\RaggedLeft\fi} 65 | } 66 | 67 | 68 | 69 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 70 | % Margin Paragraphs 71 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 72 | 73 | % Typeset a paragraph in the margin 74 | \DeclareDocumentCommand{\marginElement}{m}{% 75 | \marginpar{% 76 | \pgfkeys{/yMarginDesign/alignment}% 77 | \footnotesize% 78 | #1% 79 | }\unskip% 80 | }% 81 | 82 | % The mark for the marginNote 83 | \DeclareDocumentCommand{\marginMark}{m}{{\color{\pgfkeysvalueof{/yMarginDesign/color}}#1.~}} 84 | 85 | \DeclareDocumentCommand{\printMarginNoteMark}{}{% 86 | \@ifpackageloaded{hyperref}% 87 | {{\hypersetup{linkcolor=\pgfkeysvalueof{/yMarginDesign/color}}\footnotemark}}% 88 | {\textcolor{\pgfkeysvalueof{/yMarginDesign/color}}{\footnotemark}} 89 | } 90 | 91 | % Typeset a paragraph in the margin with a number (as a footnote) 92 | \DeclareDocumentCommand{\marginNote}{m}{% 93 | \printMarginNoteMark 94 | \ignorespaces% 95 | \marginElement{% 96 | \marginMark{\thefootnote}% 97 | \ignorespaces% 98 | #1% 99 | }% 100 | }% 101 | 102 | % Typeset a paragraph in the margin exactly at the exact position where the command is called 103 | \DeclareDocumentCommand{\forcedMarginElement}{m}{% 104 | \marginnote{% 105 | \pgfkeys{/yMarginDesign/alignment}\footnotesize% 106 | #1% 107 | }% 108 | } 109 | 110 | % Typeset a paragraph in the margin exactly at the exact position where the command is called with a number (as a footnote) 111 | \DeclareDocumentCommand{\forcedMarginNote}{m}{% 112 | \printMarginNoteMark 113 | \ignorespaces% 114 | \forcedMarginElement{% 115 | \sideMark[#1]{\thefootnote}% 116 | \ignorespaces% 117 | #1% 118 | }% 119 | } 120 | 121 | 122 | 123 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 124 | % Margin Design Elements 125 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 126 | 127 | \DeclareDocumentCommand{\marginTitle}{m}{{\bfseries\large\color{\pgfkeysvalueof{/yMarginDesign/color}}#1}\\} 128 | --------------------------------------------------------------------------------