Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like my axis to be labeled $s(t)=\delta(t)$, but this does not work because of the = sign (key-value separator). I had a look into the "Comprehensive Symbols Guide" referenced here: http://w2.syronex.com/jmr/tex/texsym.old.html I also found \equal, but it seems like another package is used and to avoid that .... does anyone know how to handle that?

For comepleteness, this is what I need to compile.

% \begin{axis}[ylabel=$u_1(t)=\delta(t)$,ymax=1.2] does not work
\begin{axis}[ylabel=$u_1(t)\ne\delta(t)$,ymax=1.2] % different symbol, of course
    \addplot [->,>=latex] coordinates {
        (0, 0)
        (0, 1)
    };
\end{axis}
share|improve this question
5  
What about to protect the equal sign with braces {=}? –  Sigur Aug 20 '12 at 11:23
    
@Sigur: Yes, that's the right thing to do. Same thing is true if the titles contain commas. Equal signs and commas are parsed by the key-value system, so they need to be grouped using braces to protect them. Would you mind writing an answer? –  Jake Aug 20 '12 at 11:25
1  
@wal-o-mat: You should always post complete minimal example documents instead of code snippets. That saves others the work of having to fill in the missing bits. –  Jake Aug 20 '12 at 11:26

1 Answer 1

up vote 8 down vote accepted

@Jake, thanks for the confirmation. So, the solution to that problem is to use braces to protect the equal sign, also to protect commas.

ylabel={$u_1(t)=\delta(t)$}

Regards.

share|improve this answer
4  
Put the braces around the whole math expression. If you put them only around the "=" it will affect the spacing before and after the "=". –  Ulrike Fischer Aug 20 '12 at 11:40
1  
@UlrikeFischer, thanks. Edited. –  Sigur Aug 20 '12 at 11:43
    
Thank you very much! Especially answers like this which do not only help to solve this specific problem, but help to understand how to think of the problem. –  wal-o-mat Aug 20 '12 at 19:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.