From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: Table of contents for just one section?
Date: Sun, 26 Oct 2014 14:01:50 +0100 [thread overview]
Message-ID: <8761f7dlxd.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87mw8joylh.fsf@gmx.us> (rasmus@gmx.us's message of "Sun, 26 Oct 2014 12:32:42 +0100")
Hello,
Rasmus <rasmus@gmx.us> writes:
> I think we can do it with titletoc. I have used other functionality
> of titletoc, and it 'doesn't sucks'ᵀᴹ. Below is an example. The
> output is more inline with normal tocs, but you can also style it
> [I've used this for making paragraph-TOCs in the past].
>
> So ox-latex needs to insert at least the following to initialize a
> local TOC
>
> \startcontents[ID-level] % need not be unique and might not be neceasary
> \printcontents[ID-level]{}{(1+ level)}{TOC OPTIONS}
>
> And, importantly — and mildely annoyingly — \startcontents[ID] *after*
> the next heading of the same level.
I don't quite get this part. Does that string need to be inserted only
after the second sibling (i.e., not after the third, too)? What happens
if there is no other sibling?
> There are some preamble options, but since we are doing it
> programically, it might be safer to insert it into the body.
The patch will not insert "\usepackage{titletoc}" for the user, however,
à la `org-latex-listings'.
> It seems it need not be same unique ID.
>
> An example:
>
> \documentclass{book}
> \usepackage{titletoc}
> \begin{document}
> \part{p1}
> \startcontents[level-0]
> \printcontents[level-0]{}{0}{\setcounter{tocdepth}{2}}
> \chapter{c1}
> \startcontents[level-1]
> \printcontents[level-1]{}{1}{\setcounter{tocdepth}{1}}
> \section{s1} \subsection{s2}
> \chapter{c2}
> \startcontents[level-1]
> \section{s3}
> \part{p2}
> \startcontents[level-0]
> \chapter{c3}
> \end{document}
>
> The only "challenge" is to insert \startcontents[ID] in the next
> headline of same level. The brute force method would be very bad.
What do you call the "brute force"?
> Maybe doing it like section numbers are determined?
What do you mean?
> Let me know what you think and whether you will do it.
I can try to implement it.
I also note that these tocs do not have any title. Would it make sense
to remove title from local tocs in other back-ends too?
Thanks for your feedback.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2014-10-26 13:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 3:50 Table of contents for just one section? D. C. Toedt
2014-10-20 13:41 ` Nicolas Goaziou
2014-10-20 14:06 ` D. C. Toedt
2014-10-26 8:15 ` Nicolas Goaziou
2014-10-26 11:03 ` D. C. Toedt
2015-03-16 22:35 ` D. C. Toedt
2015-03-16 22:47 ` Rasmus
2015-03-16 23:13 ` Thomas S. Dye
2014-10-26 11:32 ` Rasmus
2014-10-26 13:01 ` Nicolas Goaziou [this message]
2014-10-26 15:01 ` Rasmus
2014-10-26 15:10 ` Rasmus
2015-01-11 21:49 ` Nicolas Goaziou
2015-01-11 22:37 ` Rasmus
2015-01-12 8:38 ` Nicolas Goaziou
2015-01-12 10:45 ` Rasmus
2015-01-12 23:12 ` Nicolas Goaziou
2015-01-13 1:23 ` Rasmus
2015-01-13 9:30 ` Nicolas Goaziou
2015-01-13 10:21 ` Rasmus
2015-01-13 10:43 ` Nicolas Goaziou
2015-01-13 11:56 ` Rasmus
2015-01-13 15:36 ` Nicolas Goaziou
2014-10-26 10:53 ` Rasmus
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8761f7dlxd.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=rasmus@gmx.us \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).