feat(latex): enhance keywords command to update PDF keywords metadata
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
\RequirePackage{tocbibind}
|
\RequirePackage{tocbibind}
|
||||||
\RequirePackage{indentfirst}
|
\RequirePackage{indentfirst}
|
||||||
\RequirePackage{float}
|
\RequirePackage{float}
|
||||||
|
\RequirePackage{atbegshi}
|
||||||
\RequirePackage{amsmath,amsfonts,amssymb}
|
\RequirePackage{amsmath,amsfonts,amssymb}
|
||||||
\RequirePackage[style=apa,%
|
\RequirePackage[style=apa,%
|
||||||
% dateabbrev=false,% when false, don't abbreviate months/year divisions
|
% dateabbrev=false,% when false, don't abbreviate months/year divisions
|
||||||
@@ -467,18 +468,28 @@
|
|||||||
\fi%
|
\fi%
|
||||||
\fi%
|
\fi%
|
||||||
}
|
}
|
||||||
\makeatother
|
|
||||||
|
|
||||||
|
% 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]{%
|
\newcommand{\keywords}[1]{%
|
||||||
% \vspace{1em}%
|
\bigskip\noindent
|
||||||
\bigskip
|
|
||||||
\noindent%
|
|
||||||
\ifnum\strcmp{\languagename}{malay}=0
|
\ifnum\strcmp{\languagename}{malay}=0
|
||||||
Kata Kunci: \alphabubblesort{#1}\sortedlist%
|
Kata Kunci: \alphabubblesort{#1}\sortedlist%
|
||||||
\else
|
\else
|
||||||
\textit{Keywords: } \alphabubblesort{#1}\sortedlist%
|
\textit{Keywords: } \alphabubblesort{#1}\sortedlist%
|
||||||
\fi
|
\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.
|
% Change the text of the cross-reference links to the Slovene long version.
|
||||||
@@ -536,20 +547,26 @@
|
|||||||
\newcommand{\theuniversity}{\@university}
|
\newcommand{\theuniversity}{\@university}
|
||||||
\newcommand{\theyearofsubmission}{\@yearofsubmission}
|
\newcommand{\theyearofsubmission}{\@yearofsubmission}
|
||||||
|
|
||||||
|
\AtBeginDocument{%
|
||||||
|
\hypersetup{
|
||||||
|
pdftitle={\@title},
|
||||||
|
pdfauthor={\@author}
|
||||||
|
}%
|
||||||
|
}
|
||||||
% Ensure title/author/date get expanded correctly in hypersetup
|
% Ensure title/author/date get expanded correctly in hypersetup
|
||||||
% \hypersetup{
|
\hypersetup{
|
||||||
% pdftitle={\@title},
|
% pdftitle={gfhfdhfd},
|
||||||
% pdfauthor={\@author},
|
% pdfauthor={\@authorid},
|
||||||
% pdfdate={\@date},
|
% pdfdate={\@date},
|
||||||
% pdfsubject={Bachelor Thesis},
|
pdfsubject={Bachelor Thesis},
|
||||||
% pdfkeywords={structural health monitoring, machine learning, stft, vibration, signal},
|
% pdfkeywords={\@keywordslist},
|
||||||
% pdfpublisher={Universitas Muhammadiyah Yogyakarta},
|
% pdfpublisher={Universitas Muhammadiyah Yogyakarta},
|
||||||
% pdfcontactemail={rifqi.damar.ft21@mail.umy.ac.id},
|
% pdfcontactemail={rifqi.damar.ft21@mail.umy.ac.id},
|
||||||
% pdflicenseurl={https://github.com/nuluh/thesis/blob/main/LICENSE},
|
% pdflicenseurl={https://github.com/nuluh/thesis/blob/main/LICENSE},
|
||||||
% pdflang={id},
|
pdflang={id},
|
||||||
% pdfcreator={XeLaTeX with hyperref and hyperxmp},
|
pdfcreator={XeLaTeX with hyperref and hyperxmp},
|
||||||
% pdfproducer={TeX Live 2024},
|
pdfproducer={TeX Live 2024},
|
||||||
% pdftrapped=False
|
pdftrapped=False
|
||||||
% }
|
}
|
||||||
\makeatother
|
\makeatother
|
||||||
\endinput
|
\endinput
|
||||||
Reference in New Issue
Block a user