3

I have a code that looks like this :

\[\Omega_\Lambda{}_0 = 0,6911 \tag {2}\]

in the pdf the (2) has round parentheses. I would like square brackets [] to figure instead : [2]

Can you give me the correct code. Thanks

Mico
  • 506,678
  • 1
    Please provide working documents, not only fragments! –  Dec 08 '15 at 14:53
  • Please advise if the use of square brackets instead of round parentheses to surround equation numbers is supposed to apply to a single otherwise-unnumbered equation or to many such equations. – Mico Dec 08 '15 at 16:55
  • @Werner - Please consider reopening this question: The posting's objective appears to be to alter the look of a single equation tag, rather than to obtain a method by which the format of all equation numbers should be modified. To achieve this objective, the \tag* method is the way to go -- and this method hasn't been mentioned (yet) in the earlier posting. – Mico Dec 08 '15 at 17:12
  • Sorry, I am a latex ignorant. I'm not a programmer that is why I ask so dumb questions. I am not used to this website and haven't understood yet how everything works. You have been very helpful anyhow !!! – clementina Dec 09 '15 at 09:45

2 Answers2

4

I doubt the usefulness of \[...\] together with \tag but here you are, it's even in the mathtools documentation (from which I stole this ;-))

I also don't understand \Lambda{}_{0} but... -- well ;-)

\documentclass{book}
\usepackage{mathtools}
\newtagform{brackets}{[}{]}
\usetagform{brackets}

\begin{document}

\[\Omega_\Lambda{}_0 = 0,6911 \tag {2}\]


\end{document}

enter image description here

  • Thanks, you were very helpful. I am a latex ignorant so the simpler the answer the better hhhh. 70% of what is said on this website is outlandish to me. You just gave me a great piece of advice. Use the mathtools documentation, which I didn't even check and know of its existance. hhh – clementina Dec 09 '15 at 09:40
3

For a one-off tag assignment using square brackets, you could type \tag*{[2]} for the equation in question.

enter image description here

\documentclass{article} 
\usepackage{amsmath}
\usepackage[textwidth=5cm]{geometry} % just for this example
\begin{document}
\[
a+b=c \tag*{[2]}
\]
\end{document}
Mico
  • 506,678
  • Thanks you very much for your answers. I am a latex ignorant so the simpler the answer the better hhhh. 70% of what is said on this website is outlandish to me. Anyhow, your help was very useful !!! – clementina Dec 09 '15 at 09:42