[PATCH -perfbook 5/5] qqz.sty: Add page reference to QQA Appendix as the same as -nq build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The page references in -nq build are nice to have.
Add similar refs in other build targets.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 qqz.sty | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/qqz.sty b/qqz.sty
index 9b1d4c35..4e1a138a 100644
--- a/qqz.sty
+++ b/qqz.sty
@@ -59,8 +59,16 @@
 \newcommand{\QuickQuizAnswerChapter}{\textbf{Unknown QuickQAC!!!}}
 
 \newcommand{\QuickQHeading}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}}
+\IfNoQqz{
 \newcommand{\QuickQHeadingPage}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}%
 	\hfill\raisebox{0.5ex}{\footnotesize\fbox{p.\pageref{QQP.#3}}}}
+}{\IfQqzBg{
+\newcommand{\QuickQHeadingPage}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}%
+	\hfill\raisebox{0.5ex}{\footnotesize\fbox{p.\pageref{QQ.#3}}}}
+}{% draft build
+\newcommand{\QuickQHeadingPage}[3]{\hyperref[#2.#3]{\textbf{Quick Quiz #3:}}\label{#1.#3}%
+	\hfill{\footnotesize{[p.\pageref{QQ.#3}]}}}
+}}
 \newcommand{\QuickQHeadingLight}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3}}
 \newcommand{\QuickQHeadingBegin}[3]{\scriptsize QQ~\hyperref[#2.#3]{#3}\label{#1.#3},}
 \newcommand{\QuickQHeadingMiddle}[3]{\scriptsize\hyperref[#2.#3]{{ #3}}\label{#1.#3},}
@@ -213,7 +221,7 @@
 \newcommand{\QuickQ}[1]{
 	\begin{tcolorbox}[breakable]
 	\leavevmode\refstepcounter{quickquizctrC}%
-	\QuickQHeading{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} \\
+	\QuickQHeadingPage{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} \\
 }
 
 \newcommand{\QuickA}[1]{%
@@ -247,7 +255,7 @@
 	\par
 	\refstepcounter{quickquizctrC}%
 	\noindent
-	\QuickQHeading{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC} #1 ~ \\ }
+	\QuickQHeadingPage{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC}\\}
 
 \newcommand{\QuickA}[1]{%
 	\hyperref[QQ.\QuickQuizAnswerChapter.\thequickquizctrC]{\rule{7pt}{7pt}}
-- 
2.17.1





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux