Discussion:
reference to theorems, figures
sebszab
2006-11-10 11:39:36 UTC
Permalink
Hi, I have two (not related) questions:
1. How can I make cross references to theorems, definitions, etc? As I
can see, the \label command can only refer to sections, figures, tables
and equations. How could I do, for example, that "as we have seen in
Theorem 2.1..."?
2. Is there an easy way to draw graphs? I would like to plot some
simple functions (for example, a normal pdf), but making these graphs
seems very cumbersome to me. Isn't there any package where I only need
to put the formula for the function and the range, and the program
draws it?
+1. I also have problems with the cross references of figures. The
figure has good label (for example, Figure 2.1), but in the text there
is Figure 2.2.1. How could I correct this?

Thanks very much.
Regards,
Szabolcs Sebestyén
Kristof Möller
2006-11-10 13:06:11 UTC
Permalink
Hi,

1) Have You try it? It should also work for theorems, definitions, etc.

+1) Have You switched off the chapter numbers for Your figures?
(A small example code from You could be useful to solve this...)

2) e.g. PSTRICKS (http://tug.org/PSTricks/main.cgi?file=docs)

Plotting data from a file or a formula...

\psset{xunit=1cm,yunit=1cm,runit=1cm}
\begin{pspicture}(0.5,0.5)(3,2)
\mypsgrid{(0,0)(3,2)}
\readdata{\mydata}{plot01.dat}
\dataplot[linewidth=1pt,plotstyle=curve]{\mydata}
\end{pspicture}

\psset{unit=1cm}
\begin{pspicture}(-4,-0.5)(4,8)
\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
\psline[linewidth=1pt]{->}(-4,0)(+4,0)
\psline[linewidth=1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{0.9}{10 x exp}% postscript function
\rput[l](1,7.5){$10^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{3}{2 x exp}% postscript function
\rput[l](2.2,7.5){$e^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{2.05}{2.7183 x exp}% postscript function
\rput[l](3.2,7.5){$2^x$}
\end{pspicture}


...or You can use JPicEdt to draw your curves and add some text...
(http://jpicedt.sourceforge.net/)

Greetings
Kris
Post by sebszab
1. How can I make cross references to theorems, definitions, etc? As I
can see, the \label command can only refer to sections, figures, tables
and equations. How could I do, for example, that "as we have seen in
Theorem 2.1..."?
2. Is there an easy way to draw graphs? I would like to plot some
simple functions (for example, a normal pdf), but making these graphs
seems very cumbersome to me. Isn't there any package where I only need
to put the formula for the function and the range, and the program
draws it?
+1. I also have problems with the cross references of figures. The
figure has good label (for example, Figure 2.1), but in the text there
is Figure 2.2.1. How could I correct this?
Thanks very much.
Regards,
Szabolcs Sebestyén
sebszab
2006-11-10 23:44:13 UTC
Permalink
Hi,

1. No, I haven't tried it, but how should I define labels for
theorems using the label command? For example, for sections is easy
as I can put \label{sec:anything}, but how does it work for theorems?

2. Thanks very much, I'm gonna have a look at it.

+1. How can I switch off the chapter numbers for figures?

Regards,
Szabolcs
Post by Kristof Möller
Hi,
1) Have You try it? It should also work for theorems, definitions, etc.
+1) Have You switched off the chapter numbers for Your figures?
(A small example code from You could be useful to solve
this...)
Post by Kristof Möller
2) e.g. PSTRICKS (http://tug.org/PSTricks/main.cgi?file=docs)
Plotting data from a file or a formula...
\psset{xunit=1cm,yunit=1cm,runit=1cm}
\begin{pspicture}(0.5,0.5)(3,2)
\mypsgrid{(0,0)(3,2)}
\readdata{\mydata}{plot01.dat}
\dataplot[linewidth=1pt,plotstyle=curve]{\mydata}
\end{pspicture}
\psset{unit=1cm}
\begin{pspicture}(-4,-0.5)(4,8)
\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
\psline[linewidth=1pt]{->}(-4,0)(+4,0)
\psline[linewidth=1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{0.9}{10 x exp}%
postscript function
Post by Kristof Möller
\rput[l](1,7.5){$10^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{3}{2 x exp}%
postscript function
Post by Kristof Möller
\rput[l](2.2,7.5){$e^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{2.05}{2.7183 x
exp}% postscript function
Post by Kristof Möller
\rput[l](3.2,7.5){$2^x$}
\end{pspicture}
...or You can use JPicEdt to draw your curves and add some
text...
Post by Kristof Möller
(http://jpicedt.sourceforge.net/)
Greetings
Kris
Post by sebszab
1. How can I make cross references to theorems, definitions,
etc? As I
Post by Kristof Möller
Post by sebszab
can see, the \label command can only refer to sections, figures, tables
and equations. How could I do, for example, that "as we have
seen in
Post by Kristof Möller
Post by sebszab
Theorem 2.1..."?
2. Is there an easy way to draw graphs? I would like to plot some
simple functions (for example, a normal pdf), but making these graphs
seems very cumbersome to me. Isn't there any package where I
only need
Post by Kristof Möller
Post by sebszab
to put the formula for the function and the range, and the
program
Post by Kristof Möller
Post by sebszab
draws it?
+1. I also have problems with the cross references of figures. The
figure has good label (for example, Figure 2.1), but in the text there
is Figure 2.2.1. How could I correct this?
Thanks very much.
Regards,
Szabolcs Sebestyén
Kristof Möller
2006-11-11 09:57:15 UTC
Permalink
Hi again,

1) here is a small example (straight forward, I think ;-) ):

\documentclass{book}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{First Chapter}
\section{First Section}
\begin{theorem}
\label{th:theo1}
This is Theorem \ref{th:theo1}...
\end{theorem}
\section{Second Section}
\begin{theorem}
\label{th:theo2}
This is Theorem \ref{th:theo2}, but please
have a look on Theorem \ref{th:theo1}...
\end{theorem}
\end{document}

+1) Depends on the package You're using for captions (e.g. caption2),
as mentioned before, a small example from You (like the one on top)
would be helpful!

Greetings
Kris
Post by sebszab
Hi,
1. No, I haven't tried it, but how should I define labels for
theorems using the label command? For example, for sections is easy
as I can put \label{sec:anything}, but how does it work for theorems?
2. Thanks very much, I'm gonna have a look at it.
+1. How can I switch off the chapter numbers for figures?
Regards,
Szabolcs
<mailto:TeXnicCenter-Users%40yahoogroups.com>, Kristof Möller
Post by Kristof Möller
Hi,
1) Have You try it? It should also work for theorems, definitions,
etc.
Post by Kristof Möller
+1) Have You switched off the chapter numbers for Your figures?
(A small example code from You could be useful to solve
this...)
Post by Kristof Möller
2) e.g. PSTRICKS (http://tug.org/PSTricks/main.cgi?file=docs
<http://tug.org/PSTricks/main.cgi?file=docs>)
Post by Kristof Möller
Plotting data from a file or a formula...
\psset{xunit=1cm,yunit=1cm,runit=1cm}
\begin{pspicture}(0.5,0.5)(3,2)
\mypsgrid{(0,0)(3,2)}
\readdata{\mydata}{plot01.dat}
\dataplot[linewidth=1pt,plotstyle=curve]{\mydata}
\end{pspicture}
\psset{unit=1cm}
\begin{pspicture}(-4,-0.5)(4,8)
\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
\psline[linewidth=1pt]{->}(-4,0)(+4,0)
\psline[linewidth=1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{0.9}{10 x exp}%
postscript function
Post by Kristof Möller
\rput[l](1,7.5){$10^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{3}{2 x exp}%
postscript function
Post by Kristof Möller
\rput[l](2.2,7.5){$e^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{2.05}{2.7183 x
exp}% postscript function
Post by Kristof Möller
\rput[l](3.2,7.5){$2^x$}
\end{pspicture}
...or You can use JPicEdt to draw your curves and add some
text...
Post by Kristof Möller
(http://jpicedt.sourceforge.net/ <http://jpicedt.sourceforge.net/>)
Greetings
Kris
Post by sebszab
1. How can I make cross references to theorems, definitions,
etc? As I
Post by Kristof Möller
Post by sebszab
can see, the \label command can only refer to sections, figures,
tables
Post by Kristof Möller
Post by sebszab
and equations. How could I do, for example, that "as we have
seen in
Post by Kristof Möller
Post by sebszab
Theorem 2.1..."?
2. Is there an easy way to draw graphs? I would like to plot some
simple functions (for example, a normal pdf), but making these
graphs
Post by Kristof Möller
Post by sebszab
seems very cumbersome to me. Isn't there any package where I
only need
Post by Kristof Möller
Post by sebszab
to put the formula for the function and the range, and the
program
Post by Kristof Möller
Post by sebszab
draws it?
+1. I also have problems with the cross references of figures.
The
Post by Kristof Möller
Post by sebszab
figure has good label (for example, Figure 2.1), but in the text
there
Post by Kristof Möller
Post by sebszab
is Figure 2.2.1. How could I correct this?
Thanks very much.
Regards,
Szabolcs Sebestyén
sebszab
2006-11-11 19:41:01 UTC
Permalink
1. OK, I'll give a try, thanks very much.

+1. I don't use any package for captions, should I? I do the
following:

The function is plotted in Figure ~\ref{fig:fun}

\begin{figure}[htbp]
$$
\begin{picture}(150,65)
commands to define function
\caption{Function \label{fig:fun}}
$$
\end{figure}

Then in the pdf file it appears:

The function is plotted in Figure 2.2.1.

function with the label: Function 2.1: Function


Regards,

Szabolcs
Post by Kristof Möller
Hi again,
\documentclass{book}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{First Chapter}
\section{First Section}
\begin{theorem}
\label{th:theo1}
This is Theorem \ref{th:theo1}...
\end{theorem}
\section{Second Section}
\begin{theorem}
\label{th:theo2}
This is Theorem \ref{th:theo2}, but please
have a look on Theorem \ref{th:theo1}...
\end{theorem}
\end{document}
+1) Depends on the package You're using for captions (e.g.
caption2),
Post by Kristof Möller
as mentioned before, a small example from You (like the one on top)
would be helpful!
Greetings
Kris
Post by sebszab
Hi,
1. No, I haven't tried it, but how should I define labels for
theorems using the label command? For example, for sections is easy
as I can put \label{sec:anything}, but how does it work for
theorems?
Post by Kristof Möller
Post by sebszab
2. Thanks very much, I'm gonna have a look at it.
+1. How can I switch off the chapter numbers for figures?
Regards,
Szabolcs
<mailto:TeXnicCenter-Users%40yahoogroups.com>, Kristof Möller
Post by Kristof Möller
Hi,
1) Have You try it? It should also work for theorems,
definitions,
Post by Kristof Möller
Post by sebszab
etc.
Post by Kristof Möller
+1) Have You switched off the chapter numbers for Your figures?
(A small example code from You could be useful to solve
this...)
Post by Kristof Möller
2) e.g. PSTRICKS (http://tug.org/PSTricks/main.cgi?file=docs
<http://tug.org/PSTricks/main.cgi?file=docs>)
Post by Kristof Möller
Plotting data from a file or a formula...
\psset{xunit=1cm,yunit=1cm,runit=1cm}
\begin{pspicture}(0.5,0.5)(3,2)
\mypsgrid{(0,0)(3,2)}
\readdata{\mydata}{plot01.dat}
\dataplot[linewidth=1pt,plotstyle=curve]{\mydata}
\end{pspicture}
\psset{unit=1cm}
\begin{pspicture}(-4,-0.5)(4,8)
\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
\psline[linewidth=1pt]{->}(-4,0)(+4,0)
\psline[linewidth=1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{0.9}{10 x exp}%
postscript function
Post by Kristof Möller
\rput[l](1,7.5){$10^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{3}{2 x exp}%
postscript function
Post by Kristof Möller
\rput[l](2.2,7.5){$e^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{2.05}{2.7183 x
exp}% postscript function
Post by Kristof Möller
\rput[l](3.2,7.5){$2^x$}
\end{pspicture}
...or You can use JPicEdt to draw your curves and add some
text...
Post by Kristof Möller
(http://jpicedt.sourceforge.net/
<http://jpicedt.sourceforge.net/>)
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Greetings
Kris
Post by sebszab
1. How can I make cross references to theorems, definitions,
etc? As I
Post by Kristof Möller
Post by sebszab
can see, the \label command can only refer to sections,
figures,
Post by Kristof Möller
Post by sebszab
tables
Post by Kristof Möller
Post by sebszab
and equations. How could I do, for example, that "as we have
seen in
Post by Kristof Möller
Post by sebszab
Theorem 2.1..."?
2. Is there an easy way to draw graphs? I would like to plot some
simple functions (for example, a normal pdf), but making
these
Post by Kristof Möller
Post by sebszab
graphs
Post by Kristof Möller
Post by sebszab
seems very cumbersome to me. Isn't there any package where I
only need
Post by Kristof Möller
Post by sebszab
to put the formula for the function and the range, and the
program
Post by Kristof Möller
Post by sebszab
draws it?
+1. I also have problems with the cross references of
figures.
Post by Kristof Möller
Post by sebszab
The
Post by Kristof Möller
Post by sebszab
figure has good label (for example, Figure 2.1), but in the text
there
Post by Kristof Möller
Post by sebszab
is Figure 2.2.1. How could I correct this?
Thanks very much.
Regards,
Szabolcs Sebestyén
Kristof Möller
2006-11-12 05:05:16 UTC
Permalink
Okay,

now I can reproduce a similar behaviour - to have the correct
reference-number
You have to change Your figure definition:

The function is plotted in Figure ~\ref{fig:fun}
\begin{figure}[htbp]
$$
\begin{picture}(150,65)
commands to define function
\end{picture}
$$
\caption{Function \label{fig:fun}} % <- \caption outside of $$...$$
\end{figure}

this will create:

The function is plotted in Figure 2.2.1.

function with the label: Function 2.2.1: Function

If You're using \documentclass{book} and You like to have
a reference number like (chapter).(figure), You can use the
amsmath-package to change the behaviour:

\documentclass{book}
\usepackage{amsmath}
\numberwithin{figure}{chapter} % <- reference number (chapter).(figure)
\numberwithin{equation}{section} % <- reference number
(chapter).(section).(figure)
\begin{document}
\chapter{First Chapter}
\section{First Section}
The function is plotted in Figure \ref{fig:fun1}
\begin{figure}[htbp]
$$
\begin{picture}(150,65)
commands to define function
\end{picture}
$$
\caption{Function \label{fig:fun1}}
\end{figure}
\begin{equation}
x^2+y^2=z^2
\end{equation}
\end{document}

Best regards,
Kris
Post by sebszab
1. OK, I'll give a try, thanks very much.
+1. I don't use any package for captions, should I? I do the
The function is plotted in Figure ~\ref{fig:fun}
\begin{figure}[htbp]
$$
\begin{picture}(150,65)
commands to define function
\caption{Function \label{fig:fun}}
$$
\end{figure}
The function is plotted in Figure 2.2.1.
function with the label: Function 2.1: Function
Regards,
Szabolcs
<mailto:TeXnicCenter-Users%40yahoogroups.com>, Kristof Möller
Post by Kristof Möller
Hi again,
\documentclass{book}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{First Chapter}
\section{First Section}
\begin{theorem}
\label{th:theo1}
This is Theorem \ref{th:theo1}...
\end{theorem}
\section{Second Section}
\begin{theorem}
\label{th:theo2}
This is Theorem \ref{th:theo2}, but please
have a look on Theorem \ref{th:theo1}...
\end{theorem}
\end{document}
+1) Depends on the package You're using for captions (e.g.
caption2),
Post by Kristof Möller
as mentioned before, a small example from You (like the one
on top)
Post by Kristof Möller
would be helpful!
Greetings
Kris
Post by sebszab
Hi,
1. No, I haven't tried it, but how should I define labels for
theorems using the label command? For example, for sections is
easy
Post by Kristof Möller
Post by sebszab
as I can put \label{sec:anything}, but how does it work for
theorems?
Post by Kristof Möller
Post by sebszab
2. Thanks very much, I'm gonna have a look at it.
+1. How can I switch off the chapter numbers for figures?
Regards,
Szabolcs
<mailto:TeXnicCenter-Users%40yahoogroups.com>
Post by Kristof Möller
Post by sebszab
<mailto:TeXnicCenter-Users%40yahoogroups.com>, Kristof Möller
Post by Kristof Möller
Hi,
1) Have You try it? It should also work for theorems,
definitions,
Post by Kristof Möller
Post by sebszab
etc.
Post by Kristof Möller
+1) Have You switched off the chapter numbers for Your figures?
(A small example code from You could be useful to solve
this...)
Post by Kristof Möller
2) e.g. PSTRICKS (http://tug.org/PSTricks/main.cgi?file=docs
<http://tug.org/PSTricks/main.cgi?file=docs>
Post by Kristof Möller
Post by sebszab
<http://tug.org/PSTricks/main.cgi?file=docs
<http://tug.org/PSTricks/main.cgi?file=docs>>)
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Plotting data from a file or a formula...
\psset{xunit=1cm,yunit=1cm,runit=1cm}
\begin{pspicture}(0.5,0.5)(3,2)
\mypsgrid{(0,0)(3,2)}
\readdata{\mydata}{plot01.dat}
\dataplot[linewidth=1pt,plotstyle=curve]{\mydata}
\end{pspicture}
\psset{unit=1cm}
\begin{pspicture}(-4,-0.5)(4,8)
\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
\psline[linewidth=1pt]{->}(-4,0)(+4,0)
\psline[linewidth=1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{0.9}{10 x exp}%
postscript function
Post by Kristof Möller
\rput[l](1,7.5){$10^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{3}{2 x exp}%
postscript function
Post by Kristof Möller
\rput[l](2.2,7.5){$e^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{2.05}{2.7183 x
exp}% postscript function
Post by Kristof Möller
\rput[l](3.2,7.5){$2^x$}
\end{pspicture}
...or You can use JPicEdt to draw your curves and add some
text...
Post by Kristof Möller
(http://jpicedt.sourceforge.net/ <http://jpicedt.sourceforge.net/>
<http://jpicedt.sourceforge.net/ <http://jpicedt.sourceforge.net/>>)
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Greetings
Kris
Post by sebszab
1. How can I make cross references to theorems, definitions,
etc? As I
Post by Kristof Möller
Post by sebszab
can see, the \label command can only refer to sections,
figures,
Post by Kristof Möller
Post by sebszab
tables
Post by Kristof Möller
Post by sebszab
and equations. How could I do, for example, that "as we have
seen in
Post by Kristof Möller
Post by sebszab
Theorem 2.1..."?
2. Is there an easy way to draw graphs? I would like to plot
some
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
simple functions (for example, a normal pdf), but making
these
Post by Kristof Möller
Post by sebszab
graphs
Post by Kristof Möller
Post by sebszab
seems very cumbersome to me. Isn't there any package where I
only need
Post by Kristof Möller
Post by sebszab
to put the formula for the function and the range, and the
program
Post by Kristof Möller
Post by sebszab
draws it?
+1. I also have problems with the cross references of
figures.
Post by Kristof Möller
Post by sebszab
The
Post by Kristof Möller
Post by sebszab
figure has good label (for example, Figure 2.1), but in the
text
Post by Kristof Möller
Post by sebszab
there
Post by Kristof Möller
Post by sebszab
is Figure 2.2.1. How could I correct this?
Thanks very much.
Regards,
Szabolcs Sebestyén
sebszab
2006-11-12 11:39:31 UTC
Permalink
OK, now it's working well, thanks very much:)
Just a stupid question: what does the $$ serve for?

Regarding the graphs, I tried your example but it does not work. The
program is the following:

\documentclass{article}

\usepackage{pstricks}
\usepackage{pstricks-add}

\begin{document}

\psset{unit= 1cm}
\begin{pspicture} (-4,-0.5) (4,8)
\psgrid[subgriddiv= 0,griddots= 5,gridlabels= 7pt](-4,- 0.5)(4,8)
\psline[linewidth= 1pt]{->}( -4,0)(+4, 0)
\psline[linewidth= 1pt]{->}( 0,-0.5)(0, 8)
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4} {0.9}{10 x exp}
\rput[l](1,7. 5){$10^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4} {3}{2 x exp}
\rput[l](2.2, 7.5){$e^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4} {2.05}{2. 7183 xexp}
\rput[l](3.2, 7.5){$2^x$ }
\end{pspicture}

\end{document}

There are 27 errors, mainly "Undefined control sequence". What is
wrong here?

Regards,
Szabolcs
Post by Kristof Möller
Okay,
now I can reproduce a similar behaviour - to have the correct
reference-number
The function is plotted in Figure ~\ref{fig:fun}
\begin{figure}[htbp]
$$
\begin{picture}(150,65)
commands to define function
\end{picture}
$$
\caption{Function \label{fig:fun}} % <- \caption outside of $$...$$
\end{figure}
The function is plotted in Figure 2.2.1.
function with the label: Function 2.2.1: Function
If You're using \documentclass{book} and You like to have
a reference number like (chapter).(figure), You can use the
\documentclass{book}
\usepackage{amsmath}
\numberwithin{figure}{chapter} % <- reference number (chapter).
(figure)
Post by Kristof Möller
\numberwithin{equation}{section} % <- reference number
(chapter).(section).(figure)
\begin{document}
\chapter{First Chapter}
\section{First Section}
The function is plotted in Figure \ref{fig:fun1}
\begin{figure}[htbp]
$$
\begin{picture}(150,65)
commands to define function
\end{picture}
$$
\caption{Function \label{fig:fun1}}
\end{figure}
\begin{equation}
x^2+y^2=z^2
\end{equation}
\end{document}
Best regards,
Kris
Post by sebszab
1. OK, I'll give a try, thanks very much.
+1. I don't use any package for captions, should I? I do the
The function is plotted in Figure ~\ref{fig:fun}
\begin{figure}[htbp]
$$
\begin{picture}(150,65)
commands to define function
\caption{Function \label{fig:fun}}
$$
\end{figure}
The function is plotted in Figure 2.2.1.
function with the label: Function 2.1: Function
Regards,
Szabolcs
<mailto:TeXnicCenter-Users%40yahoogroups.com>, Kristof Möller
Post by Kristof Möller
Hi again,
\documentclass{book}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\chapter{First Chapter}
\section{First Section}
\begin{theorem}
\label{th:theo1}
This is Theorem \ref{th:theo1}...
\end{theorem}
\section{Second Section}
\begin{theorem}
\label{th:theo2}
This is Theorem \ref{th:theo2}, but please
have a look on Theorem \ref{th:theo1}...
\end{theorem}
\end{document}
+1) Depends on the package You're using for captions (e.g.
caption2),
Post by Kristof Möller
as mentioned before, a small example from You (like the one
on top)
Post by Kristof Möller
would be helpful!
Greetings
Kris
Post by sebszab
Hi,
1. No, I haven't tried it, but how should I define labels for
theorems using the label command? For example, for sections is
easy
Post by Kristof Möller
Post by sebszab
as I can put \label{sec:anything}, but how does it work for
theorems?
Post by Kristof Möller
Post by sebszab
2. Thanks very much, I'm gonna have a look at it.
+1. How can I switch off the chapter numbers for figures?
Regards,
Szabolcs
<mailto:TeXnicCenter-Users%40yahoogroups.com>
Post by Kristof Möller
Post by sebszab
<mailto:TeXnicCenter-Users%40yahoogroups.com>, Kristof Möller
Post by Kristof Möller
Hi,
1) Have You try it? It should also work for theorems,
definitions,
Post by Kristof Möller
Post by sebszab
etc.
Post by Kristof Möller
+1) Have You switched off the chapter numbers for Your
figures?
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
(A small example code from You could be useful to solve
this...)
Post by Kristof Möller
2) e.g. PSTRICKS (http://tug.org/PSTricks/main.cgi?
file=docs
Post by Kristof Möller
Post by sebszab
<http://tug.org/PSTricks/main.cgi?file=docs>
Post by Kristof Möller
Post by sebszab
<http://tug.org/PSTricks/main.cgi?file=docs
<http://tug.org/PSTricks/main.cgi?file=docs>>)
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Plotting data from a file or a formula...
\psset{xunit=1cm,yunit=1cm,runit=1cm}
\begin{pspicture}(0.5,0.5)(3,2)
\mypsgrid{(0,0)(3,2)}
\readdata{\mydata}{plot01.dat}
\dataplot[linewidth=1pt,plotstyle=curve]{\mydata}
\end{pspicture}
\psset{unit=1cm}
\begin{pspicture}(-4,-0.5)(4,8)
\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)
(4,8)
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
\psline[linewidth=1pt]{->}(-4,0)(+4,0)
\psline[linewidth=1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{0.9}{10 x
exp}%
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
postscript function
Post by Kristof Möller
\rput[l](1,7.5){$10^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{3}{2 x exp}%
postscript function
Post by Kristof Möller
\rput[l](2.2,7.5){$e^x$}
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{2.05}{2.7183 x
exp}% postscript function
Post by Kristof Möller
\rput[l](3.2,7.5){$2^x$}
\end{pspicture}
...or You can use JPicEdt to draw your curves and add some
text...
Post by Kristof Möller
(http://jpicedt.sourceforge.net/
<http://jpicedt.sourceforge.net/>
Post by Kristof Möller
Post by sebszab
<http://jpicedt.sourceforge.net/
<http://jpicedt.sourceforge.net/>>)
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Greetings
Kris
Post by sebszab
1. How can I make cross references to theorems,
definitions,
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
etc? As I
Post by Kristof Möller
Post by sebszab
can see, the \label command can only refer to sections,
figures,
Post by Kristof Möller
Post by sebszab
tables
Post by Kristof Möller
Post by sebszab
and equations. How could I do, for example, that "as we have
seen in
Post by Kristof Möller
Post by sebszab
Theorem 2.1..."?
2. Is there an easy way to draw graphs? I would like to plot
some
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
simple functions (for example, a normal pdf), but making
these
Post by Kristof Möller
Post by sebszab
graphs
Post by Kristof Möller
Post by sebszab
seems very cumbersome to me. Isn't there any package
where I
Post by Kristof Möller
Post by sebszab
Post by Kristof Möller
Post by sebszab
only need
Post by Kristof Möller
Post by sebszab
to put the formula for the function and the range, and the
program
Post by Kristof Möller
Post by sebszab
draws it?
+1. I also have problems with the cross references of
figures.
Post by Kristof Möller
Post by sebszab
The
Post by Kristof Möller
Post by sebszab
figure has good label (for example, Figure 2.1), but in the
text
Post by Kristof Möller
Post by sebszab
there
Post by Kristof Möller
Post by sebszab
is Figure 2.2.1. How could I correct this?
Thanks very much.
Regards,
Szabolcs Sebestyén
Yannick
2006-11-12 12:29:34 UTC
Permalink
Hi sebszap,
try this. I made only one change. I set the option 'algebraic=true'..
This way, you can type in directly the mathematic equation like you're
used to (see the code). (of course, the command in the \psplot is
different too.)
\documentclass{article}

\usepackage{pstricks}
\usepackage{pstricks-add}

\begin{document}

\psset{unit= 1cm,algebraic=true}
\begin{pspicture} (-4,-0.5) (4,8)
\psgrid[subgriddiv= 0,griddots= 5,gridlabels= 7pt](0,0)(-4,- 0.5)(4,8)
\psline[linewidth= 1pt]{->}(-4,0)(+4,0)
\psline[linewidth= 1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{0.9}{ 10^x}
\rput[l](1,7.5){$10^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{3}{2^x}
\rput[l](2.2, 7.5){$e^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{2.05}{2.7183^x}
\rput[l](3.2, 7.5){$2^x$ }
\end{pspicture}

\end{document}




The '$$' means, that you start an 'outline' equation, where '$' starts
an 'inline' equation. Both must be ended as they were started. (with
'$$' or '$')
example:
$$
f(x)=x
$$
or $f(x)=x$
just try.
sebszab
2006-11-12 16:37:04 UTC
Permalink
Undefined control sequence again...
Only in this little program 26 errors:(
Post by Yannick
Hi sebszap,
try this. I made only one change. I set the
option 'algebraic=true'..
Post by Yannick
This way, you can type in directly the mathematic equation like you're
used to (see the code). (of course, the command in the \psplot is
different too.)
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\begin{document}
\psset{unit= 1cm,algebraic=true}
\begin{pspicture} (-4,-0.5) (4,8)
\psgrid[subgriddiv= 0,griddots= 5,gridlabels= 7pt](0,0)(-4,- 0.5)
(4,8)
Post by Yannick
\psline[linewidth= 1pt]{->}(-4,0)(+4,0)
\psline[linewidth= 1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{0.9}{ 10^x}
\rput[l](1,7.5){$10^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{3}{2^x}
\rput[l](2.2, 7.5){$e^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{2.05}{2.7183^x}
\rput[l](3.2, 7.5){$2^x$ }
\end{pspicture}
\end{document}
The '$$' means, that you start an 'outline' equation, where '$' starts
an 'inline' equation. Both must be ended as they were started.
(with
Post by Yannick
'$$' or '$')
$$
f(x)=x
$$
or $f(x)=x$
just try.
Kristof Möller
2006-11-12 16:59:22 UTC
Permalink
Which kind of errors? Do You have installed all packages?
(if You're using MIKTeX, e.g. is the automatic package installation
switched on?)

The error "Undefined control sequence" points to a not installed
pstricks package...
(2 errors of not found packages and 24 errors fore the code = 26
errors... ;-) )

Regards,
Kristof
Post by sebszab
Undefined control sequence again...
Only in this little program 26 errors:(
Post by Yannick
Hi sebszap,
try this. I made only one change. I set the
option 'algebraic=true'..
Post by Yannick
This way, you can type in directly the mathematic equation like
you're
Post by Yannick
used to (see the code). (of course, the command in the \psplot is
different too.)
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\begin{document}
\psset{unit= 1cm,algebraic=true}
\begin{pspicture} (-4,-0.5) (4,8)
\psgrid[subgriddiv= 0,griddots= 5,gridlabels= 7pt](0,0)(-4,- 0.5)
(4,8)
Post by Yannick
\psline[linewidth= 1pt]{->}(-4,0)(+4,0)
\psline[linewidth= 1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{0.9}{ 10^x}
\rput[l](1,7.5){$10^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{3}{2^x}
\rput[l](2.2, 7.5){$e^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{2.05}{2.7183^x}
\rput[l](3.2, 7.5){$2^x$ }
\end{pspicture}
\end{document}
The '$$' means, that you start an 'outline' equation, where '$'
starts
Post by Yannick
an 'inline' equation. Both must be ended as they were started.
(with
Post by Yannick
'$$' or '$')
$$
f(x)=x
$$
or $f(x)=x$
just try.
Bill Hobba
2006-11-13 05:38:45 UTC
Permalink
Hi

Can you remove me from receiving these mails?

Thanks
Bill

-----Original Message-----
From: TeXnicCenter-Users-***@public.gmane.org
[mailto:TeXnicCenter-Users-***@public.gmane.org]On Behalf Of Kristof Möller
Sent: Monday, 13 November 2006 2:59 AM
To: TeXnicCenter-Users-***@public.gmane.org
Subject: Re: [TXC-Users] Re: reference to theorems, figures


Which kind of errors? Do You have installed all packages?
(if You're using MIKTeX, e.g. is the automatic package installation
switched on?)

The error "Undefined control sequence" points to a not installed pstricks
package...
(2 errors of not found packages and 24 errors fore the code = 26 errors...
;-) )

Regards,
Kristof

sebszab schrieb:

Undefined control sequence again...
Only in this little program 26 errors:(
Post by Yannick
Hi sebszap,
try this. I made only one change. I set the
option 'algebraic=true'..
Post by Yannick
This way, you can type in directly the mathematic equation like
you're
Post by Yannick
used to (see the code). (of course, the command in the \psplot is
different too.)
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\begin{document}
\psset{unit= 1cm,algebraic=true}
\begin{pspicture} (-4,-0.5) (4,8)
\psgrid[subgriddiv= 0,griddots= 5,gridlabels= 7pt](0,0)(-4,- 0.5)
(4,8)
Post by Yannick
\psline[linewidth= 1pt]{->}(-4,0)(+4,0)
\psline[linewidth= 1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{0.9}{ 10^x}
\rput[l](1,7.5){$10^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{3}{2^x}
\rput[l](2.2, 7.5){$e^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{2.05}{2.7183^x}
\rput[l](3.2, 7.5){$2^x$ }
\end{pspicture}
\end{document}
The '$$' means, that you start an 'outline' equation, where '$'
starts
Post by Yannick
an 'inline' equation. Both must be ended as they were started.
(with
Post by Yannick
'$$' or '$')
$$
f(x)=x
$$
or $f(x)=x$
just try.
Kristof Möller
2006-11-12 17:22:04 UTC
Permalink
Sorry, another remark...

...PSTricks works easy with the "LaTeX => PS => PDF" output-profile...
(also with "LaTeX => DVI" for fast display!)
...I remember, You're using PDF as the final document...so this could
be also the source of Your 26 errors...

Greetings
Kristof
Post by sebszab
Undefined control sequence again...
Only in this little program 26 errors:(
Post by Yannick
Hi sebszap,
try this. I made only one change. I set the
option 'algebraic=true'..
Post by Yannick
This way, you can type in directly the mathematic equation like
you're
Post by Yannick
used to (see the code). (of course, the command in the \psplot is
different too.)
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\begin{document}
\psset{unit= 1cm,algebraic=true}
\begin{pspicture} (-4,-0.5) (4,8)
\psgrid[subgriddiv= 0,griddots= 5,gridlabels= 7pt](0,0)(-4,- 0.5)
(4,8)
Post by Yannick
\psline[linewidth= 1pt]{->}(-4,0)(+4,0)
\psline[linewidth= 1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{0.9}{ 10^x}
\rput[l](1,7.5){$10^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{3}{2^x}
\rput[l](2.2, 7.5){$e^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{2.05}{2.7183^x}
\rput[l](3.2, 7.5){$2^x$ }
\end{pspicture}
\end{document}
The '$$' means, that you start an 'outline' equation, where '$'
starts
Post by Yannick
an 'inline' equation. Both must be ended as they were started.
(with
Post by Yannick
'$$' or '$')
$$
f(x)=x
$$
or $f(x)=x$
just try.
sebszab
2006-11-13 13:18:37 UTC
Permalink
OK, this was the error... When I use the "LaTeX => PS => PDF" output-
profile, it works well.
Thanks very much.
Greetings,
Szabolcs
Post by Kristof Möller
Sorry, another remark...
...PSTricks works easy with the "LaTeX => PS => PDF" output-
profile...
Post by Kristof Möller
(also with "LaTeX => DVI" for fast display!)
...I remember, You're using PDF as the final document...so this could
be also the source of Your 26 errors...
Greetings
Kristof
Post by sebszab
Undefined control sequence again...
Only in this little program 26 errors:(
Post by Yannick
Hi sebszap,
try this. I made only one change. I set the
option 'algebraic=true'..
Post by Yannick
This way, you can type in directly the mathematic equation like
you're
Post by Yannick
used to (see the code). (of course, the command in the \psplot is
different too.)
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\begin{document}
\psset{unit= 1cm,algebraic=true}
\begin{pspicture} (-4,-0.5) (4,8)
\psgrid[subgriddiv= 0,griddots= 5,gridlabels= 7pt](0,0)(-4,- 0.5)
(4,8)
Post by Yannick
\psline[linewidth= 1pt]{->}(-4,0)(+4,0)
\psline[linewidth= 1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{0.9}{ 10^x}
\rput[l](1,7.5){$10^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{3}{2^x}
\rput[l](2.2, 7.5){$e^x$ }
\psplot[plotstyle= curve,linewidth= 1.5pt]{-4}{2.05}{2.7183^x}
\rput[l](3.2, 7.5){$2^x$ }
\end{pspicture}
\end{document}
The '$$' means, that you start an 'outline' equation, where '$'
starts
Post by Yannick
an 'inline' equation. Both must be ended as they were started.
(with
Post by Yannick
'$$' or '$')
$$
f(x)=x
$$
or $f(x)=x$
just try.
Loading...