2

I have following chunk of text:

\begin{tcolorbox}[boxrule=0pt,arc=0pt,colback=gray]
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'
\end{tcolorbox}

And screenshot represents latex output of this text.

tcolorbox output.

First 6 lines are formatted ok, but next lines are not ok, how do I align them properly (to the left)? And after box, in text, I have indent that I do NOT want to have. How do I fix it?

  • 1
    And \noindent before the paragraph after the box. – Fran Mar 8 '15 at 8:30
  • 1
    Try increasing the width of the text block. – Mico Mar 8 '15 at 8:34
  • @Mico It is already \textwidth hence increasing with is not a good idea. – user11232 Mar 8 '15 at 9:10
  • @HarishKumar - But the width of the text block can be increased locally, right? :-) The solution given in your answer -- to reduce the font size locally -- is even better, though. – Mico Mar 8 '15 at 9:23
  • @Mico Yes it can be increased by the option oversize =<length> option or enlarge left by and enlarge right by options. – user11232 Mar 8 '15 at 9:27
6

Use flushleft upper as the option to tcolorbox

\documentclass{article}
\usepackage{tcolorbox}
\begin{document}
  \begin{tcolorbox}[flushleft upper,boxrule=0pt,arc=0pt,colback=gray]
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'
\end{tcolorbox}
\end{document}

enter image description here

With some font size and margin (left & right) adjustment like this:

\documentclass{article}
\usepackage{tcolorbox}
\begin{document}
  \noindent
  Some text
  \begin{tcolorbox}[fontupper=\footnotesize,flushleft upper,boxrule=0pt,arc=0pt,left=2pt,right=2pt,colback=gray,after=\ignorespacesafterend\par\noindent]
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'\\
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.security.capability'
\end{tcolorbox}
Some text here
\end{document}

you get this:

enter image description here

To stop indenting after the box, you can use after=\ignorespacesafterend\par\noindent as the option to tcolorbox.

  • I did not get your result, I am sure the path is right, that I confirmed the answer, but your result is perfect, but I did no get it. – KernelPanic Mar 8 '15 at 9:07
  • @MarkoFrelih Is your tcolorbox upto date? Can you update and try again? – user11232 Mar 8 '15 at 9:09
  • It is, I've updated it! – KernelPanic Mar 8 '15 at 9:29
  • @MarkoFrelih Does it work then? – user11232 Mar 8 '15 at 9:35
  • No, I did not get your result, sorry for invalid answer before! – KernelPanic Mar 8 '15 at 9:36

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.