scientific_report.sty 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. % scientific_report.sty - Professional Scientific Report Styling
  2. % For use with XeLaTeX or LuaLaTeX
  3. % Designed for research reports, technical reports, white papers, and similar documents
  4. % NOT for journal manuscripts (use venue-templates for those)
  5. \ProvidesPackage{scientific_report}[2024/01/01 Scientific Report Style]
  6. % ============================================================================
  7. % REQUIRED PACKAGES
  8. % ============================================================================
  9. % Page layout and geometry
  10. \RequirePackage[margin=1in, headheight=14pt]{geometry}
  11. \RequirePackage{setspace}
  12. % Typography - Helvetica font family
  13. \RequirePackage[utf8]{inputenc}
  14. \RequirePackage[T1]{fontenc}
  15. \RequirePackage{helvet}
  16. \renewcommand{\familydefault}{\sfdefault}
  17. % Colors and graphics
  18. \RequirePackage{xcolor}
  19. \RequirePackage{graphicx}
  20. \RequirePackage{tikz}
  21. % Tables
  22. \RequirePackage{longtable}
  23. \RequirePackage{booktabs}
  24. \RequirePackage{multirow}
  25. \RequirePackage{array}
  26. \RequirePackage{colortbl}
  27. \RequirePackage{tabularx}
  28. % Lists and formatting
  29. \RequirePackage{enumitem}
  30. \RequirePackage{parskip}
  31. % Boxes and callouts
  32. \RequirePackage[most]{tcolorbox}
  33. % Headers and footers
  34. \RequirePackage{fancyhdr}
  35. \RequirePackage{titlesec}
  36. % Hyperlinks and references
  37. \RequirePackage{hyperref}
  38. \RequirePackage[numbers,sort&compress]{natbib}
  39. % Math and scientific notation
  40. \RequirePackage{amsmath}
  41. \RequirePackage{amssymb}
  42. \RequirePackage{siunitx}
  43. % Captions
  44. \RequirePackage{caption}
  45. \RequirePackage{subcaption}
  46. % ============================================================================
  47. % COLOR DEFINITIONS - PROFESSIONAL SCIENTIFIC PALETTE
  48. % ============================================================================
  49. % Primary colors (professional blue palette)
  50. \definecolor{primaryblue}{RGB}{0, 51, 102} % Deep navy blue - headers, titles
  51. \definecolor{secondaryblue}{RGB}{74, 144, 226} % Medium blue - subsections
  52. \definecolor{lightblue}{RGB}{220, 235, 252} % Light blue for backgrounds
  53. \definecolor{accentblue}{RGB}{0, 120, 215} % Bright accent blue
  54. % Scientific accent colors
  55. \definecolor{sciencegreen}{RGB}{0, 168, 150} % Teal green - positive findings
  56. \definecolor{lightgreen}{RGB}{220, 245, 240} % Light green background
  57. \definecolor{darkgreen}{RGB}{0, 128, 96} % Dark green for emphasis
  58. % Warning and caution colors
  59. \definecolor{cautionorange}{RGB}{255, 140, 66} % Orange for warnings/limitations
  60. \definecolor{lightorange}{RGB}{255, 243, 224} % Light orange background
  61. \definecolor{criticalred}{RGB}{198, 40, 40} % Red for critical items
  62. \definecolor{lightred}{RGB}{255, 235, 238} % Light red background
  63. % Recommendation and action colors
  64. \definecolor{recommendpurple}{RGB}{103, 58, 183} % Purple for recommendations
  65. \definecolor{lightpurple}{RGB}{237, 231, 246} % Light purple background
  66. % Neutral colors
  67. \definecolor{darkgray}{RGB}{66, 66, 66} % Dark gray for body text
  68. \definecolor{mediumgray}{RGB}{117, 117, 117} % Medium gray for secondary text
  69. \definecolor{lightgray}{RGB}{245, 245, 245} % Light gray backgrounds
  70. \definecolor{tablealt}{RGB}{248, 250, 252} % Alternating table row color
  71. \definecolor{tableborder}{RGB}{200, 200, 200} % Table border color
  72. % ============================================================================
  73. % HYPERLINK CONFIGURATION
  74. % ============================================================================
  75. \hypersetup{
  76. colorlinks=true,
  77. linkcolor=primaryblue,
  78. filecolor=primaryblue,
  79. urlcolor=accentblue,
  80. citecolor=secondaryblue,
  81. pdftitle={Scientific Report},
  82. pdfauthor={},
  83. pdfsubject={Scientific Research},
  84. }
  85. % ============================================================================
  86. % CHAPTER AND SECTION FORMATTING
  87. % ============================================================================
  88. % Chapter formatting - large number with colored title
  89. \titleformat{\chapter}[display]
  90. {\normalfont\huge\bfseries\color{primaryblue}}
  91. {\chaptertitlename\ \thechapter}{20pt}{\Huge}
  92. \titlespacing*{\chapter}{0pt}{-20pt}{40pt}
  93. % Section formatting
  94. \titleformat{\section}
  95. {\normalfont\Large\bfseries\color{primaryblue}}
  96. {\thesection}{1em}{}
  97. \titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
  98. % Subsection formatting
  99. \titleformat{\subsection}
  100. {\normalfont\large\bfseries\color{secondaryblue}}
  101. {\thesubsection}{1em}{}
  102. % Subsubsection formatting
  103. \titleformat{\subsubsection}
  104. {\normalfont\normalsize\bfseries\color{darkgray}}
  105. {\thesubsubsection}{1em}{}
  106. % Paragraph formatting
  107. \titleformat{\paragraph}[runin]
  108. {\normalfont\normalsize\bfseries\color{darkgray}}
  109. {\theparagraph}{1em}{}
  110. % ============================================================================
  111. % HEADER AND FOOTER CONFIGURATION
  112. % ============================================================================
  113. \pagestyle{fancy}
  114. \fancyhf{}
  115. \fancyhead[L]{\small\textit{\leftmark}}
  116. \fancyhead[R]{\small\textit{Scientific Report}}
  117. \fancyfoot[C]{\thepage}
  118. \renewcommand{\headrulewidth}{0.4pt}
  119. \renewcommand{\footrulewidth}{0.4pt}
  120. \renewcommand{\headrule}{\hbox to\headwidth{\color{primaryblue}\leaders\hrule height \headrulewidth\hfill}}
  121. \renewcommand{\footrule}{\hbox to\headwidth{\color{lightgray}\leaders\hrule height \footrulewidth\hfill}}
  122. % Plain page style for chapter pages
  123. \fancypagestyle{plain}{
  124. \fancyhf{}
  125. \fancyfoot[C]{\thepage}
  126. \renewcommand{\headrulewidth}{0pt}
  127. \renewcommand{\footrulewidth}{0.4pt}
  128. }
  129. % ============================================================================
  130. % BOX ENVIRONMENTS - SCIENTIFIC CONTENT ORGANIZATION
  131. % ============================================================================
  132. % Key Findings Box (Blue) - For major findings and discoveries
  133. \newtcolorbox{keyfindings}[1][Key Findings]{
  134. colback=lightblue,
  135. colframe=primaryblue,
  136. fonttitle=\bfseries\color{white},
  137. title=#1,
  138. coltitle=white,
  139. colbacktitle=primaryblue,
  140. boxrule=1pt,
  141. arc=3pt,
  142. left=10pt,
  143. right=10pt,
  144. top=8pt,
  145. bottom=8pt,
  146. before skip=12pt,
  147. after skip=12pt,
  148. }
  149. % Methodology Box (Green) - For methods and procedures
  150. \newtcolorbox{methodology}[1][Methodology]{
  151. colback=lightgreen,
  152. colframe=sciencegreen,
  153. fonttitle=\bfseries\color{white},
  154. title=#1,
  155. coltitle=white,
  156. colbacktitle=sciencegreen,
  157. boxrule=1pt,
  158. arc=3pt,
  159. left=10pt,
  160. right=10pt,
  161. top=8pt,
  162. bottom=8pt,
  163. before skip=12pt,
  164. after skip=12pt,
  165. }
  166. % Results Box (Blue-Green) - For highlighting key results
  167. \newtcolorbox{resultsbox}[1][Results Highlight]{
  168. colback=lightblue!50!lightgreen!50,
  169. colframe=darkgreen,
  170. fonttitle=\bfseries\color{white},
  171. title=#1,
  172. coltitle=white,
  173. colbacktitle=darkgreen,
  174. boxrule=1pt,
  175. arc=3pt,
  176. left=10pt,
  177. right=10pt,
  178. top=8pt,
  179. bottom=8pt,
  180. before skip=12pt,
  181. after skip=12pt,
  182. }
  183. % Recommendations Box (Purple) - For recommendations and implications
  184. \newtcolorbox{recommendations}[1][Recommendations]{
  185. colback=lightpurple,
  186. colframe=recommendpurple,
  187. fonttitle=\bfseries\color{white},
  188. title=#1,
  189. coltitle=white,
  190. colbacktitle=recommendpurple,
  191. boxrule=1pt,
  192. arc=3pt,
  193. left=10pt,
  194. right=10pt,
  195. top=8pt,
  196. bottom=8pt,
  197. before skip=12pt,
  198. after skip=12pt,
  199. }
  200. % Warning/Limitations Box (Orange) - For limitations, cautions, caveats
  201. \newtcolorbox{limitations}[1][Limitations]{
  202. colback=lightorange,
  203. colframe=cautionorange,
  204. fonttitle=\bfseries\color{white},
  205. title=#1,
  206. coltitle=white,
  207. colbacktitle=cautionorange,
  208. boxrule=1pt,
  209. arc=3pt,
  210. left=10pt,
  211. right=10pt,
  212. top=8pt,
  213. bottom=8pt,
  214. before skip=12pt,
  215. after skip=12pt,
  216. }
  217. % Critical Notice Box (Red) - For critical warnings or important notices
  218. \newtcolorbox{criticalnotice}[1][Critical Notice]{
  219. colback=lightred,
  220. colframe=criticalred,
  221. fonttitle=\bfseries\color{white},
  222. title=#1,
  223. coltitle=white,
  224. colbacktitle=criticalred,
  225. boxrule=1pt,
  226. arc=3pt,
  227. left=10pt,
  228. right=10pt,
  229. top=8pt,
  230. bottom=8pt,
  231. before skip=12pt,
  232. after skip=12pt,
  233. }
  234. % Definition Box (Gray) - For definitions, notes, supplementary info
  235. \newtcolorbox{definition}[1][Definition]{
  236. colback=lightgray,
  237. colframe=mediumgray,
  238. fonttitle=\bfseries\color{darkgray},
  239. title=#1,
  240. coltitle=darkgray,
  241. colbacktitle=lightgray,
  242. boxrule=0.5pt,
  243. arc=3pt,
  244. left=10pt,
  245. right=10pt,
  246. top=8pt,
  247. bottom=8pt,
  248. before skip=12pt,
  249. after skip=12pt,
  250. }
  251. % Executive Summary Box (Special styling with shadow)
  252. \newtcolorbox{executivesummary}[1][Executive Summary]{
  253. enhanced,
  254. colback=white,
  255. colframe=primaryblue,
  256. fonttitle=\Large\bfseries\color{white},
  257. title=#1,
  258. coltitle=white,
  259. colbacktitle=primaryblue,
  260. boxrule=2pt,
  261. arc=5pt,
  262. left=15pt,
  263. right=15pt,
  264. top=12pt,
  265. bottom=12pt,
  266. before skip=15pt,
  267. after skip=15pt,
  268. shadow={2mm}{-2mm}{0mm}{black!20},
  269. }
  270. % Hypothesis Box (Light blue with border) - For stating hypotheses
  271. \newtcolorbox{hypothesis}[1][Hypothesis]{
  272. enhanced,
  273. colback=lightblue!50,
  274. colframe=accentblue,
  275. fonttitle=\bfseries\color{white},
  276. title=#1,
  277. coltitle=white,
  278. colbacktitle=accentblue,
  279. boxrule=1pt,
  280. arc=3pt,
  281. left=10pt,
  282. right=10pt,
  283. top=8pt,
  284. bottom=8pt,
  285. before skip=12pt,
  286. after skip=12pt,
  287. }
  288. % ============================================================================
  289. % PULL QUOTE ENVIRONMENT
  290. % ============================================================================
  291. \newtcolorbox{pullquote}{
  292. enhanced,
  293. colback=lightgray,
  294. colframe=lightgray,
  295. boxrule=0pt,
  296. borderline west={4pt}{0pt}{primaryblue},
  297. arc=0pt,
  298. left=15pt,
  299. right=15pt,
  300. top=10pt,
  301. bottom=10pt,
  302. before skip=15pt,
  303. after skip=15pt,
  304. fontupper=\large\itshape\color{darkgray},
  305. }
  306. % ============================================================================
  307. % STATISTIC HIGHLIGHT BOX
  308. % ============================================================================
  309. \newcommand{\statbox}[2]{%
  310. \begin{tcolorbox}[
  311. colback=primaryblue,
  312. colframe=primaryblue,
  313. coltext=white,
  314. arc=5pt,
  315. boxrule=0pt,
  316. width=0.3\textwidth,
  317. halign=center,
  318. valign=center,
  319. before skip=10pt,
  320. after skip=10pt,
  321. ]
  322. {\Huge\bfseries #1}\\[5pt]
  323. {\small #2}
  324. \end{tcolorbox}
  325. }
  326. % ============================================================================
  327. % TABLE STYLING
  328. % ============================================================================
  329. % Alternating row colors command
  330. \newcommand{\tablerowcolor}{\rowcolor{tablealt}}
  331. % Table header styling
  332. \newcommand{\tableheader}[1]{\textbf{\color{white}#1}}
  333. \newcommand{\tableheaderrow}{\rowcolor{primaryblue}}
  334. % Professional table environment
  335. \newenvironment{sciencetable}[2][htbp]{%
  336. \begin{table}[#1]
  337. \centering
  338. \caption{#2}
  339. \small
  340. }{%
  341. \end{table}
  342. }
  343. % ============================================================================
  344. % FIGURE STYLING
  345. % ============================================================================
  346. % Caption formatting
  347. \captionsetup{
  348. font=small,
  349. labelfont={bf,color=primaryblue},
  350. textfont={color=darkgray},
  351. justification=centering,
  352. margin=20pt,
  353. }
  354. % Figure with source attribution
  355. \newcommand{\figuresource}[1]{%
  356. \par\vspace{-8pt}
  357. {\small\textit{Source: #1}}
  358. }
  359. % Figure note
  360. \newcommand{\figurenote}[1]{%
  361. \par\vspace{-8pt}
  362. {\small\textit{Note: #1}}
  363. }
  364. % ============================================================================
  365. % LIST STYLING
  366. % ============================================================================
  367. % Bullet list styling with blue bullets
  368. \setlist[itemize]{
  369. leftmargin=*,
  370. label=\textcolor{primaryblue}{\textbullet},
  371. topsep=5pt,
  372. itemsep=3pt,
  373. }
  374. % Numbered list styling with blue numbers
  375. \setlist[enumerate]{
  376. leftmargin=*,
  377. label=\textcolor{primaryblue}{\arabic*.},
  378. topsep=5pt,
  379. itemsep=3pt,
  380. }
  381. % ============================================================================
  382. % SCIENTIFIC NOTATION COMMANDS
  383. % ============================================================================
  384. % Highlight important text
  385. \newcommand{\highlight}[1]{\textbf{\textcolor{primaryblue}{#1}}}
  386. % P-value formatting (with significance indicators)
  387. \newcommand{\pvalue}[1]{%
  388. \textit{p}~=~#1%
  389. }
  390. % Significant p-value (bold)
  391. \newcommand{\psig}[1]{%
  392. \textbf{\textit{p}~=~#1}%
  393. }
  394. % Confidence interval
  395. \newcommand{\CI}[2]{%
  396. 95\% CI [#1, #2]%
  397. }
  398. % Effect size formatting
  399. \newcommand{\effectsize}[2]{%
  400. #1~=~#2%
  401. }
  402. % Sample size
  403. \newcommand{\samplesize}[1]{%
  404. \textit{n}~=~#1%
  405. }
  406. % Mean with SD
  407. \newcommand{\meansd}[2]{%
  408. #1~$\pm$~#2%
  409. }
  410. % Significance indicators
  411. \newcommand{\sigone}{\textsuperscript{*}} % p < 0.05
  412. \newcommand{\sigtwo}{\textsuperscript{**}} % p < 0.01
  413. \newcommand{\sigthree}{\textsuperscript{***}} % p < 0.001
  414. \newcommand{\signs}{\textsuperscript{ns}} % not significant
  415. % Significance legend (for table footnotes)
  416. \newcommand{\siglegend}{%
  417. \textsuperscript{*}\textit{p}~<~0.05;
  418. \textsuperscript{**}\textit{p}~<~0.01;
  419. \textsuperscript{***}\textit{p}~<~0.001;
  420. \textsuperscript{ns}not significant%
  421. }
  422. % ============================================================================
  423. % STATUS INDICATORS
  424. % ============================================================================
  425. % Trend indicators
  426. \newcommand{\trendup}{\textcolor{darkgreen}{$\blacktriangle$}}
  427. \newcommand{\trenddown}{\textcolor{criticalred}{$\blacktriangledown$}}
  428. \newcommand{\trendflat}{\textcolor{mediumgray}{$\rightarrow$}}
  429. % Quality/Rating indicators
  430. \newcommand{\qualityhigh}{\textbf{\textcolor{darkgreen}{HIGH}}}
  431. \newcommand{\qualitymedium}{\textbf{\textcolor{cautionorange}{MEDIUM}}}
  432. \newcommand{\qualitylow}{\textbf{\textcolor{criticalred}{LOW}}}
  433. % Evidence strength
  434. \newcommand{\evidencestrong}{\textbf{\textcolor{darkgreen}{Strong}}}
  435. \newcommand{\evidencemoderate}{\textbf{\textcolor{cautionorange}{Moderate}}}
  436. \newcommand{\evidenceweak}{\textbf{\textcolor{criticalred}{Weak}}}
  437. % ============================================================================
  438. % TITLE PAGE COMMAND
  439. % ============================================================================
  440. \newcommand{\makereporttitle}[5]{%
  441. % #1 = Report Title
  442. % #2 = Subtitle
  443. % #3 = Author(s)
  444. % #4 = Institution/Organization
  445. % #5 = Date
  446. \begin{titlepage}
  447. \centering
  448. \vspace*{2cm}
  449. {\Huge\bfseries\color{primaryblue} #1\\[0.5cm]}
  450. {\LARGE #2\\[2cm]}
  451. \vspace{2cm}
  452. {\Large\bfseries #3\\[0.5cm]}
  453. {\large #4\\[2cm]}
  454. {\large\bfseries Date: #5\\[0.3cm]}
  455. \vfill
  456. \begin{tikzpicture}
  457. \fill[primaryblue] (0,0) rectangle (\textwidth,0.5);
  458. \end{tikzpicture}
  459. \end{titlepage}
  460. }
  461. % Alternative title page with image
  462. \newcommand{\makereporttitlewithimage}[6]{%
  463. % #1 = Report Title
  464. % #2 = Subtitle
  465. % #3 = Hero Image Path
  466. % #4 = Author(s)
  467. % #5 = Institution/Organization
  468. % #6 = Date
  469. \begin{titlepage}
  470. \centering
  471. \vspace*{1cm}
  472. {\Huge\bfseries\color{primaryblue} #1\\[0.5cm]}
  473. {\LARGE #2\\[1.5cm]}
  474. \ifx&#3&
  475. \vspace{4cm}
  476. \else
  477. \includegraphics[width=0.8\textwidth]{#3}\\[1.5cm]
  478. \fi
  479. {\Large\bfseries #4\\[0.5cm]}
  480. {\large #5\\[1.5cm]}
  481. {\large\bfseries Date: #6}
  482. \vfill
  483. \begin{tikzpicture}
  484. \fill[primaryblue] (0,0) rectangle (\textwidth,0.5);
  485. \end{tikzpicture}
  486. \end{titlepage}
  487. }
  488. % ============================================================================
  489. % APPENDIX SECTION COMMAND
  490. % ============================================================================
  491. \newcommand{\appendixsection}[1]{%
  492. \section*{#1}
  493. \addcontentsline{toc}{section}{#1}
  494. }
  495. % ============================================================================
  496. % PAGE LAYOUT ADJUSTMENTS
  497. % ============================================================================
  498. % Spacing
  499. \setstretch{1.15}
  500. \setlength{\parskip}{0.5em}
  501. % Prevent orphans and widows
  502. \clubpenalty=10000
  503. \widowpenalty=10000
  504. % Float placement
  505. \renewcommand{\topfraction}{0.9}
  506. \renewcommand{\bottomfraction}{0.8}
  507. \renewcommand{\textfraction}{0.07}
  508. \renewcommand{\floatpagefraction}{0.7}
  509. % ============================================================================
  510. % END OF STYLE FILE
  511. % ============================================================================
  512. \endinput