1

I am creating a table using pgfplotstable in LaTeX. But the problem is, I want first column of table blank. But we never leave any values, table should be balanced in pgfplotstable.I define "nan" to keep column blank. But did not work. What I should do?

pgfexample.tex

\documentclass{book}
\usepackage{pgfplotstable,booktabs}

\begin{document}
 \begin{table}[h!]
 \pgfplotstabletypeset[
  col sep = comma,
  every head row/.style={before row=\toprule,after row=\midrule},
  every last row/.style={after row=\bottomrule},
  columns/S/.style={column name={$\leq$}}
  columns/A/.style={string type,column name={$\sigma$}},
 ]
{LSDtable.csv}
\end{table}
\end{document}

LSDtable.csv

#LmitStateDesign table's data
S,A,B,C,D
nan,0.00375,360.53,0.0025,344.45
nan,0.0037,360.01,0.00245,343.42

I want first column of table blank. Suggest me something to solve problem.

Manpreet Dhiman
  • 341
  • 1
  • 4
  • 14

1 Answers1

1

You could just leave them blank in your csv-file. To be able to write math inside a tabular, or any non-math-environment, you need to put your math inside \(math\) for inline math, and \[math\] for display math. You were really on the right track here, as you have written $\sigma$ elsewhere. Using $-signs works here too, but it is advisable in LaTeX to use \(math\) and \[math\].

For more information see Are \( and \) preferable to dollar signs for math mode?

Output

enter image description here

Code

\documentclass{book}
\usepackage{pgfplotstable,booktabs}
\usepackage{filecontents}

\begin{filecontents*}{LSDtable.csv}
#LmitStateDesign table's data
S,A,B,C,D
\(\leq\),0.00375,360.53,0.0025,344.45
,0.0037,360.01,0.00245,343.42
\end{filecontents*}
\begin{document}

 \begin{table}[h!]
 \pgfplotstabletypeset[
  col sep = comma,
  every head row/.style={before row=\toprule,after row=\midrule},
  every last row/.style={after row=\bottomrule},
  columns/S/.style={string type,column name={}},
  columns/A/.style={string type,column name={$\sigma$}},
 ]
{LSDtable.csv}
\end{table}
\end{document}
Runar
  • 6,082