Re: [dk-tug] Automatiserede referencer

Lars Madsen <[email protected]>
Newsgroups gmane.comp.tex.danish
Message-ID <[email protected]>
Martin Heller wrote, On 2012-03-01 15:58:
> Lars Madsen wrote, on 01-03-2012 14:58:
>> Hvad har I af forslag?
> 
> Hvad med bare at bruge \autoref fra hyperref pakken?
> 
> \documentclass{book}
> \usepackage{hyperref}
> \usepackage{mathtools,amsthm}
> \newtheorem{theorem}{Theorem}[section]
> 
> \begin{document}
> 
> \chapter{Foo}
> \label{chap:foo}
> 
> \section{Bar}
> \label{sec:bar}
> 
> \begin{theorem}[Baz]
> \label{thm:baz}
> bar
> \end{theorem}
> 
> \noindent
> Ref to chapter \autoref{chap:foo}\\
> Ref to section: \autoref{sec:bar}\\
> Ref to theorem: \autoref{thm:baz}.
> 
> \end{document}
> 
> 
> _______________________________________________
> [email protected] mailing list
> http://mailman.nfit.au.dk/mailman/listinfo/tug.dk-dk-tug

primært et ønske om at løsningen skal virke med OG uden hyperref

Jeg forstår f.eks. ikke helt dette cleveref resultat, hvorfor hulen kan 
de finde ud af navnet på 'thm', men ikke på 'theorem'

\documentclass[a4paper]{article}
\usepackage{cleveref}
\newtheorem{theorem}{S\ae tning}
\newtheorem{thm}{S\ae tning}
\newtheorem{definition}{Definition}
\begin{document}

\nameCref{theorem}

\nameCref{thm}

\nameCref{definition}

\begin{theorem}
   \label{theorem}
   test
\end{theorem}
\begin{thm}
   \label{thm}
   test
\end{thm}
\begin{definition}
   \label{definition}
   rsdsddfsdf
\end{definition}
\end{document}






-- 

/daleif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.