0

I have a small project for my mathematics degree and have run up against a small problem. I want to have nested levels of theorems/definitions, for instance in the following code it should produce Definition 2.1 to 2.5 then 2.5.1 for the sub-definition. Below is an edited, for brevity, section of my tex file; nothing of importance has been changed.

\section{Affine Systems} %section 2 of the document
\newtheorem{afnSpace}{Definition}[section]
%Several Definitions which would be numbered sequentially, no issue with these, formatted the same as the line below
\newtheorem{frameDef}[afnSpace]{Definition} %Actually 5th definition
\newtheorem{frameDef s1}{Definition}[frameDef]

\begin{afnSpace} Definition 2.1 content here \end{afnSpace}
%Ommitted several definition environments that work fine
\begin{frameDef} Definition 2.5 content here \end{frameDef}
\begin{frameDef s1} Definition 2.5.1 content here \end{frameDef s1}

The issue here is that on my Ubuntu machine running via texLive, this compiles correctly, though with warning errors about undefined counters; however my supervisor is unable to get this to compile using MikTex.

I know that the solution is to be more explicit with counter creation, as I think that my definitions don't create their own counters, however I don't know how to rectify this. This is amy first ever document created with LaTeX and I don't know quite how it's counter system works.

Any help would be most appreciated,

Regards, Jake.

3

This code compiles fine with MiKTeX:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\newtheorem{afnSpace}{Definition}[section]
\newtheorem{frameDef}[afnSpace]{Definition} %Actually 5th definition
\newtheorem{frameDef s1}{Definition}[afnSpace]

\begin{document}
\setcounter{section}{1}

\section{Affine Systems} %section 2 of the document
%Several Definitions which would be numbered sequentially, no issue with these, formatted the same as the line below
\begin{afnSpace} Definition 2.1 content here \end{afnSpace}
%Omitted several definition environments that work fine
\setcounter{afnSpace}{4}
\begin{frameDef} Definition 2.5 content here \end{frameDef}
\begin{frameDef s1} Definition 2.5.1 content here \end{frameDef s1}

\end{document} 

enter image description here

  • I can't belive that a simple code work for texlive and doesn't for miktex – touhami Mar 31 '15 at 19:23
  • @touhami: I slighly modified it: changed [frameDef] to [afnSpace] in the code for frameDef s1, to have no complaining about undefined counters, that's all. – Bernard Mar 31 '15 at 19:34
  • My first comment was for every body and for the OP in particular. Now: your code does not work for me (no counter afnspace) – touhami Mar 31 '15 at 20:03
  • @touhami: it is afnSpace. Sorry, I forgot to move the declaration of afnSpace new theorem in the preamble. It's corrected now. Thanks for pointing the problem. – Bernard Mar 31 '15 at 20:11
  • Thank you, this compiles without any error complaints on my machine now so hopefully won't give any on my tutors. – user163911 Mar 31 '15 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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