diff --git a/liuthesis.cls b/liuthesis.cls
index 6669001b2bb41d8829f53168bc283f2df2cef308..7997f734aaa4b674b1855adfc786a2e78068ac5f 100644
--- a/liuthesis.cls
+++ b/liuthesis.cls
@@ -118,6 +118,7 @@
 \createvariable{examiner}
 \createvariable{titleenglish}
 \createvariable{titleswedish}
+\renewcommand{\@title}{\ifx\@titleenglish\@empty\@titleswedish\else\@titleenglish\fi}
 \createvariable{keywords}
 \createvariable{keywordsswedish}
 \createvariable{department}
@@ -301,14 +302,72 @@
 
 \LoadClass{memoir}
 
-\RequirePackage{color}
-\RequirePackage[svgnames]{xcolor}
+\RequirePackage[cmyk,svgnames,hyperref]{xcolor}
 \RequirePackage{pdfpages}
 \RequirePackage{tikz}
 \RequirePackage{pbox}
 \RequirePackage{ifthen}
 \RequirePackage{geometry}
-\RequirePackage[pdfusetitle]{hyperref}
+%%%%%%%%%% PDF/A and PDF/X support
+% https://tex.stackexchange.com/questions/474197/pdfx-incomplete-cidset-in-some-fonts/474336#474336
+\ifluatex
+\pdfvariable omitcidset=1
+\fi
+\RequirePackage[pdfa,pdfusetitle,bookmarks=false]{hyperref} %bookmarks are incompatible with PDF/X<6
+\RequirePackage{hyperxmp}[2020/06/15]
+\RequirePackage{cmap}
+\RequirePackage{colorprofiles}
+\ifxetex
+  \def\OBJ@CMYK{@colorprofile}%
+  \immediate\special{pdf:fstream \OBJ@CMYK (\colorpro@cmyk@profile) <</N 4>>}%
+  \def\pdfcatalog#1{\special{pdf:put @catalog <<#1>>}}
+  \def\pdfpageattr#1{\special{pdf:put @thispage <<#1>>}}
+\else
+  \immediate\pdfobj stream attr{/N 4} file {\colorpro@cmyk@profile}%
+  \edef\OBJ@CMYK{\the\pdflastobj\space 0 R}%
+\fi
+\pdfcatalog{%
+  /OutputIntents [ <<
+    /Type /OutputIntent
+    /S/GTS_PDFA1
+    /DestOutputProfile \OBJ@CMYK
+    /OutputConditionIdentifier (\colorpro@cmyk@intent)
+    /Info(FOGRA39L)
+    /OutputCondition(\colorpro@cmyk@identifier)
+    /RegistryName(\colorpro@cmyk@registry)
+  >>
+  <<
+    /Type /OutputIntent
+    /S/GTS_PDFX
+    /DestOutputProfile \OBJ@CMYK
+    /OutputConditionIdentifier (\colorpro@cmyk@intent)
+    /Info(FOGRA39L)
+    /OutputCondition(\colorpro@cmyk@identifier)
+    /RegistryName(\colorpro@cmyk@registry)
+  >> ]
+}
+% Bugfix of hyperref to produce CMYK links
+\let\HyColor@HyperrefBorderColor\HyColor@XZeroOneThreeFour
+% Tell PDF/X the final format of the paper
+\@tempdima=0.99626400996264009962\paperwidth
+\edef\boxwd{\strip@pt\@tempdima}
+\@tempdima=0.99626400996264009962\paperheight
+\edef\boxht{\strip@pt\@tempdima}
+\edef\next{%
+  \protect\pdfpageattr{
+    /TrimBox[0.0 0.0 \boxwd\space \boxht]
+  }%
+}
+\next
+\hypersetup{%
+    pdfdisplaydoctitle=true,
+    pdftrapped=False,
+    pdfapart=2,
+    pdfaconformance=B,
+    pdfuapart=1,
+    pdfxstandard={PDF/X-4},
+}
+%%%%%%%%%% end PDF/A and PDF/X support
 \RequirePackage{amssymb}
 \RequirePackage{amsmath}
 \RequirePackage{etoolbox}
diff --git a/pdftopdfa b/pdftopdfa
new file mode 100755
index 0000000000000000000000000000000000000000..9c9fc23d33c5a90bcfd95c329a32218226080447
--- /dev/null
+++ b/pdftopdfa
@@ -0,0 +1,7 @@
+#! /usr/bin/env bash
+filename=$(basename $1 .pdf)
+gs -dPDFA -dBATCH -dNOPAUSE \
+  -sColorConversionStrategy=UseDeviceIndependentColor \
+  -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=2       \
+  -sOutputFile=$filename-pdfa.pdf \
+  $1
diff --git a/scigen-orig.pdf b/scigen-orig.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..cb8c21cc2256c22d775d5b38d6a2379942fcba66
Binary files /dev/null and b/scigen-orig.pdf differ
diff --git a/scigen.pdf b/scigen.pdf
index cb8c21cc2256c22d775d5b38d6a2379942fcba66..79a6acb1579da481e2e33bc4c65747b097f326ad 100644
Binary files a/scigen.pdf and b/scigen.pdf differ