1

A similar question has been asked here: - newenvironment using pgfplotstable

At first glance, I thought it was the same question, because the question is not clearly stated. That person is asking for something specific about braces, I think.

Goal: Wrap \pgfplotstable inside a new environment:

Pseudo-Code

\documentclass{article}
\usepackage{booktabs}
\usepackage{pgfplotstable}
\usepackage{environ}

\NewEnviron{mytable}{%
\pgfplotstabletypeset[
     string type,col sep=&,row sep=\\,
     every head row/.style={before row=\toprule,after row=\midrule},
     every last row/.style={after row=\bottomrule},
    ]{
    \BODY
    }
}%

\begin{document}

\begin{mytable}
col1 & col2 & col3\\ 
here & more & stuff\\
for & good & looks\\
\end{mytable}


\end{document}

Working Code without NewEnviron

\documentclass{article}
\usepackage{booktabs}
\usepackage{pgfplotstable}


\begin{document}

\pgfplotstabletypeset[
    every head row/.style={before row=\toprule,after row=\midrule},
    every last row/.style={after row=\bottomrule},
    col sep=&,
    row sep=\\,
    header=has colnames,
    column type=l,
    column type={>{\fontseries{bx}\selectfont\color{orange}}l}, %see sec 2.6 for defining column types
    string type,
    postproc cell content/.append style={ % see sec 3.2
    /pgfplots/table/@cell content/.add={\fontseries{\seriesdefault}\selectfont\color{black}}{}}
    ]{
col1 & col2 & col3\\ 
here & more & stuff\\
for & good & looks\\
}

\end{document}
0

0

You must log in to answer this question.

Browse other questions tagged .