1

I have a little problem with the right curly bracket }. I need to use it inside {} for a meta-expression in a table. I want to use tha data as coefficient: Q_{10}. So, I write in the first term: { $Q_{ } Then the value (10) comes, and the closing expression: { } } But, obviously, close with the first right brace.

I'm trying to configure a table on PGFPlotsTable with a subindex of two digits in this way (without the braces, that works with single digit parameters)

\pgfplotstableset{
    columns/q/.style={int detect,column type=r, column name=\textsc{Q},
            postproc cell content/.append style={
                    /pgfplots/table/@cell content/.add={$Q_}{$}},
    },
...
}

Is there a way to write } into braces without considering this character part of the language? Any suggestion? It seems diabolic for me :S

3
  • 2
    Welcome to TeX.SX!. Does writing \} help? Jul 4, 2018 at 9:04
  • I'm afraid, do not. I also try '}.
    – Edu
    Jul 4, 2018 at 12:02
  • With this, I get something like a brace as subindex. But nice suggestion
    – Edu
    Jul 4, 2018 at 12:04

1 Answer 1

1

You can use \bgroup and \egroup to enclose the cell content in curly braces.

\documentclass{article}
\usepackage{pgfplotstable}
\pgfplotstableset{
    columns/q/.style={int detect,column type=r, column name=\textsc{Q},
            postproc cell content/.append style={
                    /pgfplots/table/@cell content/.add={$Q_\bgroup}{\egroup$}},
    },
}
\usepackage{filecontents}
\begin{filecontents}{table.dat}
x,q
1,11
2,22
3,33
\end{filecontents}

\begin{document}
\pgfplotstableread[col sep=comma]{table.dat}\table
\pgfplotstabletypeset\table
\end{document}

enter image description here

1
  • Thank you so much. It also works perfectly in my document.
    – Edu
    Jul 19, 2018 at 9:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .