LaTeX forum ⇒ GeneralCannot create multiple tables of content Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
tableofconfusion
Posts: 4
Joined: Sun Sep 18, 2016 5:44 pm

Cannot create multiple tables of content

Postby tableofconfusion » Sun Sep 18, 2016 6:11 pm

Dear forum members,

after two days of forum searching and trying this and that I'm running out of time, and so I decided to post my problem here. I have restarted using LATEX 20 years after writing my thesis with Version 2.09.

Currently I am writing a large document in two languages (german in the left column, english in the right) using package paracol. Now, after the first ~100 pages, I'm trying to create a Table of Contents also in two columns (german - english) and I thought that package tableof could help here, but it doesn't. I'm kind of confused ... maybe somebody can help me?

Here is a minimum example code - I cannot show the original one since it contains company Know-how. I think that all the included packages are necessary for the original code.

Chapters and sections are tagged b (both), d (german) and e (english).
  1. \documentclass[10pt,a4paper,parskip]{scrreprt}
  2. \usepackage[english, ngerman]{babel}
  3. \usepackage{selinput}
  4. \SelectInputMappings{adieresis={ä},germanbls={ß},}
  5. \usepackage[T1]{fontenc}
  6. \usepackage{amsmath}
  7. \usepackage{amsfonts}
  8. \usepackage{amssymb}
  9. \usepackage{graphicx}
  10. \usepackage{tabularx}
  11. \usepackage{geometry}
  12. \usepackage{setspace}
  13. \usepackage[right]{eurosym}
  14. \usepackage[usenames,dvipsnames]{color}
  15. \usepackage{colortbl}
  16. \usepackage{paralist}
  17. \usepackage{booktabs}
  18. \usepackage{array}
  19. \usepackage{parskip}
  20. \usepackage{picins}
  21. \usepackage[subfigure,titles]{tocloft}
  22. \usepackage[pdfpagelabels=true, colorlinks=true, allcolors=blue]{hyperref}
  23. \usepackage{nomencl}
  24. \makenomenclature
  25. \usepackage{makeidx}
  26. \makeindex
  27. \usepackage{natbib}
  28. \usepackage{multirow}
  29. \usepackage{bm}
  30. \usepackage{float}
  31. \usepackage{pdfpages}
  32. \usepackage{longtable}
  33. \usepackage{csquotes}
  34. \usepackage{mdwtab, tabularx}
  35. \usepackage{lastpage}
  36. \usepackage[super]{nth}
  37. \usepackage{paracol}
  38. \usepackage[printonlyused]{acronym}
  39. \usepackage{fancyhdr}
  40. \usepackage{mathtools,amssymb,diagbox,multirow}
  41. \usepackage{enumitem}
  42. \usepackage{caption}
  43. \usepackage[lang=english,font=it]{bicaption}
  44. \usepackage[format=hang]{subcaption}
  45. \pagestyle{fancy}
  46. \fancyhf{}
  47. \usepackage{marginnote}
  48. \usepackage{eso-pic}
  49. \usepackage{watermark}
  50. \usepackage{tableof}
  51. \AtBeginDocument{\tofOpenTocFileForWrite}
  52.  
  53. \begin{document}
  54. \bibliographystyle{plain}
  55. \pagestyle{fancy}
  56. \fancypagestyle{plain}{}
  57. \fancyhf{}
  58. %
  59. \part{Erster Teil\\ First Part}
  60. \tableof{b}
  61. \tableof{d}
  62. \tableof{e}
  63. %
  64. \toftagthis{b}
  65. \chapter{Das erste Kapitel \\ The first chapter}
  66. \begin{sloppypar}
  67. \begin{paracol}{2}
  68. \begin{leftcolumn}
  69. Ein bißchen deutscher Text, der das erste Kapitel einleitet, bevor es mit dem ersten Abschnitt losgeht.
  70. \end{leftcolumn}
  71. \begin{rightcolumn}
  72. A little bit of english text supposed to prepare the reader for the first section.
  73. \end{rightcolumn}
  74. %
  75. \begin{leftcolumn}
  76. \toftagthis{d}
  77. \section{Der erste Abschnitt im ersten Kapitel}
  78. Der Text zum ersten Abschnitt.
  79. \end{leftcolumn}
  80. \begin{rightcolumn}
  81. \toftagthis{e}
  82. \section{The first section of the first chapter}
  83. Text in the first section.
  84. \end{rightcolumn}
  85. %
  86. \begin{leftcolumn}
  87. \toftagthis{d}
  88. \section{Der zweite Abschnitt im ersten Kapitel}
  89. Text im zweiten Abschnitt.
  90. \end{leftcolumn}
  91. \begin{rightcolumn}
  92. \toftagthis{e}
  93. \section{The second section in the first chapter}
  94. Text belonging to the second section.
  95. \end{rightcolumn}
  96. \end{paracol}
  97. \end{sloppypar}
  98. %
  99. \toftagthis{b}
  100. \chapter{Das zweite Kapitel \\ The second chapter}
  101. \begin{sloppypar}
  102. \begin{paracol}{2}
  103. \begin{leftcolumn}
  104. \toftagthis{d}
  105. \section{Der erste Abschnitt im zweiten Kapitel}
  106. Das zweite Kapitel beginnt mit diesem Abschnitt.
  107. \end{leftcolumn}
  108. \begin{rightcolumn}
  109. \toftagthis{e}
  110. \section{The first section of the second chapter}
  111. The second chapter starts with this section.
  112. \end{rightcolumn}
  113. \end{paracol}
  114. \end{sloppypar}
  115. \end{document}

The pdf shows only the first (b) table of Contents, whatever I try.

Thanks a lot in advance for any help!!!

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Sep 18, 2016 6:48 pm

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sun Sep 18, 2016 8:31 pm

tableofconfusion wrote:I think that all the included packages are necessary for the original code.


I doubt that :) for example: why do you use the parskip package in addition to KOMA-Script's parskip option? The package is not needed. And this is just one example.

Removing all of the packages one by one shows the cause of the problem – this combination:

  1. \usepackage{lastpage}
  2. \usepackage{tableof}


Interestingly enough this combination works:

  1. \usepackage{tableof}
  2. \usepackage{lastpage}


So of you really need the lastpage package then load it after tableof.

Regards

PS: I'd really would advice to go through every package and check wether you really need it. Another example: fancyhdr and KOMA-Script classes don't go very well together (there is even a warning message in the log saying so). KOMA-Script has its own package called scrlayer-scrpage which works nicely with KOMA-Script classes.
site moderator & package author

tableofconfusion
Posts: 4
Joined: Sun Sep 18, 2016 5:44 pm

Postby tableofconfusion » Sun Sep 18, 2016 9:34 pm

Dear Clemens,

thank you very much for the quick answer!! Now you caught me - parskip is really not necessary. You're right, there may be more redundancies in the preamble, thanks for the hint!

What I really need is the lastpage package, because my company has ist own "style" for such documents including page numbering like "37 of 144".

Your suggestion to change the order of tableof and lastpage really had a positive effect on the test file above, but not the desired one on my original file where I use the paracol environment. I think I'll give up for today...

By the way, running Latex on my original file works once, but running it a second time in order to create the toc file makes Texmaker hang up. Something seems to be wrong with tableof combined with my other packages. Tomorrow I'm going to check which can be omitted, but I'm scared there will be many left.

Have a nice evening!

toctoc

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sun Sep 18, 2016 9:46 pm

tableofconfusion wrote:What I really need is the lastpage package, because my company has ist own "style" for such documents including page numbering like "37 of 144".


There are alternatives: http://tex.stackexchange.com/a/32471/5049 :)

Regards
site moderator & package author

tableofconfusion
Posts: 4
Joined: Sun Sep 18, 2016 5:44 pm

Postby tableofconfusion » Sun Sep 18, 2016 10:06 pm

Thanks!

Coming back to my paracol problem: Another solution could be putting the different tocs into boxes placed side by side, but I think there is no box type which can contain a toc, right? At least it does not work with parboxes and minipages.

User avatar
Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Sep 19, 2016 8:03 am

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

tableofconfusion
Posts: 4
Joined: Sun Sep 18, 2016 5:44 pm

Postby tableofconfusion » Mon Sep 19, 2016 9:57 am

Dear all,

the issue has been solved here:

http://tex.stackexchange.com/questions/330200/packages-tableof-and-paracol-multiple-tables-of-content-dont-work,

so the topic can be closed. Thanks to all who helped me such a lot in the past 20 hours!

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Mon Sep 19, 2016 1:10 pm



Not that it really were important but Jean-François suggests the exact same solution I did: changing the package loading order!
site moderator & package author


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests