0

For some equations I need to visible their label, for example:

/begin{equation}    
    /label{eq:C3}    
    x+y=3    
/end{equation}

I also used the package showlables.

In this case for each equation I received one number and one label

this happens for all equations from the first page to the last page like that:

$x+y=3 $       $ (1.1) (eq:C3)$

But I need the label $(eq:C3)$ just for the equations which are in my last chapter.

Do you have any suggestion?

Angela
  • 3
  • 1
    presumably you used \begin not /begin showlabels is just for debugging so why does it matter if it applies to the whole document? – David Carlisle Feb 10 '19 at 23:08
  • @DavidCarlisle the package which I used before /begin{document} is /usepakage{showlables}, So what do you mean by /begin{showlables} ? – Angela Feb 11 '19 at 09:47
  • @Angela Might this be useful https://tex.stackexchange.com/questions/78579/labelled-in-line-equation. David was referring to your past MWE where you used / instead of \\ (for some reasons, I am not able to highlight my ). – Raaja_is_at_topanswers.xyz Feb 11 '19 at 10:37
  • sorry my comment was two separate comments, the first is asking why you are using / not \ everywhere? you have posted fragments like /begin{equation} which means no one can use your code. the second comment was asking why you only want to use showlabels for part of the document, it is just a debugging package and should not affect the final document at all, so why does it matter if the debugging strings appear in all of the chapters? – David Carlisle Feb 11 '19 at 10:50
  • @DavidCarlisle so sorry for this mistake "/"! I use my phone for writing questions in original documents that's"/begin". – Angela Feb 11 '19 at 11:08
  • Someone had fixed your example and you have just made them all / again, please revert that edit. The label is just an internal cross referencing string and it should never appear in the final document, also do not use labels that are related to the equation number such as eq:C3 – David Carlisle Feb 11 '19 at 11:12
  • 1
    the image that you post to seems completely unrelated to teh question, did you intend to post a different image? – David Carlisle Feb 11 '19 at 11:13
  • 1
    @DavidCarlisle I didn't post this image. I don't know how it came here, !!!! – Angela Feb 11 '19 at 11:17
  • 1
    The question is very confusing in its current state. Can you explain your problem in more detail? – Johannes_B Feb 11 '19 at 11:18
  • @Johannes_B I just want to visible equations label for one chapter of my thesis, I have a lots of equations and when I used package showlables for all equations I have a number and also a label and it makes my work ugly! the problem is that for some equations I just need number of equations for another I want to show label without number and for some both. In latex is this possible???? – Angela Feb 11 '19 at 11:26

1 Answers1

1

If I understand you correctly you want to be able to turn on and off the printing of the labels by the showlabels package. The code below shows how you can define two macros \ShowLabels and \HideLabels that will do just that.

enter image description here

\documentclass{article}
\usepackage{showlabels}
\let\OriginalLabelFormat\showlabelsetlabel
\newcommand\ShowLabels{\let\showlabelsetlabel\OriginalLabelFormat}
\newcommand\HideLabels{\renewcommand\showlabelsetlabel[1]{}}
\begin{document}
\begin{equation}
a=a  \label{a}
\end{equation}

\HideLabels % turns off showing of labels for the following equations
\begin{equation}
a=b  \label{b}
\end{equation}

\ShowLabels % turn on labels again
\begin{equation}
a=c  \label{c}
\end{equation}

\end{document}
Torbjørn T.
  • 206,688