Math & ScienceNo counter 'Својство1' defined.

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Srcee
Posts: 13
Joined: Tue Jun 28, 2011 2:17 pm

No counter 'Својство1' defined.

Post by Srcee »

Okay, I include these packages:

Code: Select all

\newtheorem{Својство1}{Својство}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{amssymb}%baki
\usepackage{amsthm}%za dokaz
\usepackage{amsmath}%baki
\usepackage{fancyhdr}
\usepackage[dvipdf]{graphicx}
\usepackage{xunicode}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{url}
\usepackage{pdfpages}
\usepackage{multicol}
\usepackage{slashbox}
\usepackage{multirow}
\XeTeXinputencoding utf-8
\setmainfont[Mapping=tex-text]{Times New Roman}
and later in the code I have:

Code: Select all

\begin{Својство1}
%Ако A е k-множество, тогаш во A постојат ${k^k}^n$
различни n-арни операции.
\end{Својство1}

\begin{proof}

\end{proof}
To have a proof, I must include the amsthm package, but when I include it I think there's a conflict between it and the other packages.
Last edited by Stefan Kottwitz on Tue Jun 28, 2011 5:49 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Re: No counter 'Својство1' defined.

Post by localghost »

When declaring a new theorem, you also create a new counter. But alphanumeric names for counters (or similar structures) are not allowed. So, just rename your theorem »Својство1« and avoid any digits in the name.


Best regards and welcome to the board
Thorsten
Srcee
Posts: 13
Joined: Tue Jun 28, 2011 2:17 pm

Re: No counter 'Својство1' defined.

Post by Srcee »

I did it and I still can't write my proof.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No counter 'Својство1' defined.

Post by localghost »

Then you have to completely abstain from declaring theorems with Cyrillic letters. The same rule as for labels and similar things seems to apply here. No digits and no foreign characters.

Code: Select all

\newtheorem{whatever}{Својство}
Srcee
Posts: 13
Joined: Tue Jun 28, 2011 2:17 pm

Re: No counter 'Својство1' defined.

Post by Srcee »

Okay, now I have this:


\newtheorem{Svvv}{Својство}
\usepackage{ucs}

\usepackage[utf8x]{inputenc}

\usepackage{amssymb}%baki
\usepackage{amsthm}%za dokaz
\usepackage{amsmath}%baki

\usepackage{fancyhdr}

\usepackage[dvipdf]{graphicx}

\usepackage{xunicode}

\usepackage{fontspec,xltxtra,xunicode}

\usepackage{url}

\usepackage{pdfpages}

\usepackage{multicol}

\usepackage{slashbox}

\usepackage{multirow}

\XeTeXinputencoding utf-8

\setmainfont[Mapping=tex-text]{Times New Roman}


and later in the file:

\begin{Svvv}
Ако A е k-множество, тогаш во A постојат ${k^k}^n$ различни n-арни операции.
\end{Svvv}

\begin{proof}
% ako go smenis imeto dava greska environment proof undefined
\end{proof}


And I still get the error:
! LaTeX Error: Something's wrong--perhaps a missing \item.

l.68 Ак
о A е k-множество, тогаш во A постојат ${...
?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No counter 'Својство1' defined.

Post by localghost »

Provide a true minimal example that is compilable as provided for everybody.

And by the way, the forum software offers a »Code« environment to tag code as such. The button is in the list right above the input window while composing a message. It would be very kind if you use it. It just keep a post clear and legible.


Thorsten
Srcee
Posts: 13
Joined: Tue Jun 28, 2011 2:17 pm

No counter 'Својство1' defined.

Post by Srcee »

Okay. Problem:

Code: Select all

\documentclass[11pt, twoside, b5paper]{book}
\newtheorem{First}{Theorem}
\newtheorem{Second}{Theorem}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{amssymb}%baki
		%\usepackage{amsthm}%za dokaz
\usepackage{amsmath}%baki
\usepackage{fancyhdr}
\usepackage[dvipdf]{graphicx}
\usepackage{xunicode}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{url}
\usepackage{pdfpages}
\usepackage{multicol}
\usepackage{slashbox}
\usepackage{multirow}
\XeTeXinputencoding utf-8
\setmainfont[Mapping=tex-text]{Times New Roman}

\title{blaaaa}  
\author{bla bla}   
\date{Јуни 28, 2011}  
\begin{document}           % pocetok
\chapter{КОНЕЧНИ БУЛОВИ АЛГЕБРИ И БУЛОВИ ФУНКЦИИ}
\section{Конечни алгебри.}  

\begin{First}
Ако A е k-множество, тогаш во A постојат ${k^k}^n$ различни n-арни операции.
\end{First}

%\begin{proof}
% ako go smenis imeto dava greska environment proof undefined
%\end{proof}

\begin{Second}
Ако A е k-множество, тогаш постојат точно $k^{k^{n_{1}}+k^{n_{2}}+...+k^{n_{r}}}$ алгебри со носач A и со тип ($n_{1}$, $n_{2}$, ..., $n_{r}$).
\end{Second}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\begin{proof}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\end{proof}

\end{document}         

Two problem in the code above:

1. In the pdf file, the theorems are all named Theorem 1. I want the first one to be named Theorem 1, the sedonc to be named Theorem 2 etc. How do I do this?

2. if I uncomment the %\usepackage{amsthm} line, and the \begin and \end proof parts, I get the error: ! LaTeX Error: No counter 'Theorem' defined.

Also, a few more questions:
3. How to make the first chapter to be Chapter 2? Because a friend of mine and I print a book and she writes the first chapter, I write the second.
4. On the pdf output it's written Chapter, but I don't write in English (as you noticed :)) and I need instead of 'chapter', the name to be 'glava'
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No counter 'Својство1' defined.

Post by localghost »

Srcee wrote:1. In the pdf file, the theorems are all named Theorem 1. I want the first one to be named Theorem 1, the sedonc to be named Theorem 2 etc. How do I do this? […]
You seem to misunderstand the principal of using \newtheorem. You are defining two different theorem environments with identical name to print in the output. So if you call them both for the first time, you seemingly get one theorem with a counter not incremented. I think the code below clarifies that. Refer to the amsthm manual for the details.
Srcee wrote:2. if I uncomment the %\usepackage{amsthm} line, and the \begin and \end proof parts, I get the error: ! LaTeX Error: No counter 'Theorem' defined. […]
The load sequence is important. This is a problem specific to XeLaTeX. But the below code works. With your code I got not the error you described, but a lot of others.
Srcee wrote:3. How to make the first chapter to be Chapter 2? Because a friend of mine and I print a book and she writes the first chapter, I write the second. […]
Assign an according value to the »chapter« counter by the \setcounter command.
Srcee wrote:4. On the pdf output it's written Chapter, but I don't write in English (as you noticed :)) and I need instead of 'chapter', the name to be 'glava'
Use the polyglossia package (see code below).

Code: Select all

\documentclass[11pt,b5paper]{book}
\usepackage{mathtools}   % loads »amsmath«
\usepackage{amssymb,amsthm}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{polyglossia}

\setmainlanguage{russian}
\setmainfont[Mapping=tex-text]{Times New Roman}

\newtheorem{lemma}{Lemma}      % insert Russian name for 'Lemma' in the second argument
\newtheorem{theorem}{Theorem}  % insert Russian name for 'Theorem' in the second argument

\title{Title} 
\author{Author}   
\date{Јуни 28, 2011} 

\begin{document}
  \chapter{КОНЕЧНИ БУЛОВИ АЛГЕБРИ И БУЛОВИ ФУНКЦИИ}
    \section{Конечни алгебри.} 

      \begin{lemma}
        Ако A е k-множество, тогаш во A постојат ${k^k}^n$ различни n-арни операции.
      \end{lemma}

      \begin{proof}
        ako go smenis imeto dava greska
      \end{proof}

      \begin{theorem}
        Ако A е k-множество, тогаш постојат точно $k^{k^{n_{1}}+k^{n_{2}}+...+k^{n_{r}}}$ алгебри со носач A и со тип ($n_{1}$, $n_{2}$, ..., $n_{r}$).
      \end{theorem}
\end{document}
Srcee
Posts: 13
Joined: Tue Jun 28, 2011 2:17 pm

No counter 'Својство1' defined.

Post by Srcee »

Tnx for the answers.

1. Your answer solved my problem, but I have a new one. In my book, I have theorems and lemmas. But their numbering continues. For example, after theorem 1, if there is lemma, its name is lemma 2. If I write:

Code: Select all

\newtheorem{First}{Theorem}
\newtheorem{Second}{Lemma}
the numbering starts from 1. I want the numbering to resume from the theorem.

2. Which errors do you get? Are you compiling in Xelatex? Cause I do.
If you uncomment the line %\usepackage{amsthm} line, do you get any errors?

3. I tried with \setcounter but I don't know how it works. Can you give me a one-line example?

4. Tnx for your answer but is there a way for doing this without installing new packages?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

No counter 'Својство1' defined.

Post by localghost »

Srcee wrote:[…] 1. Your answer solved my problem, but I have a new one. In my book, I have theorems and lemmas. But their numbering continues. […]
You can make such environments share one counter. See code below for the full example.
Srcee wrote:[…] 2. Which errors do you get? Are you compiling in Xelatex? Cause I do.
If you uncomment the line %\usepackage{amsthm} line, do you get any errors? […]
I compiled with XeLaTeX and got the same error. I must have mixed up something.
Srcee wrote:[…] 3. I tried with \setcounter but I don't know how it works. Can you give me a one-line example? […]
Just set the »chapter« counter before introducing the next chapter. See code below.
Srcee wrote:[…]4. Tnx for your answer but is there a way for doing this without installing new packages?
The package is not only for this purpose but also provides correct hyphenation for your document. So it is the preferable method to use it. Are there any reasonable arguments against the installation?

Code: Select all

\documentclass[11pt,b5paper]{book}
\usepackage{mathtools}   % loads »amsmath«
\usepackage{amssymb,amsthm}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{polyglossia}

%\setmainlanguage{russian}
\setmainfont[Mapping=tex-text]{Times New Roman}

\newtheorem{theorem}{Theorem}           % insert Russian name for 'Theorem' in the second argument
\newtheorem{lemma}[theorem]{Lemma}      % insert Russian name for 'Lemma' in the second argument

\title{Title}
\author{Author}   
\date{Јуни 28, 2011}

\begin{document}
  \setcounter{chapter}{1}
  \chapter{КОНЕЧНИ БУЛОВИ АЛГЕБРИ И БУЛОВИ ФУНКЦИИ}
    \section{Конечни алгебри.}

      \begin{lemma}
        Ако A е k-множество, тогаш во A постојат ${k^k}^n$ различни n-арни операции.
      \end{lemma}

      \begin{proof}
        ako go smenis imeto dava greska
      \end{proof}

      \begin{theorem}
        Ако A е k-множество, тогаш постојат точно $k^{k^{n_{1}}+k^{n_{2}}+...+k^{n_{r}}}$ алгебри со носач A и со тип ($n_{1}$, $n_{2}$, ..., $n_{r}$).
      \end{theorem}
\end{document}
Post Reply