From 48466647de3386339f58bbe58bf50cf7abefea05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Novotn=C3=BD?= <witiko@mail.muni.cz>
Date: Fri, 26 Mar 2021 13:00:34 +0100
Subject: [PATCH] Make LF MUNI use AMA bibliography

---
 style/mu/med.dtx | 42 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)

diff --git a/style/mu/med.dtx b/style/mu/med.dtx
index b3e0024..312afcf 100644
--- a/style/mu/med.dtx
+++ b/style/mu/med.dtx
@@ -15,7 +15,7 @@
 % akulte_MU.pdf}}.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fithesis/style/mu/fithesis-mu-med}[2021/02/26]
+\ProvidesPackage{fithesis/style/mu/fithesis-mu-med}[2021/03/26]
 %    \end{macrocode}
 % The file defines the color scheme of the respective faculty. Note
 % the the color definitions are in RGB, which makes the resulting
@@ -27,14 +27,50 @@
   tableOdd={HTML}{FFF5F6},
   tableEven={HTML}{FFDEDF}}
 %    \end{macrocode}
-% The bibliography support is enabled. The |authoryear| citations
+% The bibliography support is enabled. The |authortitle| citations
 % are used and the bibliography is sorted by year, name, and title.
 %    \begin{macrocode}
 \thesis@bibliography@setup{%
-  style=iso-authoryear,
+  style=authortitle,
   sorting=ynt}
 \thesis@bibliography@load
 %    \end{macrocode}
+% The AMA citation style is defined using |authortitle| as the basis.
+% The following code has been adapted from
+% \url{https://tex.stackexchange.com/a/233423/70941}.
+% \changes{v1.0.0}{2021/03/26}{^^A
+%   The Faculty of Medicine at the Masaryk University in Brno uses the
+%   AMA citation and reference style. [VN]}
+%    \begin{macrocode}
+\DeclareNameAlias{sortname}{last-first}
+\renewcommand*{\revsdnamepunct}{}
+\DeclareFieldFormat[%
+  article,inbook,incollection,inproceedings,patent,thesis,unpublished]%
+  {title}{{#1\isdot}}
+\renewbibmacro{in:}{}
+\DeclareFieldFormat{pages}{#1}
+\renewcommand*{\bibpagespunct}{\addcolon}
+\DeclareFieldFormat{journaltitle}{#1\addperiod}
+\DeclareFieldFormat{booktitle}{{#1}}
+\DeclareFieldFormat{title}{{#1}}
+\renewbibmacro*{journal+issuetitle}{%
+  \usebibmacro{journal}%
+  \setunit*{\addspace}%
+  \iffieldundef{series}
+  {}
+  {\newunit
+    \printfield{series}%
+    \setunit{\addspace}}%
+  \usebibmacro{issue+date}%
+  \setunit{\addsemicolon\addspace}%
+  \usebibmacro{volume+number+eid}%
+  \setunit{\addcolon\space}%
+  \usebibmacro{issue}%
+  \newunit%
+}
+\renewbibmacro*{issue+date}{\printfield{year}}
+\renewcommand*{\finalnamedelim}{\multinamedelim}
+%    \end{macrocode}
 % The file loads the following packages:
 % \begin{itemize}
 %   \item\textsf{tikz} -- Used for dimension arithmetic.
-- 
GitLab