feat(latex): enhance keywords command to update PDF keywords metadata
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
\RequirePackage{tocbibind}
|
||||
\RequirePackage{indentfirst}
|
||||
\RequirePackage{float}
|
||||
\RequirePackage{atbegshi}
|
||||
\RequirePackage{amsmath,amsfonts,amssymb}
|
||||
\RequirePackage[style=apa,%
|
||||
% dateabbrev=false,% when false, don't abbreviate months/year divisions
|
||||
@@ -466,19 +467,29 @@
|
||||
\fi%
|
||||
\fi%
|
||||
\fi%
|
||||
}
|
||||
\makeatother
|
||||
}
|
||||
|
||||
\newcommand{\keywords}[1]{%
|
||||
% \vspace{1em}%
|
||||
\bigskip
|
||||
\noindent%
|
||||
% Wrap your existing \keywords so it:
|
||||
% 1) computes \sortedlist
|
||||
% 2) prints it
|
||||
% 3) also updates PDF metadata for XeLaTeX via xdvipdfmx \special
|
||||
\newcommand{\keywords}[1]{%
|
||||
\bigskip\noindent
|
||||
\ifnum\strcmp{\languagename}{malay}=0
|
||||
Kata Kunci: \alphabubblesort{#1}\sortedlist%
|
||||
\else
|
||||
\textit{Keywords:} \alphabubblesort{#1}\sortedlist%
|
||||
\textit{Keywords: } \alphabubblesort{#1}\sortedlist%
|
||||
\fi
|
||||
% -- store for metadata --
|
||||
\gdef\SortedKeywords{\sortedlist}%
|
||||
% Sanitize for PDF string (escapes parentheses, makes nice unicode)
|
||||
\pdfstringdef\kwpdf{\SortedKeywords}%
|
||||
% For XeLaTeX/xdvipdfmx, override PDF docinfo directly; the last call wins.
|
||||
\immediate\special{pdf:docinfo << /Keywords (\kwpdf) >>}%
|
||||
% If you also want hyperref’s internal copy updated (harmless):
|
||||
\hypersetup{pdfkeywords={\SortedKeywords}}%
|
||||
}
|
||||
\makeatother
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
% Change the text of the cross-reference links to the Slovene long version.
|
||||
@@ -536,20 +547,26 @@
|
||||
\newcommand{\theuniversity}{\@university}
|
||||
\newcommand{\theyearofsubmission}{\@yearofsubmission}
|
||||
|
||||
\AtBeginDocument{%
|
||||
\hypersetup{
|
||||
pdftitle={\@title},
|
||||
pdfauthor={\@author}
|
||||
}%
|
||||
}
|
||||
% Ensure title/author/date get expanded correctly in hypersetup
|
||||
% \hypersetup{
|
||||
% pdftitle={\@title},
|
||||
% pdfauthor={\@author},
|
||||
% pdfdate={\@date},
|
||||
% pdfsubject={Bachelor Thesis},
|
||||
% pdfkeywords={structural health monitoring, machine learning, stft, vibration, signal},
|
||||
% pdfpublisher={Universitas Muhammadiyah Yogyakarta},
|
||||
% pdfcontactemail={rifqi.damar.ft21@mail.umy.ac.id},
|
||||
% pdflicenseurl={https://github.com/nuluh/thesis/blob/main/LICENSE},
|
||||
% pdflang={id},
|
||||
% pdfcreator={XeLaTeX with hyperref and hyperxmp},
|
||||
% pdfproducer={TeX Live 2024},
|
||||
% pdftrapped=False
|
||||
% }
|
||||
\hypersetup{
|
||||
% pdftitle={gfhfdhfd},
|
||||
% pdfauthor={\@authorid},
|
||||
% pdfdate={\@date},
|
||||
pdfsubject={Bachelor Thesis},
|
||||
% pdfkeywords={\@keywordslist},
|
||||
% pdfpublisher={Universitas Muhammadiyah Yogyakarta},
|
||||
% pdfcontactemail={rifqi.damar.ft21@mail.umy.ac.id},
|
||||
% pdflicenseurl={https://github.com/nuluh/thesis/blob/main/LICENSE},
|
||||
pdflang={id},
|
||||
pdfcreator={XeLaTeX with hyperref and hyperxmp},
|
||||
pdfproducer={TeX Live 2024},
|
||||
pdftrapped=False
|
||||
}
|
||||
\makeatother
|
||||
\endinput
|
||||
Reference in New Issue
Block a user