Re: hyperrefとchappg併用時の索引について

名前: 山口博之
日時: 2005-01-13 10:13:08
IPアドレス: 192.51.44.*

>>33689 お返事ありがとうございます。 >>●上記に加え、33680の「▼と▲で囲まれた部分」 >> をコメント化したTeXソースからPDFを作成。 >少なくとも、この場合については私の実験結果とは異なります。 申し訳ありません。私の環境でもうまくいました。 ところが、私が実際にコンパイル対象としているTeXソースではうまくいきませんでした。 33680で提示したサンプルにdb2latexが生成したコードを 反映しきれていなかったようです。 少し長くなりますが、実際にコンパイルしているソースを提示させてください。 =備考= db2latexを使って、docbook xml から変換したTeXソースは、 以下の3つの部分からなります。 1. db2latexの入力として山口が記述したプリアンブル 後述のソース内では、▽と△で囲んだ部分がこれに該当します。 33683でご教示いただいた「hypertexnames=false のオプションを外す」と対処は、ここで実施しています。 2. db2latexが自動生成したプリアンプル 後述のソース内では、▼と▲で囲んだ部分がこれに該当します。 3. docbook xmlから変換されたTeXソース 後述のソース内では、↓と↑で囲んだ部分がこれに該当します。 実際にコンパイルしているソースは以下です。 % ▽ db2latexの入力として山口が記述したプリアンブル ▽▽▽▽▽▽▽▽ \documentclass[tombow,b5paper,10pt]{jsbook} \hoffset=-1.1cm%左へ 1.1cm 版面全体を移動 \usepackage{layout} % 脚注のインデントをそろえる \makeatletter \long\def\@makefntext#1{\parindent 1em\noindent \@hangfrom{\hbox to 1.8em{\hss$^{\@thefnmark}$}}#1} \makeatother \usepackage{chappg}% nonble style 1 2 3... → 1-1 1-2... 2-1 2-2... \usepackage[dvipdfm]{graphicx} \usepackage{float} \usepackage{times} \parindent = 0pt%すべての段落の字下げをなくす \setcounter{tocdepth}{2}%目次にsubsectionも出力する \usepackage[dvipdfm,% pdfdisplaydoctitle=true,% pageanchor,% bookmarks=true,%しおり付き[default は false] bookmarksnumbered=true,%章や節の番号をふる[default は false] bookmarkstype=toc,%目次情報のファイル[拡張子 toc]を参照 colorlinks=true,%ハイパーリンクを色枠ではなく色文字に[default は false] linkcolor=red,%link の文字色 red [default] citecolor=blue,%cite の文字色 blue [default は lime {0 1 0}] urlcolor={0 0 1},%url の文字色 blue [default] backref,% bookmarks,% breaklinks,% linktocpage,% pdftitle={DocBookからPDFへの変換調査},% pdfsubject={ドラフト0.0.1},% pdfauthor={山口博之},% pdfkeywords={TeX,dvipdfm,DB2LaTeX}% ]{hyperref} \AtBeginDvi{\special{pdf:tounicode 90ms-RKSJ-UCS2}} % Change caracter code from sjis to utf-8 for bookmark of PDF \hypersetup{pdfstartview={FitH -32768}}% PDF Start status is Fit Width \DeclareGraphicsExtensions{.eps} \usepackage{makeidx} \setlength{\textwidth}{\fullwidth} \setlength{\evensidemargin}{\oddsidemargin} % △ db2latexの入力として山口が記述したプリアンブル △△△△△△△△ % ▼ db2latexが生成したプリアンブル ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ \makeatletter \newcommand{\dbz}{\penalty \z@} \newcommand{\docbooktolatexpipe}{\ensuremath{|}\dbz} \newskip\docbooktolatexoldparskip \newcommand{\docbooktolatexnoparskip}{\docbooktolatexoldparskip=\parskip\parskip=0pt plus 1pt} \newcommand{\docbooktolatexrestoreparskip}{\parskip=\docbooktolatexoldparskip} \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} \usepackage[latin1]{inputenc} \ifx\dblatex@chaptersmark\@undefined\def\dblatex@chaptersmark#1{\markboth{\MakeUppercase{#1}}{}}\fi \let\save@makeschapterhead\@makeschapterhead \def\dblatex@makeschapterhead#1{\vspace*{-80pt}\save@makeschapterhead{#1}} \def\@makeschapterhead#1{\dblatex@makeschapterhead{#1}\dblatex@chaptersmark{#1}} \AtBeginDocument{\ifx\refname\@undefined\let\docbooktolatexbibname\bibname\def\docbooktolatexbibnamex{\bibname}\else\let\docbooktolatexbibname\refname\def\docbooktolatexbibnamex{\refname}\fi} % Facilitate use of \cite with \label \newcommand{\docbooktolatexbibaux}[2]{% \protected@write\@auxout{}{\string\global\string\@namedef{docbooktolatexcite@#1}{#2}} } % Provide support for bibliography `subsection' environments with titles \newenvironment{docbooktolatexbibliography}[3]{ \begingroup \let\save@@chapter\chapter \let\save@@section\section \let\save@@@mkboth\@mkboth \let\save@@bibname\bibname \let\save@@refname\refname \let\@mkboth\@gobbletwo \def\@tempa{#3} \def\@tempb{} \ifx\@tempa\@tempb \let\chapter\@gobbletwo \let\section\@gobbletwo \let\bibname\relax \else \let\chapter#2 \let\section#2 \let\bibname\@tempa \fi \let\refname\bibname \begin{thebibliography}{#1} }{ \end{thebibliography} \let\chapter\save@@chapter \let\section\save@@section \let\@mkboth\save@@@mkboth \let\bibname\save@@bibname \let\refname\save@@refname \endgroup } %\usepackage{cite} %\renewcommand\citeleft{(} % parentheses around list %\renewcommand\citeright{)} % parentheses around list \newcommand{\docbooktolatexcite}[2]{% \@ifundefined{docbooktolatexcite@#1}% {\cite{#1}}% {\def\@docbooktolatextemp{#2}\ifx\@docbooktolatextemp\@empty% \cite{\@nameuse{docbooktolatexcite@#1}}% \else\cite[#2]{\@nameuse{docbooktolatexcite@#1}}% \fi% }% } \newcommand{\docbooktolatexbackcite}[1]{% \ifx\Hy@backout\@undefined\else% \@ifundefined{docbooktolatexcite@#1}{% % emit warning? }{% \ifBR@verbose% \PackageInfo{backref}{back cite \string`#1\string' as \string`\@nameuse{docbooktolatexcite@#1}\string'}% \fi% \Hy@backout{\@nameuse{docbooktolatexcite@#1}}% }% \fi% } % -------------------------------------------- % A way to honour <footnoteref>s % Blame j-devenish (at) users.sourceforge.net % In any other LaTeX context, this would probably go into a style file. \newcommand{\docbooktolatexusefootnoteref}[1]{\@ifundefined{@fn@label@#1}% {\hbox{\@textsuperscript{\normalfont ?}}% \@latex@warning{Footnote label `#1' was not defined}}% {\@nameuse{@fn@label@#1}}} \newcommand{\docbooktolatexmakefootnoteref}[1]{% \protected@write\@auxout{}% {\global\string\@namedef{@fn@label@#1}{\@makefnmark}}% \@namedef{@fn@label@#1}{\hbox{\@textsuperscript{\normalfont ?}}}% } % index labeling helper \newif\ifdocbooktolatexprintindex\docbooktolatexprintindextrue \let\dbtolatex@@theindex\theindex \let\dbtolatex@@endtheindex\endtheindex \def\theindex{\relax} \def\endtheindex{\relax} \newenvironment{dbtolatexindex}[1] { \if@openright\cleardoublepage\else\clearpage\fi \let\dbtolatex@@indexname\indexname \def\dbtolatex@indexlabel{% \ifnum \c@secnumdepth >\m@ne \refstepcounter{chapter}\fi% \label{#1}\hypertarget{#1}{\dbtolatex@@indexname}% \global\docbooktolatexprintindexfalse} \def\indexname{\ifdocbooktolatexprintindex\dbtolatex@indexlabel\else\dbtolatex@@indexname\fi} \dbtolatex@@theindex } { \dbtolatex@@endtheindex\let\indexname\dbtolatex@@indexname } \newlength\saveparskip \newlength\saveparindent \newlength\tempparskip \newlength\tempparindent \def\docbooktolatexgobble{\expandafter\@gobble} % Prevent multiple openings of the same aux file % (happens when backref is used with multiple bibliography environments) \ifx\AfterBeginDocument\undefined\let\AfterBeginDocument\AtBeginDocument\fi \AfterBeginDocument{ \let\latex@@starttoc\@starttoc \def\@starttoc#1{% \@ifundefined{docbooktolatex@aux#1}{% \global\@namedef{docbooktolatex@aux#1}{}% \latex@@starttoc{#1}% }{} } } % -------------------------------------------- % Hacks for honouring row/entry/@align % (\hspace not effective when in paragraph mode) % Naming convention for these macros is: % 'docbooktolatex' 'align' {alignment-type} {position-within-entry} % where r = right, l = left, c = centre \newcommand{\docbooktolatex@align}[2]{\protect\ifvmode#1\else\ifx\LT@@tabarray\@undefined#2\else#1\fi\fi} \newcommand{\docbooktolatexalignll}{\docbooktolatex@align{\raggedright}{}} \newcommand{\docbooktolatexalignlr}{\docbooktolatex@align{}{\hspace*\fill}} \newcommand{\docbooktolatexaligncl}{\docbooktolatex@align{\centering}{\hfill}} \newcommand{\docbooktolatexaligncr}{\docbooktolatex@align{}{\hspace*\fill}} \newcommand{\docbooktolatexalignrl}{\protect\ifvmode\raggedleft\else\hfill\fi} \newcommand{\docbooktolatexalignrr}{} \ifx\captionswapskip\@undefined\newcommand{\captionswapskip}{}\fi \makeatother \title{\bfseries DocBookからPDFへの変換調査VxxLxx/xx.x} \author{Hiroyuki Yamaguchi} % -------------------------------------------- \makeindex \makeglossary % -------------------------------------------- \setcounter{tocdepth}{4} \setcounter{secnumdepth}{4} % ▲ db2latexが生成したプリアンブル ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ % ↓ docbook xml から変換されたTeXソース ↓↓↓↓↓↓↓↓↓↓↓↓↓ \begin{document} \InputIfFileExists{title}{\typeout{WARNING: Using cover page title}}{\maketitle\pagestyle{fancy} \thispagestyle{empty}} \begin{center}Copyright \copyright{} 2005 山口博之\end{center} \frontmatter\tableofcontents\mainmatter % ------------------------------------------------------------- % Chapter ○○のご紹介\index{まるまるのごしょうかい@{{○○のご紹介}}} % ------------------------------------------------------------- \chapter{○○のご紹介\index{まるまるのごしょうかい@{{○○のご紹介}}}} \label{intro}\hypertarget{intro}{}% 利用するソフトウェアの概要を記載。 \newpage % ------------------------ % Section \section{○○の概要} \label{id4664354}\hypertarget{id4664354}{}% 位置付け・役割・何を管理するか(対象)などを記載。 \newpage % ------------------------ % Section \section{△△の主な機能\index{さんかくさんかくのおもなきのう@{{△△の主な機能}}}} \label{FunctionOutline}\hypertarget{FunctionOutline}{}% 各機能(大機能レベル)の概要を記載。 \newpage % ------------------------ % Section \section{××の製品構成\index{ばつばつのせいひんこうせい@{{××の製品構成}}}} \label{ComponentOutline}\hypertarget{ComponentOutline}{}% システムを構成するコンポーネントと、コンポーネントの概要を記載。 \newpage % ------------------------ % Section \section{□□のシステム構成\index{しかくしかくのしすてむこうせい@{{□□のシステム構成}}}} \label{SystemVariation}\hypertarget{SystemVariation}{}% 基本的なシステム構成から、応用的なシステム構成までを記載。 説明を記載。 \newpage % ------------------------ % Section \section{◎◎の運用イメージ} \label{id4662805}\hypertarget{id4662805}{}% 運用イメージを記載。 \setlength\saveparskip\parskip \setlength\saveparindent\parindent \begin{dbtolatexindex}{id4663728} \setlength\tempparskip\parskip \setlength\tempparindent\parindent \parskip\saveparskip \parindent\saveparindent \noindent \indexspace \parskip\tempparskip \parindent\tempparindent \makeatletter\@input@{\jobname.ind}\makeatother \addcontentsline{toc}{chapter}{索引} \end{dbtolatexindex} \end{document} % ↑ docbook xml から変換されたTeXソース ↑↑↑↑↑↑↑↑↑↑↑↑↑ 以上です。

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます)