2

I want to customize label of an environment I've created. I use Emacs/AucTex/Reftex.

I've customized my .emacs file and it works well so far to automatically create a label when inserting my environment.

(setq
 reftex-label-alist
 '(("point" ?p "pt:" "~\\ref{%s}" t  ("point" "pt.")))
 reftex-insert-label-flags '("s" "ft"))

(add-hook
 'LaTeX-mode-hook
 (lambda ()
   (LaTeX-add-environments
    '("point" LaTeX-env-label))
   (add-to-list 'LaTeX-label-alist '("point" . "pt:"))))

It generates the following label: pt:1, pt:2, and so on.

This environment is always inserted under a section, let say section{Reviewer 1}\label{sec:reviewer-1}.

I now want to personalize this reference as follows: pt:reviewer-1-1. Thus, it requires, if possible, to re-use the section's label. I've tried to modify the reftex-label-alist but this does not work.

Ideally, a mwe would be

\documentclass{article}
\begin{document}

\section{Reviewer 1}
\label{sec:reviewer-1}

\begin{point}
\label{reviewer-1-1}
blablabla 
\end{point}

\begin{point}
\label{reviewer-1-2}
blablabla 
\end{point}

\section{Reviewer 2}
\label{sec:reviewer-2}

\begin{point}
\label{reviewer-2-1}
blablabla 
\end{point}

\end{document}
Drew
  • 75,699
  • 9
  • 109
  • 225
Guillaume
  • 179
  • 4

0 Answers0