1

I have something like

enter image description here

What's the best way to do it? I tried this method but it doesn't work.

\begin{array}{r}[[0.86455156], \\ [-0.82104237], \\ [4.12186079]]\end{array}

Getting,

enter image description here

  • 1
    Is this code in math mode? – Bernard Sep 30 at 21:06
  • Yes, it's in math mode, I added the result in the answer – outsider Sep 30 at 21:11
  • 1
    The error come from the fact that, in an array,\\ can take an optional argument. Replace it with \\{} – Bernard Sep 30 at 21:32
2

Something like this?

enter image description here

This solution works in both text mode and math mode.

\documentclass{article} % or some other suitable document class
\usepackage{array}
\begin{document}
\begin{tabular}{@{} >{\ttfamily}r @{}}
  [[ 0.86455156], \\ \relax
   [-0.82104237], \\ \relax
   [ 4.12186079]]
\end{tabular}
\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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