Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to have a column with vertical bar separators. When I set the number format to 'dec sep align' the vertical separators disappear. Here is a MWE:

\documentclass{article}
\usepackage{array}
\usepackage{pgfplots}
\pgfplotsset{compat=1.5.1}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstabletypeset
    [columns/A/.style={column type={|r|}},
     columns/B/.style={dec sep align, column type/.style={|}{|}},
     columns/C/.style={dec sep align, column type/.style={|}{|}},
     outfile=TestTable.tex
    ]{
      A    B     C
     1  1.23  1.23
     20 3.4   5.654
    }
\end{document}

In the generated code, indeed I don't see my vertical bars:

\begin {tabular}{|r|r<{\pgfplotstableresetcolortbloverhangright }@{}l<{\pgfplotstableresetcolortbloverhangleft }r<{\pgfplotstableresetcolortbloverhangright }@{}l<{\pgfplotstableresetcolortbloverhangleft }}%
A&\multicolumn {2}{c}{B}&\multicolumn {2}{c}{C}\\%
\pgfutilensuremath {1}&$1$&$.23$&$1$&$.23$\\%
\pgfutilensuremath {20}&$3$&$.4$&$5$&$.65$\\%
\end {tabular}%

What am I doing wrong?

Thanks Juhui

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You have to use column type/.add={}{|}, not /.style. Also, for the vertical lines to work with the header row of the aligned columns, you'll have to use dec sep align={c|}.

\documentclass{article}
\usepackage{array}
\usepackage{pgfplots}
\pgfplotsset{compat=1.5.1}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstabletypeset
    [columns/A/.style={column type={|r|}},
     columns/B/.style={dec sep align={c|}, column type/.add={}{|}},
     columns/C/.style={dec sep align={c|}, column type/.add={}{|}},
    % outfile=TestTable.tex
    ]{
      A    B     C
     1  1.23  1.23
     20 3.4   5.654
    }
\end{document}
share|improve this answer
    
I works, great. Thanks a lot for your fast answer! –  Juhui Aug 27 '12 at 15:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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