Tell me more ×
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.

how do I change each 0.0 to -- without having to reference each as string type or making the whole table string type? The actual table is quite long and it would take too long to do it manually. For the same reason there would be a marked improvement in readability if the table wasn't cluttered up with lots of zeros.

The final table should look something like

Flow            Bibble         Bobble        Gumph
Extant             1              2             3
Intant             --             4             5
My sainted aunt    --             6             7

using for example the MWE below,

\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstabletypeset[columns/Flow/.style={string type,column type={l}},ignore chars={\^^M},col sep=&,row sep=\\]{
    <<results='asis',echo=FALSE>>=
        someStuff=read.table(textConnection("
                  Flow,   Bibble ,   Bobble ,   Gumph
                Extant,    1,           2,      3
                Intant,    0.0 ,        4,      5
       My sainted aunt,    0.0,         6,      7),header=F,sep=",")
    print(xtable(someStuff),include.rownames=F,include.colnames=F,hline.after=NULL,only.contents=T)
    @
}
\end{document}
share|improve this question
Here is one pretty obvious solution, but I'm not sure its the right one. Would be open to deleting this query if its self-evident. Any comments appreciated... if I put the replacement string replace in math-mode it does the trick. so ...,string replace*={0.0}{$-$}, gives me the result I need. – Tahnoon Pasha Nov 22 '12 at 1:45
1  
The use of string replace sounds like the most simple solution. An alternative would be to write some TeX code which is simular to the clear infinite style (by copy-pasting from the source code). But that is clearly much more involved. – Christian Feuersänger Nov 22 '12 at 19:52

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.