# Tag Info

## Hot answers tagged siunitx

11

There's little hope of having a syntax like \SI{10}{\au}, because this would involve deep surgery in siunitx. A syntax such as \au{10} seems to be the best choice. \documentclass{article} \usepackage{siunitx} \ExplSyntaxOn \NewDocumentCommand{\au}{m} { \SI{#1}{{a.u.}} \peek_charcode_remove:NT . { \mode_if_math:F { ...

10

Option group-digits=integer helps to get groups for the integer part only: \documentclass{article} \usepackage{siunitx} \sisetup{ group-separator={,}, group-minimum-digits=4,% or group-four-digits group-digits=integer, } \begin{document} \num{12345} \num{1.2345} \end{document}

7

The siunitx code works by parsing numbers into separate parts then reconstructing them. This allows a lot of flexibility but is pretty inefficient for the common case of simple numerical input. You can get much faster performance by turning off the parser \sisetup{parse-numbers = false} This can be done globally or just inside your tables. When the ...

7

For historical reasons due to the fact that usually the \mathrm font is OT1 encoded, the command \mathsterling does \mathit{\mathchar"7024}} (that is it uses the dollar sign, which in the italic OT1 font is a pound sign). Fix the wrong definition. \documentclass[a4paper,12pt]{article} \usepackage{fontspec} \usepackage{libertine} \usepackage{siunitx} ...

7

If it is feasible for you, you may want to introduce a new command for this. In my solution, you will not be able to write \SI{123}{\au}, but it will handle all possibilities. % arara: pdflatex \documentclass{article} \usepackage{xspace} \usepackage{siunitx} \makeatletter \DeclareRobustCommand{\au}[1]{% \@ifnextchar{.} {\SI{#1}{{a.u}}} ...

4

For simple alignments like this you can use dcolumn, but I also had to adjust the spacing to make your table fit in the page width. \documentclass[12pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[utf8]{inputenc} % kodovani \usepackage[english,czech]{babel} % cestina \usepackage{siunitx,booktabs,dcolumn} ...

4

Try to use smaller font (if necessary) and put columns header in more lines, something like this: For above table I added package makecell and put columns header into theader from makecell: \documentclass[fontsize=11pt,paper=letter,headings=small,bibliography=totoc,DIV=9,headsepline=true]{scrartcl} \usepackage[utf8]{inputenx} ...

3

The solution is the makecell package, which allows for line breaks in cells, and a common formatting of column heads. Added a small vertical padding in rows and replaced the l column with X. Finally I took the liberty to correct some inconsistencies in the formatting of boldface numbers in the second row. ...

3

You don't have to change the font size or abandon the basic tabularx structure. All you have to do, really, is to (a) change the column type for the header cells of the first two numeric columns to (a centered version of) the X column type, and (b) place curly braces around the right-hand most column header, viz. \textbf{Porcentaje}, to tell LaTeX to center ...

2

The following example makes the group-separator of package siunitx dependent on a switch \ifSiunitxDecimal, which indicates, whether the decimal part is reached. The switch is set to false. When the output-decimal-marker is used, the switch is set to true. The hack part comes, when the switch is reset again to false after the number is printed. This is done ...

2

The following fixes mosts of the errors. You have a number of misspelled keys including a replace string* instead of string replace* and a verb string type instead of string type. There remains some mismatch in the number of columns that I can't track down yet, but I am posting this in the hope that you will be able to get further. ...

1

I can propose a \Pounds macro, with a (numerical) optional argument: if there's no argument, it is the same a \pounds; if there's a number it adds a fgformatted number, preceded by an unbreakable thin space: \documentclass[a4paper,12pt]{article} \usepackage{fontspec} \usepackage{libertine} \usepackage{siunitx} \usepackage{xparse} ...

Only top voted, non community-wiki answers of a minimum length are eligible