PDF ブックマークのセクション番号の末尾にドットを追加する

PDF ブックマークのセクション番号の末尾にドットを追加する

パッケージを使用して、セクション、サブセクションなどのタイトルの末尾にドットを挿入していますsecdot。また、PDF ブックマークの各セクション番号の末尾にもドットを挿入したいと思います ( を使用していますhyperref)。

以下は、私が実現したいことのスクリーンショット (左側のブックマークのセクション 5 を参照) と、最小限の動作例 (問題や衝突を引き起こす可能性のあるパッケージとプリアンブルの一部が含まれています) です。

ムウェ

\documentclass[12pt]{article}

\usepackage[a4paper, hscale=0.85, vscale=0.85]{geometry}
\usepackage[T1]{fontenc}
\usepackage{url}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage[dotinlabels]{titletoc}
\usepackage{secdot}

\hypersetup{bookmarks=true,%
    bookmarksnumbered=true,%
    pdfencoding=unicode,%
    colorlinks=true,%
    pdfborder={0 0 0},%
    linkcolor=red,%
    menucolor=green,%
    citecolor=blue,%
    urlcolor=blue,%
    filecolor=blue}

\sectiondot{section}
\sectiondot{subsection}
\sectiondot{subsubsection}
\sectiondot{paragraph}
\sectiondot{subparagraph}

% changing the style of \paragraph and \subparagraph titles, so
% text after \paragraph and \subparagraph are broken into new lines
\makeatletter
    \renewcommand\paragraph{%
        \@startsection{paragraph}{4}{0mm}%
            {-\baselineskip}%
            {.3\baselineskip}%
            {\normalfont\normalsize\bfseries}}
    \renewcommand\subparagraph{%
        \@startsection{subparagraph}{5}{0mm}%
            {-\baselineskip}%
            {.3\baselineskip}%
            {\normalfont\normalsize\bfseries}}
\makeatother

\setcounter{secnumdepth}{5}


\begin{document}

\section{section}

section

\subsection{subsection}

subsection

\subsubsection{subsubsection}

subsubsection

\paragraph{paragraph}

paragraph

\subparagraph{subparagraph}

subparagraph

\end{document}

のコードを調べ始めましたhyperrefが、変更/パッチ/更新する必要がある部分を見つけることができませんでした。

答え1

hyperrefは、この書式を に格納します\Hy@numberline。したがって、次の再定義では、.すべてのセクション番号単位の後に が追加されます。

\makeatletter
\renewcommand{\Hy@numberline}[1]{#1. }
\makeatother

序文のどこかに追加してください読み込み中hyperref

ここに画像の説明を入力してください

関連情報