4

I wish to improve my (very basic) knowledge about tcolorbox .. so I try to compile example in pp. 345 (chapter 18: Library "hooks"). Compiling it I receive warning:

\RequiredPackage{minted}{2011/09/17]

which I have installed by MikTeX package manager, then after forcing compilation ask for

\minted@appathifexist=

etc

I use recent 64-bit MikTeX with administrative privilege and WinEdt as editor. The example code is the following:

\documentclass{article}
\usepackage[all]{tcolorbox}
    \usepackage{array,tabularx}%,longtable,tabu

    \begin{document}
    \newcolumntype{Y}{>{\raggedleft\arraybackslash}X}% see tabularx
\tcbset{enhanced,fonttitle=\bfseries\large,
        fontupper=\normalsize\sffamily,
        colback=yellow!10!white,colframe=red!50!black,
        colbacktitle=orange!30!white,%=Salmon!30!white
        coltitle=black,center title,
    tabularx={X||Y|Y|Y|Y||Y},% this sets ’before upper’ and ’after upper’
        before upper app={Group & One & Two & Three & Four & Sum\\
                          \hline\hline} }
\begin{tcolorbox}[title=My table]
Red & 1000.00 & 2000.00 & 3000.00 & 4000.00 & 10000.00\\\hline
Green & 2000.00 & 3000.00 & 4000.00 & 5000.00 & 14000.00\\\hline
Blue & 3000.00 & 4000.00 & 5000.00 & 6000.00 & 18000.00\\\hline\hline
Sum & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00
\end{tcolorbox}
    \end{document}

On the end I above code generate the following picture:

enter image description here

I expect that this would work "out of box" similarly as some other examples from manual, so do not know what I'm doing wrong or what I miss.

Zarko
  • 296,517
  • 2
    If I load also colortbl (for \arrayrulecolor) and run pdflatex -shell-escape test, I get the expected result. See this picture – egreg Aug 01 '15 at 19:54
  • 1
    @egreg since tcolorbox internally loads xcolor, this \documentclass[table]{article} is alos enough. You should turn your comment into an answer. – Gonzalo Medina Aug 01 '15 at 19:57
  • 1
    You may want to see this: http://tex.stackexchange.com/q/108661/11232 –  Aug 01 '15 at 23:37
  • @HarishKumar, thank you for link. It is very usable. – Zarko Aug 01 '15 at 23:43
  • @HarishKumar, I manage this. Now I need only to install Python (if I understand correctly). On https://www.python.org/downloads/windows/ iI discover, that exist two versions: 2.7.10 and 3.4.3. What is difference between them and which one you suggest to install? – Zarko Aug 01 '15 at 23:50
  • @Zarko: you can install any. 3.4.3 has more features. But for this job, even 2.7.10 is enough. –  Aug 01 '15 at 23:54
  • @HarishKumar, instaling Pythen was very challenge task. At this work your comments was of big help and very valuable. Thank you very much! – Zarko Aug 05 '15 at 11:39

1 Answers1

4

I get the same output as you if I don't load colortbl: the error is!

Undefined control sequence.
\tcb@after@box ->\endtabularx \arrayrulecolor 
                                              {black}
l.20 \end{tcolorbox}

and \arrayrulecolor is a command of colortbl.

If I add colortbl to the list of packages (or, as Gonzalo Medina suggests, add table to the options for \documentclass), the output is

enter image description here

without any error.

egreg
  • 1,121,712
  • at me this doesn't help. I still receive error: You must invoke LaTex with the -shell-escape flag and open file tcbminted.code.tex probably as source of error, but this time on the end I receive correct picture. And TeXAuX directory, where should be log file, is empty. Now I'm completely confused. – Zarko Aug 01 '15 at 20:24
  • @Zarko Of course you have to add the -shell-escape option as I said in my comment: this is always needed for minted. – egreg Aug 01 '15 at 20:25
  • where? do I need to compile from DOS window? I try this, but receive error: you must have pygmentize instaled to use this package. Do I re-install tcolorbox? – Zarko Aug 01 '15 at 20:39
  • @Zarko That depends on the front-end you're using. Pygmentize should of course be available on your machine: it's a Python library. – egreg Aug 01 '15 at 20:40
  • as far as know, I haven't installed python nor python library, except if this is automatically installed with some program. – Zarko Aug 01 '15 at 20:49
  • @Zarko Well, if you don't have Python you can't have Pygmentize and can't use minted. – egreg Aug 01 '15 at 20:56
  • that one need to have python for use of hang library, is nowhere mentioned in the manual. I'm now little disappointed. Anyway, I need to wait to my system administrator to help me fix this problem ( I haven't this privilege). Hopefully he will return from vacation in Monday :-( – Zarko Aug 01 '15 at 21:14
  • @Zarko That's required for minted; tcolorbox just adds an interface to it. By itself, tcolorbox needs nothing else than a TeX distribution. – egreg Aug 01 '15 at 21:18
  • @eqreg, SE now complain that this become discussion ... can we move to chat? – Zarko Aug 01 '15 at 21:25
  • @Zarko: Go to OptionsExecution Modes and the in the window that opens, choose pdflatex (or any engine that you use). Add --shell-escape in Switches. See this picture: http://i.stack.imgur.com/bY3rH.png –  Aug 01 '15 at 23:41
  • @egreg, I like to test an answer before accept it. Due to issues with Python, I was not able to do this till to now. Installing of Python was challenging task ... with help of my (our) system administrator, I manage this today! Thank you for your help and patience. – Zarko Aug 05 '15 at 11:36