1

I want to achieve a dictionary header for the subsections of a page (not for the whole section).

Imagine the header should looks like this:

subsectionname 1.1 - subsectionname 1.2                         SECTIONNAME 1

How can i achieve this?

swap
  • 21
  • Doing this is some not-so-stable way is easy. But getting this right reliably correct might be hard. I'll test some things. Also this will take a lot of space if you really want to include the section and subsection titles, which might not be what you want. – Skillmon Dec 28 '19 at 16:45
  • The problem is detecting whether the current subsection starts at the top of the page or whether some of the previous subsection carries over. Also it might be that a subsection doesn't start at the top of the page, but still is the only subsection which's content is on this page, because everything else on this page is from the section. – Skillmon Dec 28 '19 at 16:51
  • Thank you very much for your reply. So it is very difficult to achieve this? Sad :(. I really would like to have a header like this. – swap Dec 28 '19 at 18:21
  • At least I can't think of a reliable automatic way, that doesn't mean that there is none, only that I can't think of one... – Skillmon Dec 28 '19 at 18:41
  • I have got an idea. What do you think about reading the .toc file into memory with LuaLateX to generate the appropriate headers from the information. – swap Dec 28 '19 at 18:52
  • We don't need to do it in that way, I could create some engine-independent two-pass solution with the same functionality, but processing the page headers that way seems tedious. I got a not-so-good solution that's working in one pass, but it has the already mentioned pitfalls. – Skillmon Dec 28 '19 at 18:55
  • I'm a Tex newbie. Why is the two-pass solution tedious? – swap Dec 28 '19 at 20:02
  • Mainly because it needs two passes, also I'd have to write a lot of code and would have to be careful to not accidentally break other stuff. If I can manage the full functionality just with the mark-mechanism of (e-)TeX, that'd be much better. – Skillmon Dec 28 '19 at 20:21
  • I understand. Thank you for your help and your efforts. I really enjoy learning from you :) – swap Dec 28 '19 at 20:39
  • And even with the two-pass mechanism, I have no idea how I could tell whether a subsection was the first thing on a page or not (without hacking the \subsection macro). If I have to: Which class are you using? – Skillmon Dec 28 '19 at 20:46
  • I am using the article class. – swap Dec 28 '19 at 20:50
  • No, thank you very much. – swap Feb 12 '20 at 19:43

0 Answers0