TeX - LaTeX Asked on December 5, 2021
I want to get something like this
I wrote this code
begin{document}
begin{center}
[[0 0 1 ... 0 -1 1]\
[0 0 -1 ... 0 1 1]\
[0 -1 0 ... 0 1 0]\
...\
[0 1 0 ... 1 1 0]\
[1 0 0 ... -1 0 1]\
[-1 1 1 ... 1 0 0]]
end{center}
end{document}
but Im getting this
You can use BVerbatim
from fancyvrb
.
documentclass{article}
usepackage{fancyvrb}
usepackage{lipsum} % just to provide context
begin{document}
lipsum[1][1-6]
[
begin{BVerbatim}
[[0 0 1 ... 0 -1 1]
[0 0 -1 ... 0 1 1]
[0 -1 0 ... 0 1 0]
...
[0 1 0 ... 1 1 0]
[1 0 0 ... -1 0 1]
[-1 1 1 ... 1 0 0]]
end{BVerbatim}
]
lipsum[1][1-6]
end{document}
Don't indent the contents of BVerbatim
. You can use center
instead of [...]
(which, on the other hand, ensures no page breaks).
Answered by egreg on December 5, 2021
To display code, use the verbatim
environment.
documentclass{article}
begin{document}
begin{center}
begin{minipage}{.6textwidth}
begin{verbatim}
[[ 0 0 1 ... 0 -1 1]
[ 0 0 -1 ... 0 1 1]
[ 0 -1 0 ... 0 1 0]
...
[ 0 1 0 ... 1 1 0]
[ 1 0 0 ... -1 0 1]
[-1 1 1 ... 1 0 0]]
end{verbatim}
end{minipage}
end{center}
end{document}
Answered by Henri Menke on December 5, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP