quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.59k stars 294 forks source link

Tabset linking back to first page of presentation? #1574

Open giabaio opened 1 year ago

giabaio commented 1 year ago

Hi all, I'm working on a relatively heavily customized template for a qmd revealjs presentation (see here). I think I managed to make things work more or less like I want (there's a slight issue with the logo in the version I'm sharing --- I don't understand why... But it works OK everywhere else I used it so that's not the problem).

The problem I can see with tabset is that if I use the code

include-after: |
    <style>
    .logo {
      background-image: url("assets/images/UCL-stats.png");
      background-size: 14% 7%;
      background-repeat: no-repeat;
      position: absolute;
      top:  1.9%; /* 2.65%em */
      left: 86%;
      height: 100%;
      width: 100%;
      z-index: 20; !default
    }
    </style>

    <script>
    document.querySelectorAll(
      'section.slide.level2:not(section.slide.level2.title-slide.center):not(section.slide.level2.nobar)'
    )
    .forEach(el => {
      el.innerHTML += '<div class="logo"></div>';
    });
    </script>

in my yaml, which is used to add the logo to the top-right of each slide, then, when I view the presentation on my browser (Firefox), clicking on either of the two tabs brings me back to the title page. If I remove the code above, then the tabset works OK and clicking on the tabset's title moves from one to the other.

The other slight issue (not sure whether I'm missing something obvious here, though) is whether you can use the keyboard arrows to navigate through tabsets? (I come from xaringan and there you can do that so I wondered whether that's a feature that is possible under qmd too?).

Many thanks! Gianluca

giabaio commented 1 year ago

Just to add a quick note to this. I noticed that if I click on the tab name and don't release the mouse immediately (like I move the mouse while still clicking), then the weird effect of linking back to the title page doesn't happen...