#### multiline TOC entry

Hello,

My documents sometimes have long titles, and these titles
don't fit into one line of TOC (table of content). I managed
to fix the problem by creating a macro:

[code]
% Generalized TOC entry
% #1 -- label
% #2 -- label width
% #3 -- ID
% #4 -- text
% #5 -- text font tuning
\newcommand{\tocX}[5]{%
% setup font
{#5%
% start a hyperlink and a link rectangle
% start a paragraph, reserve space for label and page number
\noindent\leftskip=#2\rightskip=3em% 3em > space + 9--99
% make a label
\hbox to 0pt{\kern-#2#1\hfil}%
% TOC entry text
#4\hfill
% page number
\hbox to 0pt{\hbox to 3em{\hfil\pageref*{#3}}\hss}%
% finish the box and the hyperlink
}}}\par}}
[/code]

TOC entries consist of three parts: label, text and page
number. If text is long and should be splitted on several lines,
then the text occupies only the text area.

Having "tocX", I define styles for actual TOC entries:

[code]
% Toc Entries
% #1 -- label
% #2 -- ID
% #3 -- text
\newcommand{\tocHI}[3]{\vspace{20pt}\tocX{Kapitel
#1}{2cm}{#2}{#3}{\V@SelectTOCFont\bfseries}%
\penalty10000\vspace{2pt}\hrule\penalty10000}
\newcommand{\tocHII}[3]{\vspace{12pt}\tocX{#1}{2.5cm}{#2}{#3}{\V@SelectTOCFont\bfseries}\penalty10000}
\newcommand{\tocHIII}[3]{\tocX{#1}{3cm}{#2}{#3}{\V@SelectTOCFont}}
\newcommand{\tocHIV}[3]{\tocX{#1}{3.5cm}{#2}{#3}{\V@SelectTOCFont}}
\newcommand{\tocHV}[3]{\tocX{#1}{4cm}{#2}{#3}{\V@SelectTOCFont}}
[/code]

and use in a document:

[code]
\toc
\tocHI{9}{id2295978}{Anhang}
\tocHII{9.1}{id2295983}{Weitere Dokumentation von ...}
\tocHII{9.2}{id2296568}{Dokumentation von Zulieferern}
\tocHII{9.3}{id2296683}{Normen}
[/code]

All works fine. I'm sharing the code in hope it will be useful.

My request: please comment how the code can be improved. For
example, I suppose that using "\vbox" is LaTeX is not very good,
but I have no idea for replacement.

Bye!

--
Oleg

 0
usenet5437 (22)
8/31/2004 9:18:22 AM
comp.text.tex 37755 articles. 1 followers.

0 Replies
274 Views

Similar Articles

[PageSpeed] 15
Similar artilces about - multiline TOC entry:

Change Notes.ini entries
Hallo NG, i want to create a button in a mail. when the user hits the button, a new entry should be created in the notes.ini file from the current user. has anybody an idea how i can realize it? thanks a lot. marcus Look up environment in Designer help. If you stated what you want to achieve there may be a better way? "Marcus Schmidt" <notes@der-himmel.de> wrote in message news:8af5a36c.0310270557.6cdbbf06@posting.google.com... > Hallo NG, > > i want to create a button in a mail. when the user hits the button, a > new entry should be created...

How do I dimension a multiline edit control to fit exactly the text it contains?
I retrieve the tmHeight using GetTextMetrics and multiplied it by the number of lines but the height is still too big. The text can always fit on the screen, I have between 1 and 10 lines and I want the size to be adjusted depending on the number of lines I have. Haven't worked on the width yet, I am trying to figure out how to get the correct height first. Thanks in advance for any tip. Hi, Try to use the following API to get the height of the font, and see if you still get the same result or not, just make sure to select the correct font handle: WM...

Centering the word Contents in TOC
I have created a booklet of poems and songs and have evertyhing styled as I want. All of my titles are centered on a page and to keep everything consistent I would like to have the word Contents in bold and cenetered in my TOC page. How can I do this? I am using an article documentclass if that makes any difference. Thanks Allan yodadrinkslager <allanmb@gmail.com> wrote: : I have created a booklet of poems and songs and have evertyhing styled : as I want. All of my titles are centered on a page and to keep : everything consistent I would like to have the word Contents in bold : and...

multiline string deletion
Hi, i am a newbie to awk (using gawk on linux) is there a way to delete this exact pattern (changin the PID obviously) from a file using awk? Sep 18 13:40:35 Shadowland pppd[27156]: pppd 2.4.1 started by root, uid 0 Sep 18 13:40:35 Shadowland pppd[27156]: Using interface ppp0 Sep 18 13:40:35 Shadowland pppd[27156]: Connect: ppp0 <--> /dev/ttyp0 Sep 18 13:41:06 Shadowland pppd[27156]: Connection terminated. Sep 18 13:41:10 Shadowland pppd[27156]: Exit. Sep 18 13:41:10 Shadowland adsl-connect: ADSL connection lost; attempting re-connection. thanks PS. to clean logs from junk befor...

multiline
open(FILE,$ARGV[0]); while(<FILE>){ if (/falls mainly on.*l /s){ print"1";}; print; } the rain in spain falls mainly on the plain isn't matching across the line. plz help. The /s modifier doesn't seem to be working. hawk.alan@gmail.com wrote: > open(FILE,$ARGV[0]); > > while(<FILE>){ > if (/falls mainly on.*l /s){ print"1";}; > print; > } > > > the rain in spain > falls mainly on the > plain > > isn't matching across the line. plz help. The /s modifier doesn't seem > to be working. The /s ...

Multiline tables
Hi all The table below does _not_ have line break, as a result gets broader that the paper. How could I ask LaTeX to add line breaks ? Arje \begin{tabular}{|l|l|} \hline Topic 1 & Topic 2 \\ \hline Some long long long long long long long long long long long text & More long long long long long long long long long long text \\ \end{tabular} Am Wed, 04 Feb 2009 16:45:45 +0100 schrieb Arje van Daggen: > Hi all > > The table below does _not_ have line break, as a result gets > broader that the paper. > > How could I ask LaTeX to add line breaks ? > > Arje...

TOC title
Could I change the TOC title to something else than "Contents"?.......The trouble is that I would like two TOC's in my document, one named "Main TOC" and one named "Sub TOC"....any ideas? Best Regards Terry Terry Andersen <terr@sea.com> wrote: > Could I change the TOC title to something else than "Contents"?.......The > trouble is that I would like two TOC's in my document, one named "Main TOC" > and one named "Sub TOC"....any ideas? http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fixnam http://www.tex.ac....

how to migrate certain entries quickly between iSeries machines?
Hi there, Is there any quickly way to migrate certain entries to other iSeries machines such as Job Schedule Entry, Directory Entry, Reply List Entry and so on? Thank you very much, Laurence I found there are three CL commands seem can do that, RTVSYSINF PRTSYSINF UPDSYSINF For you information. Laurence ...

Professional Data Entry Services at Affordable rate
Cheap Data Entry Services Says Goodmorning all of you, I am from dataentrywashington.com, which is provides Data entry services regarding data processing, form processing, outsourcing data entry services, outsourcing data entry projects, data conversion, Data- Entry Services, web research, Professional Data Entry Services at affordable cost. I am come here for data entry projects regarding dataentry, data- entry, data processing, form processing, data conversion, web research services. Our cheap outsourcing data entry services help your business to boost the rapidity of usual business activ...

multiline
How to make multiline in Autocad, with 3 line, but central line have to be thiner then other 2 lines, and linetype should be dash? ...

multiline CSV fields
Darcy Buskermolen has drawn my attention to unfortunate behaviour of COPY CSV with fields containing embedded line end chars if the embedded sequence isn't the same as those of the file containing the CSV data. In that case we error out when reading the data in. This means there are cases where we can produce a CSV data file which we can't read in, which is not at all pleasant. Possible approaches to the problem: .. make it a documented limitation .. have a "csv read" mode for backend/commands/copy.c:CopyReadLine() that relaxes some of the restrictions on i...

ENTRY statement #2
Hi, I'm writing a program which would benefit from using the ENTRY statement - however, Metcalf, Reid, and Cohen suggest that modules should be used instead. However, it's not clear to me how the following code could make use of modules to achieve the same effect: program test call do1(1,2,3) call do2(1,2) call do3(1) end program test subroutine do1(a,b,c) implicit none integer :: a,b,c print *,a,b,c entry do2(b,c) print *,b,c entry do3(c) print *,c end subroutine do1 Is there a way to do this with a module without increasing the length of the code too much? ...

Re: multilines to one line
Dear Joyce, Download the following macros from http://home.hccnet.nl/jim.groeneveld/software/SASmacro/: aRecodeN.zip, MR2RM.zip, ChkVar.zip and PreZeros.zip . Unzip the .sas files within them and store these in your macro search path (the same way you call your other macros). Then run the following (Example) program: OPTIONS PS=60 LS=80; DATA Enrollment; INPUT County District $School Grade$ AAM AAF HM HF NAM NAF APM APF WOM WOF; CARDS; 01 I001 675 6 2 3 1 0 5 7 1 0 23 27 01 I001 675 7 3 0 2 3 4 6 0 0 26 22 01 ...

Re: [tao-bugs] TAO_AnyTypeCoded.dll: entry point not located. #2
Johnny, I'm quite sure that I have. I've done a clean build, recreated the = tao_idl.exe, then did a rebuild just to be certain. I still get this = issue. I recently tried building the ACE.sln and TAO.sln solutions separately, = instead of the TAO_ACE.sln, but that didn't help either.=20 Perhaps it would be a good idea to try to build on a PC that has never had = ace/tao/my application built on it? Thanks! --- Tony Sinclair Research Engineer Intern Thunder Bay Regional Research Institute sinclait@tbh.net >>> Johnny Willemsen 07/09/11 1:57 A...

Weird problem with multiline records
Hello, I'm trying to develop a hierarchical keyword searching script in Gawk, by which I mean that if � 13. contains "foo", and 13.3. contains "bar", searching for "foo bar" should find � 13.3. and its subsections. Here's what I did: #v+ #!/usr/bin/gawk -f # -*- awk -*- # This is a hierarchical keyword search script. Sections are separated by # section numbers like "12.4.5." The number of dots determines the section # level. function reset_patterns() { for (i in found) { if (found[i] >= this_level) found[i]=0 } } # compu...

multiline replacement
Hi. I have multiple instances of the following lines in multiple files: <DIV>some text</DIV> <DIV>.</DIV> That I would like to replace with: <DIV>some text.</DIV> My latest attempt doesn't work: sed -i '/<\/DIV>$/ {N; s/<\/DIV>\n<DIV>[.]<\/DIV>/.<\/DIV>/}' How to accomplish this task? In article <kp52jg$23b$1@dont-email.me>, Jeff Higgins <jeff@invalid.invalid> wrote: > Hi. > I have multiple instances of the following lines in multiple files: > > <DIV>some t... System News for Sun Users: TOC Vol 81 Issue 4: November 22 to November 28 The "System News for Sun Users" newsletters are sent each week to 50,000+ subscribers around the world. It is also posted to several newsgroups and to http://sun.systemnews.com You are encouraged to sign up for your own, complimentary subscription to have your newsletter delivered to you via email in PDF, text or web link formats with just the sections that you want. The newsletter is built dynamically for each subscriber. You choose the technology areas that interest you. Each week the news is grouped into sections. Your newsletter is built from the sections that are av... LaTex newbie question Hi I was wondering if anyone could help me with a problem involving chapter numbering in a report. I need to be able to remove the numbering from \chapter headings in the body of the report while still having the (unnumbered) chapter headings put in the toc. I suppose I need something like \chapter* which keeps the item in the contents. I am using the standard Debian LaTex distribution and am really wet behind the ears when it comes to all this document preparation stuff Thanks Toby Cadoux wrote: > Hi > > I was wondering if anyone could help me with a problem involving chapter... Biblatex: suppress certain entries from the author index Hello, I have some entries in my bibliography whose authors I don't want in my author index. The entries all have their Keyword field set to foo. Can I exclude them from the author index? For extra marks, could I then add them to \index[foo]? I read the documentation and googled, with no success. The only thing that comes close is apacite's suppresscorporate option. Thanks, Guillaume Guillaume Rischard wrote: > I have some entries in my bibliography whose authors I don't want in > my author index. The entries all have their Keyword field set to > foo. Can I exclu... Re: Does anyone remember the ENTRY.PUB.SYS program? What language do you want ? The source code is available is several different ones, including COBOL, BASIC, Fortran, SPL, I believe. They are included in the group HP32209.HPPL89. The files therein should be included on every FOS tape. At 06:36 PM 2005-02-03, Craig Lalley wrote: >Believe it or not, I have a customer that uses the ENTRY.PUB.SYS program. > >We are in the middle of migrating that whole application off to an HP-UX. > >In order to migrate this one small part, I need to re-write Entry, which >should take a day at most. > >But IIRC, didn... Removing entries from TOC Hi all, I'm writing my PhD thesis with TeX and I have a table of contents in which I want to remove lines for "list of figures" and "list of tables". I also have "Table of contents" as entry in my TOC(!) and don't want that either... How can I remove these without manually editing the toc generated file? If it helps, I've copied my settings file below. Thank you Spiros Here are is my document (apart from actual text content) \documentclass[a4paper,12pt]{report} % document type \usepackage[pdftex]{graphicx} % driver \graphicspat... multiline How to make multiline in Autocad, with 3 line, but central line have to be thiner then other 2 lines, and linetype should be dash? If color-dependent plotting, then in your MLINE style, color the middle line a color that will print lighter that the outer lines. If named-plot-style plotting, there doesn't seem to be sufficient options for the style of plotting. As much as they push for named plot styles, you think they's support it better. Autdesk is too concerned about creating new features and not concerned enough about making the features they have fully functional. ... Duplicate entry check between sub-form fields Hi, I have a form with 2 subforms. On the MAINFORM, I have a drop down to select a Customer. On SUBFORM1, I have an entry for 'PONumber', which is just a text box. On the 'Before Update' event of PONumber I have the following code to check for duplicates: ______________________________ If Nz(Me.PONumber.OldValue) <> Nz(Me.PONumber) Then If DCount("PONumber", "Orders", "PONumber = '" & Me.PONumber & "'") > 0 Then MsgBox "Duplicate PO Number !", vbOKOnly + vbExclamati... Duplicage Entry Hi Gurus, I need to compare two files which shows me ONLY duplicate entries (entry common to both files) i tried "comm" command but it doesn't show me correctly or may be i am not using it correctly. Please Help Regards Hi I hope I understood you correctly... Maybe you could try this... File 1 (text1.txt): ------------------- Hi world How are you ? I'm okay I'm okay I don't know Whatever File 2 (text2.txt): ------------------- Whatever Sunny day How are you ? I'm okay #!/bin/perl cat text* | sort | uniq -c | awk '$1 > 1 && $2 !~ /^$/ { pri...

commitment control journal entries
I need to research how I can identify the journal entries of records changed in a file which were commited to the database and those that were subsequently rolled back. I have an RPG program setup as the exit program of the RCVJRNE command: RCVJRNE JRN( xxx ) ExitPgm( yyy ) Journal entries arrive sequentially to the exit program. When an after image of a change arrives in the exit program what is the best way to look or plan ahead so that if subsequent journal entries show the change as having been rolled back, my exit program does not process that change? Is there a unique control numb...