Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have some problems with making a list of hypothesis and references to my hypothesis.

\documentclass[12pt, a4paper, makeidx]{memoir}
    \usepackage{ntheorem}


% *************** hyperlinks in PDF documents ***************

\ifpdf
    \pdfcompresslevel=9
        \usepackage[plainpages=false,pdfpagelabels,bookmarksnumbered,%
        colorlinks=true,%
        linkcolor=black,% 
        citecolor=black,%
        filecolor=black,%
        pagecolor=black,%
        urlcolor=black,%
        pdftex,%
        unicode]{hyperref} 
    \input supp-mis.tex
    \input supp-pdf.tex
    \pdfimageresolution=600
    \usepackage{thumbpdf} 
\else
    \usepackage{hyperref}
\fi
    \usepackage{memhfixc}

% *************** Hypothesis ***************
\newtheorem{hypo}{Hypothesis}[chapter]
\newtheorem{hypolist}{Hypothesis}[chapter]


\newcommand*\hypothesis[1]{%
   \stepcounter{hypolist}%
    \addtheoremline{hypolist}{#1}%
  \begin{hypo}#1\end{hypo}
}

\begin{document}
\chapter{} 
    \hypothesis{Name were we at hope. Remainder household direction zealously the unwilling bed sex. Lose and gay ham sake met that. Stood her place one ten spoke yet. Head case knew ever set why over. Marianne returned of peculiar replying in moderate. Roused get enable garret estate old county. Entreaties you devonshire law dissimilar terminated. }

\chapter{} 
\hypothesis{Name were we at hope. Remainder household direction zealously the unwilling bed sex. Lose and gay ham sake met that. Stood her place one ten spoke yet. Head case knew ever set why over. Marianne returned of peculiar replying in moderate. Roused get enable garret estate old county. Entreaties you devonshire law dissimilar terminated. }


So by colonel hearted ferrars. Draw from upon here gone add one. He in sportsman household otherwise it perceived instantly. Is inquiry no he several excited am. Called though excuse length ye needed it he having. Whatever throwing we on resolved entrance together graceful. Mrs assured add private married removed believe did she. \

So by colonel hearted ferrars. Draw from upon here gone add one. He in sportsman household otherwise it perceived instantly. Is inquiry no he several excited am. Called though excuse length ye needed it he having. Whatever throwing we on resolved entrance together graceful. Mrs assured add private married removed believe did she. 


\clearpage
\chapter*{List of Hypothesis}
\listtheorems{hypolist} 

\end{document}

It seems that hyperref in combination with ntheorem cause unwanted references in the hypothesis list. The list of hypothesis contains a reference to the chapter (chapter 1) and the hypothesis number (hypo 1.1.) following the hypothesis. If a remove the hyperref package the list of hypothesis appears as I want it to be.

Q1: how can I get a list of hypothesis without the chapter ref. and hypo ref. following the hypothesis, without removing hyperref?

Q2: how to refer in the text to the hypothesis?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

You have to load

\usepackage[hyperref]{ntheorem}

and to use \refstepcounter{hypolist} rather than \stepcounter{hypolist}.

If you want to set references to your hypotheses, I suggest to add an optional argument:

\newcommand*\hypothesis[2][]{%
  \refstepcounter{hypolist}%
  \if!#1!\else\label{#1}\fi
  \addtheoremline{hypolist}{#2}%
  \begin{hypo}#2\end{hypo}
}

so that you can say

\hypothesis[foo]{Text}

and then \ref{foo} will refer to the number of the hypothesis.

By the way, your input has some glitches.

  1. makeidx is not an option for \documentclass

  2. thumbpdf is not necessary, unless you use a very old PDF previewer that can't generate thumbnails on the fly.

  3. Inputting supp-mis.tex and supp-pdf.tex shouldn't be necessary.


A different solution allows for a better input:

% *************** Hypothesis ***************
\newtheorem{hypoin}{Hypothesis}[chapter]
\newtheorem{hypoaux}{Hypothesis}[chapter]
\usepackage{environ,etoolbox}
\makeatletter
\def\addtohypolist{\addtheoremline{hypoaux}}
\NewEnviron{hypo}{%
  \refstepcounter{hypoaux}%
  \expandafter\addtohypolist\expandafter{\expandafter\ignorespaces\BODY}
  \begin{hypoin}\BODY\end{hypoin}
}
\patchcmd\listtheorems
  {\begingroup}
  {\begingroup\let\label\@gobble}
  {}{}
\makeatother

If you change your code with this one, then your hypotheses can be input in the following way:

\begin{hypo}\label{foo}
This is one of the hypotheses.
\end{hypo}

and you can reference to it with the usual \ref{foo}.

share|improve this answer
    
Thanks a million for the solution and for pointing out the glitches. That makeidx is not an option for \documentclass surprised me. I thought I need it to make a .idx. I used to thumbpdf in case of. –  Adam Feb 17 '13 at 11:37
    
@Adam It's \usepackage{makeidx} and then \makeindex if you want to make an index. Using thumbpdf is just a waste of time, in my opinion. –  egreg Feb 17 '13 at 11:43
    
Thanks and your right the thumbpdf is a waste of time. –  Adam Feb 17 '13 at 13:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.