Text Formatting ⇒ bibliography and Index
bibliography and Index
my editor is asking me an harmonization of the presentation of my two column bibliography and my two column index. for my bibliography I use multicol package and the index automaticaly gives an output in two column, but the column separation are not the same. I would like to get an index in one column that I convert with multicol in two columns. Is this possible ?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
bibliography and Index
Code: Select all
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{makeidx}
\makeindex
\begin{document}
\begin{multicols}{2}
\the\columnsep
\end{multicols}
\index{c@\the\columnsep}
\printindex
\end{document}
After writing this I had the idea to simply look at the sources of the used class file. At least for the standard classes this length is set to 35pt for the index and 10pt for the multi-column environments.
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: bibliography and Index
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
bibliography and Index
»Is not working« is one of the most trivial phrases. You have to be more precise. Error messages or similar stuff from the log file have turned out to be most helpful in such cases. And of course the above code works also with the »book« class (see attachment). And it also works either with MakeIndex or Xindy. Perhaps I haven't been clear enough. You can simply adjust the length \columnsep with one single line in the document preamble.gwada74 wrote:Hello, this is not working, the class I am using is the class book. I think that the best way is to change the source of \printindex but I am not good in this area. […]
Code: Select all
\setlength{\columnsep}{35pt}
- Attachments
-
- columnsep.pdf
- The resulting output of the provided code.
- (18.57 KiB) Downloaded 182 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10