0

I have been searching the web for the past hours and cannot find an answer to this question.

I have stumbled upon: 1. \newcolumntype{T}[3]{>{\textfont0=\the\font\DC@{#1}{#2}{#3}}c<{\DC@end}}

which allows me to use dcolumn with the same font type as the rest of the text and

  1. \newcolumntype{B}[3]{>{\boldmath\DC@{#1}{#2}{#3}}c<{\DC@end}}

which puts the text of a certain cell in bold.

What I am looking for is to combine both 1 and 2, resulting in some sort of macro that allows me to use boldface of text font in some cells.

Thank you and best regards !

  • 2
    Welcome to TeX.SE. What you are trying to achieve can be done with the machinery of the dcolumn package. That said, it would be considerably easier to achieve by loading the siunitx package and its S column type. Please post some example code that you'd like to format in a certain way. – Mico Jul 23 '17 at 16:20
  • thank you Mico. But could you please help me achieving this using dcolumn? Consider a column "x.yz", whose contents are already aligned by decimal point using \newcolumntype{T} descbribed above. Now i want to set a number in that column to bold, maintaining the textfont. – Peter Jul 23 '17 at 16:20
2
\newcolumntype{Z}[3]{>{\bfseries\textfont0=\the\font\DC@{#1}{#2}{#3}}c<{\DC@end}}
  • Thanks for the input David. But I am getting an "undefined control sequence }" error. This is what I am writing: \multicolumn{1}{Z{.}{.}{-1}}{3.21} – Peter Jul 23 '17 at 17:33
  • @Peter which command is shown as undefined? The only command I added was \bfseries which is defined in the latex format. – David Carlisle Jul 23 '17 at 17:35
  • David ! my bad, i was entering the command after "\makeatother". Thanks a lot for the quick reply. you're the man. – Peter Jul 23 '17 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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