0

I have the following document:

\documentclass[a5paper]{report}
\usepackage[12pt]{moresize}
\usepackage{fullpage}
\usepackage[T1]{fontenc}
\usepackage[pass]{geometry}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{kantlipsum}
\usepackage{booktabs}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{latexsym}
\usepackage[utf8]{inputenc}
\usepackage{authblk}
\fontfamily{tahoma} 
\newtheorem{theorem}{Theorem}
\usepackage{lipsum}
\newtheorem{mydef}{Definition}
\usepackage{fullpage}

\usepackage{imakeidx} \makeindex


\title{Title}
\author{author}
\begin{document}
    \maketitle
    \pagenumbering{roman}
    \newpage
    \tableofcontents
    \newpage
    \pagenumbering{arabic}
\chapter{Chapter 1}

Located on a \index{rift} between tectonic plates, Iceland's geologic activity includes \index{geysers} and frequent \index{volcanic eruptions}. The interior consists of a volcanic plateau characterised by sand and lava fields, mountains, and glaciers, and many glacial rivers flow to the sea through the lowlands. Iceland is warmed by the \index{Gulf Stream} and has a temperate climate, despite a latitude just south of the\index{ Arctic Circle}. Its high latitude and marine influence keep summers chilly, and most of its islands have a polar climate.



\chapter{Chapter 2}

According to the ancient manuscript \index{Landnámabók}, the settlement of \index{Iceland} began in 874 AD when the Norwegian chieftain Ingólfr Arnarson became the first permanent settler on the island. In the following centuries, Norwegians, and to a lesser extent other \index{Scandinavians}, immigrated to Iceland, bringing with them thralls (i.e., slaves or serfs) of Gaelic origin.



\newpage

\chapter{Chapter 3}

The island was governed as an independent \index{commonwealth} under the native parliament, the Althing, one of the world's oldest functioning legislative assemblies. Following a period of civil strife, Iceland acceded to Norwegian rule in the 13th century. In 1397, Iceland followed Norway's integration into the Kalmar Union along with the kingdoms of Denmark and Sweden, coming under de facto Danish rule following its dissolution in 1523. The Danish kingdom introduced Lutheranism by force in 1550,[16] and Iceland was formally ceded to Denmark in 1814 by the Treaty of Kiel.

Influenced by ideals of nationalism after the French Revolution, Iceland's struggle for independence took form and culminated in the \index{Danish–Icelandic Act of Union} in 1918, with the establishment of the Kingdom of Iceland, sharing through a personal union the incumbent monarch of Denmark. During the occupation of Denmark in World War II, Iceland voted overwhelmingly to become a republic in 1944, thus ending the remaining formal ties with Denmark. Although the Althing was suspended from 1799 to 1845, the island republic nevertheless holds a claim to sustaining one of the longest-running parliaments in the world.

\printindex

    
\end{document}

The document and the index work fine when the document is not saved on my computer ( when I run it without saving it), but when I save it on computer it does not work any more.

The log file:

warning: : destination with the same identifier (name{page.1}) has been already used, duplicate ignored<to be read again> \relax l.41 \chapter {Chapter 2} [1

The document does not print the index when it's saved on computer, but I cannot see why. Any ideas? Thanks a lot.

6
  • 1
    works fine here. Check your log-file for messages. Commented May 4 at 12:55
  • It works fine when the document is not saved on my computer. When I run this doument without saving it on my computer it works, but when I save it on computer it does not work any more. This is the log file: Stvarno kazalo dokumenta.tex: warning: : destination with the same identifier (name{page.1}) has been already used, duplicate ignored<to be read again> \relax l.41 \chapter {Chapter 2} [1
    – Alezigl
    Commented May 4 at 14:46
  • the warning is a warning not an error, it only tells you that you have two pages with number 1 (the title page and the first chapter page). A pdf and an index should be there anyway. Commented May 4 at 14:54
  • @UlrikeFischer It compiles pdf, but without index. The last page is page with Chapter 3 and there isn't an index after it.
    – Alezigl
    Commented May 4 at 15:08
  • remove unneeded packages to make the example smaller. Then compile again and show the complete log-file. Commented May 4 at 15:14

1 Answer 1

1

Some packages you're loading are either obsolete, deprecated or useless:

  • moresize (obsolete)
  • fullpage (obsolete, use geometry features instead)
  • latexsym (deprecated, use only for very old document)
  • authblk is useless if you don't exploit its features
  • kantlipsum and lipsum have just one purpose: providing mock text for typographic experiments
  • inputenc with the utf8 option is useless

The command \fontfamily{tahoma} does nothing at all.

If you type

Located on a \index{rift} between

then the word rift will be indexed, but it won't appear at that spot. You need to type it in as well:

Located on a rift\index{rift} between

Similarly for all other occurrences of \index.

A command \clearpage should go before any \pagenumbering command (better yet, \cleardoublepage, so you can switch to twoside without changing the document code. For the title page, that you don't want to be numbered, use \pagenumbering{Alph} and the empty page style.

More important: hyperref should be loaded after most packages, in particular imakeidx: loading the latter after the former will not produce hyperlinks from the index.

This said, after the due changes the index appears and the hyperlinks work.

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

\usepackage[
  a5paper,
  % maybe more options
]{geometry}

\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amsthm}
\usepackage{amssymb}

\usepackage{imakeidx}

\usepackage{varioref}
\usepackage{hyperref}

\makeindex

\newtheorem{theorem}{Theorem}
\newtheorem{mydef}{Definition}

%\fontfamily{tahoma} % What do you think this does?

\title{Title}
\author{author}

\begin{document}

\pagenumbering{Alph}
\maketitle
\thispagestyle{empty}

\clearpage
\pagenumbering{roman}

\tableofcontents

\clearpage
\pagenumbering{arabic}

\chapter{Chapter 1}

Located on a rift\index{rift} between tectonic plates, Iceland's 
geologic activity includes geysers\index{geysers} and frequent 
volcanic eruptions\index{volcanic eruptions}. The interior 
consists of a volcanic plateau characterised by sand and lava 
fields, mountains, and glaciers, and many glacial rivers flow 
to the sea through the lowlands. Iceland is warmed by the 
Gulf~Stream\index{Gulf Stream} and has a temperate climate, 
despite a latitude just south of the Arctic~Circle\index{Arctic Circle}.
Its high latitude and marine influence keep summers chilly, 
and most of its islands have a polar climate.



\chapter{Chapter 2}

According to the ancient manuscript Landnámabók\index{Landnámabók}, 
the settlement of Iceland\index{Iceland} began in 874~AD when the 
Norwegian chieftain Ingólfr Arnarson became the first permanent 
settler on the island. In the following centuries, Norwegians, 
and to a lesser extent other \index{Scandinavians}, immigrated to 
Iceland, bringing with them thralls (i.e., slaves or serfs) of 
Gaelic origin.

\chapter{Chapter 3}

The island was governed as an independent commonwealth\index{commonwealth} 
under the native parliament, the Althing, one of the world's 
oldest functioning legislative assemblies. Following a period of 
civil strife, Iceland acceded to Norwegian rule in the 13th century. 
In 1397, Iceland followed Norway's integration into the Kalmar Union 
along with the kingdoms of Denmark and Sweden, coming under de facto 
Danish rule following its dissolution in 1523. The Danish kingdom 
introduced Lutheranism by force in 1550, and Iceland was formally 
ceded to Denmark in 1814 by the Treaty of Kiel.

Influenced by ideals of nationalism after the French Revolution, 
Iceland's struggle for independence took form and culminated in the 
Danish–Icelandic Act of Union\index{Danish–Icelandic Act of Union} 
in 1918, with the establishment of the Kingdom of Iceland, sharing 
through a personal union the incumbent monarch of Denmark. During 
the occupation of Denmark in World War II, Iceland voted 
overwhelmingly to become a republic in 1944, thus ending the 
remaining formal ties with Denmark. Although the Althing was 
suspended from 1799 to 1845, the island republic nevertheless 
holds a claim to sustaining one of the longest-running parliaments 
in the world.

\printindex

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .