All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: perfbook@vger.kernel.org
Subject: Re: [PATCH -perfbook 0/5] Updates of qqz.sty
Date: Wed, 14 Apr 2021 22:11:33 -0700	[thread overview]
Message-ID: <20210415051133.GD4510@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <2089a81a-4f58-398d-1bce-c3ecc307c12c@gmail.com>

On Thu, Apr 15, 2021 at 12:49:18PM +0900, Akira Yokosawa wrote:
> On Wed, 14 Apr 2021 10:31:23 -0700, Paul E. McKenney wrote:
> > On Wed, Apr 14, 2021 at 07:47:51PM +0900, Akira Yokosawa wrote:
> >> Hi Paul,
> >>
> >> A change in upstream hyperref package (v7.00j) breaks code in
> >> qqz.sty.
> >> Now, \refstepcounter in vertical mode can cause a page break.
> >> Our use of \refstepcounter in framed Quick Quiz is in vertical
> >> mode and if a page break happens at that point, destination point
> >> set by \refstepcounter is discarded by tcolorbox, which results in
> >> a missing destination.
> >>
> >> This can be fixed by leaving vertical mode in front of \refstepcounter,
> >> which is what Patch 1/5 does.
> >>
> >> The updated code is compatible with older versions of hyperref as
> >> long as our usage patterns are concerned.
> >> Aa a bonus, new link-target positions look nicer (not too close to the
> >> "Quick Quiz" labels).
> >>
> >> Patches 2/5--4/5 are (in my opinion) improvements to the -nq build.
> >> Seeing both Quizzes and Answers in the final section, one would
> >> just see the answer without taking time to think about a quiz.
> >> So these patches modify the -nq build so that chapter-wise sections
> >> have only the quiz parts.
> >> Answers are presented in Appendix E in the same way as the other
> >> builds.
> >>
> >> Patch 5/5 adds page references in the answers of non-nq builds.
> > 
> > Good points, queued and pushed, thank you!
> > 
> > On interesting thing is that if you click on the small bubble in the
> > text, you are taken to the corresponding QQ at the end of that chapter.
> > If you click on the square, you are taken to the answer.  If you click
> > on the page number in the square in the upper right-hand corner of the
> > QQ question, you get taken back to the original small bubble, all of
> > which is goodness.
> > 
> > However, if you click on the either black square at the end of the
> > question or the white shadowed square at the end of the answer, you get
> > taken back to the small bubble in the text.
> 
> Ya, that's as described in the commit log of Patch 2/5:
> 
>     o Hyperlinks are made in the following way:
> 
>       - Inline QQ marker -> Chapter-wise Quiz -> Answer in Appendix
>       - Page number marker in Quiz part -> Inline QQ marker
>       - Answer in Appendix -> Inline QQ marker

OK, my reading comprehension was clearly substandard.  :-/

> > Is it possible that some of our readers will expect that these two squares
> > will instead take them back to the question at the end of the chapter?
> 
> It is possible, but the white box at the end of the answer is supposed
> to be a short-cut for those wanting to resume reading text.

True enough.

> So, appended is a compromise modifying the links of "Quick Quiz"
> and black box in the answer to go back to chapter-wise quiz section.
> 
> Thoughts?

It does work well, and removes one layer of clicking that otherwise
needs to happen.  Let's see what people think about it.

We also have the page-number marker that goes back to the text, so we do
have the option of making the black and white boxes go to the beginning
and end of the quick-quiz box at the end of the chapter.  But again,
let's see how this patch works for people.

Any objection to my pushing it as is, or should I wait for a second
version.  (I have queued it, but not yet pushed it out.)

							Thanx, Paul

