[OS X TeX] Automatic labeling for references
Alain Schremmer
schremmer.alain at gmail.com
Sat Apr 5 23:52:04 CEST 2008
On Apr 5, 2008, at 3:59 AM, Ross Moore wrote:
> Surely it is better to pass 2 arguments to \mysection .
>
> Then use \mysection{A novel approach to something old}
> {sec:ANovelApproach}
> to expand to:
>
> \section{A novel approach to something old}\label{sec:ANovelApproach}
I tried to incorporate Fagin's solution in the above and with, in the
preamble,
\usepackage{titleref}
\newcounter{labb}
\newcommand{\lab}[1]{\label{#1}\stepcounter{labb}}
\renewcommand\theTitleReference[2]{\bfseries{#1}\ \emph{#2}}
and in the body
\section{This And That} \lab{1}
both
\ref{1}
and
\titleref{1}
typeset correctly to "4.7" and "4.7 This And That"
2) In the preamble I then tried to define mysection but everything I
tried failed miserably.
Hopeful regards
--schremmer
More information about the macostex-archives
mailing list