列出假设以及对假设的引用

列出假设以及对假设的引用

我在列出假设以及引用我的假设时遇到了一些问题。

\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}

似乎hyperref与导致ntheorem假设列表中出现不必要的引用。假设列表包含对章节(第 1 章)的引用以及假设后的假设编号(假设 1.1)。如果删除包,hyperref假设列表就会按我想要的方式显示。

问题 1:如何才能获得一个没有章节参考的假设列表,以及假设后面的假设参考,而不删除hyperref

Q2:文中如何引用假设?

答案1

你必须加载

\usepackage[hyperref]{ntheorem}

并使用\refstepcounter{hypolist}而不是\stepcounter{hypolist}

如果您想为您的假设设置参考,我建议添加一个可选参数:

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

所以你可以说

\hypothesis[foo]{Text}

然后\ref{foo}将引用假设的数量。

顺便说一句,您的输入有一些问题。

  1. makeidx不是一种选择\documentclass

  2. thumbpdf没有必要,除非您使用无法动态生成缩略图的非常旧的 PDF 预览器。

  3. 输入supp-mis.texsupp-pdf.tex不应该是必要的。


不同的解决方案可以提供更好的输入:

% *************** 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

如果您使用此代码更改代码,那么您的假设可以通过以下方式输入:

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

并且您可以使用通常的方式引用它\ref{foo}

相关内容