How to get correct autoref for theorems
\autoref
requires the name of the environment in the form \<name>autorefname
to work. So, in order to properly "auto reference" your satz
theorem, you should use
\newcommand{\satzautorefname}{Satz}
\documentclass[ngerman,halfparskip,12pt,pointednumbers]{scrreprt}
%\usepackage{babel}
%\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsfonts,amssymb,amsthm,bbm}
\usepackage{hyperref}
\newtheoremstyle{absatz}
{17pt}{10pt}{}{-1pt}{\scshape\bfseries}{.}{\newline}{}
\theoremstyle{absatz}
\newtheorem{satz}{Satz}[chapter]
\newtheorem*{satz*}{Satz}
\newtheorem{lemma}[satz]{Lemma}
\newtheorem{corollar}[satz]{Korollar}
\newcommand{\satzautorefname}{Satz}
\begin{document}
\begin{satz}
\label{Satz}
text text theorem
\end{satz}
In \autoref{Satz} we have shown...
\end{document}
I like all of my theorems etc numbered in sync with equations. For this I use the following macro to create my theorem-like environments:
% Some trickery to make \NewTheorem{} define theorem like environments
% work correctly with \autoref{}
\usepackage{aliascnt}
\def\NewTheorem#1{%
\newaliascnt{#1}{equation}
\newtheorem{#1}[#1]{#1}
\aliascntresetthe{#1}
\expandafter\def\csname #1autorefname\endcsname{#1}
}
Then I define
\NewTheorem{Theorem}
\NewTheorem{Corollary}
etc and use \begin{Theorem}...\end{Theorem}
etc in the text.
Note that the environment name (Theorem
, Corollary
etc) is the label that is used by \autoref
.
Here a somewhat "less professional" method that I find quite usefull and easy:
Load the hyperref
package and insert the following in your preamble
\newcommand{\sref}[2]{\hyperref[#2]{#1 \ref{#2}}}
Now you can refer to anything by typing \sref{<theorem_description>}{<label_name>}
. The <theorem_description>
can be anything you want. I personally don't mind a solution like this because it requires almost no extra typing. Also it can be typed differenly in any situation, which I find quite usefull at the beginning of a sentence for instance.
Here's a MWE
\documentclass{article}
\usepackage{hyperref}
\newcommand{\sref}[2]{\hyperref[#2]{#1 \ref*{#2}}}
\newtheorem{satz}{Satz}[section]
\newtheorem{folge}[satz]{Folge}
\begin{document}
\section{YOLO}
\begin{satz}\label{label1} Ein schoener Satz.
\end{satz}
\begin{folge}\label{label2}Wegen \sref{satz}{label1} folgt....
\end{folge}
\sref{Folge}{label2} has a capital, since it is the beginning of a sentence.
\end{document}
Output: