## LaTeX forum ⇒ Text Formatting ⇒ referencing while the sections have * in them

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
pemfir
Posts: 23
Joined: Sun Aug 12, 2012 11:30 pm

### referencing while the sections have * in them

Hello I have the following code, and when i want to cross reference different sections in the appendix, I get basically nothing (blank). Now this may make sense since I am using \section*{} which removes the numbering in the headings, but I was wondering if there is a way I can manually assign a string+value to the label of a section. For example, can I say \subsection*{Appendix Subsection 1 }\label{2}[App.1], so every time I want to cross reference \ref{2} it automatically outputs App.1 ?

Thank you !

\documentclass[10pt,a4paper]{article}\begin{document}this is the first reference: \ref{1}   this is the second reference: \ref{2} this is the third reference: \ref{3} \section*{Appendix}\label{1}\subsection*{Appendix Subsection 1 }\label{2}\subsection*{Appendix Subsection 2 }\label{3}\end{document}
Last edited by cgnieder on Sat Jun 22, 2013 5:13 pm, edited 2 times in total.
Reason: added inline code markup

Tags:

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
Basically you can't: the star form not only removes the number from the sight but also prevents that the section counter is stepped. With a \label always the last counter that has been stepped by \refstepcounter is referenced.

Now, there still are ways. You could, for example, introduce an own counter, manually step it and then reference it but I don't think this is wise: if I as a reader read a reference to App. 1 and nowhere found it because there actually is no appendix 1 (!) I'd be at least confused. Why don't you simply use numbered sections?

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Return to “Text Formatting”

### Who is online

Users browsing this forum: No registered users and 5 guests