>        Thanks, Akira 
> 
> > This is probably not a big deal, given that clicking on the small bubble
> > will take them to that list, but I figured that it was worth asking
> > the question.
> > 
> > 							Thanx, Paul
> > 
> >>         Thanks, Akira
> [...]
> 
> ----8<--------
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Thu, 15 Apr 2021 12:31:26 +0900
> Subject: [PATCH] qqz.sty: Link chapter-wise quizzes from answers in -nq build
> 
> Paul's suggestion:
> 
>     However, if you click on the either black square at the end of
>     the question or the white shadowed square at the end of the answer,
>     you get taken back to the small bubble in the text.
> 
>     Is it possible that some of our readers will expect that these
>     two squares will instead take them back to the question at the
>     end of the chapter?
> 
> Akira's take on reader's expectation:
> 
>     The white boxes at the end of answers are meant as short-cuts to
>     go back to the text by a single click for those want to resume
>     reading.
> 
> So, this commit is a compromise and changes the link of "Quick Quiz"
> and black square so that they go back to the chapter-end quiz.
> The white box at the end of the answer is kept linking back to the
> small bubble in the text.
> 
> Also add a tail comment in \QuickQE to avoid an extra skip in front
> of the black square.
> 
> Suggested-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
>  qqz.sty | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/qqz.sty b/qqz.sty
> index 4e1a138a..86b50c79 100644
> --- a/qqz.sty
> +++ b/qqz.sty
> @@ -235,7 +235,7 @@
>  	\QuickQHeadingPage{QQ}{QQA}{\thechapter.\thequickquizctr}\\
>  }
>  
> -\newcommand{\QuickQE}[1]{
> +\newcommand{\QuickQE}[1]{%
>  	\hyperref[QQA.\thechapter.\thequickquizctr]{\rule{7pt}{7pt}}%
>  	\end{tcolorbox}
>  }
> @@ -243,11 +243,11 @@
>  \newcommand{\QuickQ}[1]{
>  	\begin{tcolorbox}[breakable]
>  	\leavevmode\refstepcounter{quickquizctrC}%
> -	\QuickQHeadingPage{QQA}{QQP}{\QuickQuizAnswerChapter.\thequickquizctrC}\\
> +	\QuickQHeadingPage{QQA}{QQ}{\QuickQuizAnswerChapter.\thequickquizctrC}\\
>  }
>  
>  \newcommand{\QuickA}[1]{%
> -	\hyperref[QQP.\QuickQuizAnswerChapter.\thequickquizctrC]{\rule{7pt}{7pt}}
> +	\hyperref[QQ.\QuickQuizAnswerChapter.\thequickquizctrC]{\rule{7pt}{7pt}}
>  	\end{tcolorbox}
>  	\noindent\textbf{Answer:} \\ }
>  }{
> -- 
> 2.17.1
> 
> 

  reply	other threads:[~2021-04-15  5:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 10:47 [PATCH -perfbook 0/5] Updates of qqz.sty Akira Yokosawa
2021-04-14 10:54 ` [PATCH -perfbook 1/5] qqz.sty: Use \refstepcounter after leaving vmode in tcolorbox Akira Yokosawa
2021-04-14 11:04 ` [PATCH -perfbook 2/5] qqz.sty: Modify -nq build to have chapterwise quiz-only section Akira Yokosawa
2021-04-14 11:09 ` [PATCH -perfbook 3/5] perfbook-lt.tex: Remove boolean qqzchpend Akira Yokosawa
2021-04-14 11:11 ` [PATCH -perfbook 4/5] howto, Makefile: Update answer to Quick Quiz 1.3 and 'make help-full' Akira Yokosawa
2021-04-14 11:12 ` [PATCH -perfbook 5/5] qqz.sty: Add page reference to QQA Appendix as the same as -nq build Akira Yokosawa
2021-04-14 17:31 ` [PATCH -perfbook 0/5] Updates of qqz.sty Paul E. McKenney
2021-04-15  3:49   ` Akira Yokosawa
2021-04-15  5:11     ` Paul E. McKenney [this message]
2021-04-15  5:47       ` Akira Yokosawa
2021-04-15 15:30         ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210415051133.GD4510@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=akiyks@gmail.com \
    --cc=perfbook@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.