Hot answers tagged

12

You are looking for \si[prefixes-as-symbols = false]{#1} which will convert the prefix symbol to the value (a single stand-alone prefix is allowed here: I plan in figure to introduce some kind of 'no-op' unit to make the logic a bit easier). The data for this conversion is stored in the internal property list \l__siunitx_prefix_forward_prop, which may of ...


9

The moment you use anything that's not strictly a unit macro, siunitx uses 'literal' mode so just typesets your input. You seem to want \documentclass{article} \usepackage{siunitx} \begin{document} \si{\per\angstrom\per\electronvolt\tothe{1/2}} \end{document}


6

This works for roughly the reasons explained in the comments: \documentclass{beamer} \usefonttheme{professionalfonts} \usefonttheme{serif} \usepackage{fontspec} \setmainfont{Latin Modern Sans}%TeX Gyre Schola} % \setsansfont{Latin Modern Sans} \usepackage{unicode-math} \setmathfont{TeX Gyre Pagella Math} \usepackage{siunitx} \sisetup{% detect-all,% } ...


6

As the units here are optionally loaded, and as there is a need to allow compatibility with v1, the actual loading is done at the start of the document. Thus you need \documentclass{article} \usepackage{siunitx} \usepackage{xcolor} \sisetup{binary-units=true}% \AtBeginDocument{ \DeclareSIUnit\bit{\textcolor{red}{bit}}% ...


6

siunitx prints the units inside \ensuremath (like the other components). This allows one to typeset the output inside math or text mode where math mode would be automatically enabled if necessary. However, forcing math mode inside \ensuremath causes a problem, as is replicated by this simple minimal example: \documentclass{article} \begin{document} $x \cdot ...


4

From siunutx manual markers are often given in tables after the numerical content. It may be table-align-text-post desirable for these to close up to the numbers. Whether this takes place is controlled by the table-align-text-pre and ...-post option You can remove space before the closing parenthesis with table-align-text-post = false. Your ...


3

When you don't let siunitx 'know' otherwise, the strategy used for centring on a decimal marker is to put it at the centre of the column. That means that in your example you've got a lot of white space about in the output. The better approach is to tell siunitx exactly how much space you need, which ideally will include any 'post text' part. That might lead ...


3

You can make use of table-space-text-pre and table-space-text-post to make space for the square brackets. To insert the brackets before and after the columns, use the >{...} and <{...} syntax. To avoid wrong spacing before the last square bracket at each line, you have to use the TeX primitive \cr instead og \\ to terminate the rows, as explained in ...


3

Your MWE has bunch of errors, the most of them I success to eliminate, so the MWE is now at list possible to compile ... Edit (1): Meanwhile I digging through pgfplotstable manual and SE in searching of not resolved issues im my answer. This was quite fruitful, I was able to found my mistakes, which I introduce when I try to eliminate your correct errors ...


3

\documentclass[a4paper,11pt]{book} \usepackage{unicode-math} \usepackage{libertine} \addfontfeatures{Numbers={Lining,Monospaced}} %\setmonofont{Consolas}% not available for me \setmathfont[math-style=ISO,bold-style=ISO]{Cambria Math} \setmathfont[range=0048-0057]{Linux Libertine O} \usepackage{siunitx} \begin{document} [ ... ]


2

As usual, it's an expansion problem; when the write happens, the error is that \bit is not defined, which it isn't unless we're processing \si or \SI. I'm not sure why the declaration seems to need being required also in the preamble, but you get a better setup if you avoid expanding the index entry. \documentclass{article} \usepackage{imakeidx} ...


2

I try to minimise how much I type so I'd put the brackets, [ and ], into the table definition: \documentclass{article} \usepackage{siunitx} \begin{document} \begin{table}[h] \begin{tabular}{cS[table-format = 1.1] @{\quad[\,}S[table-format = -1.2]@{,\,}S[table-format = -1.2]@{\,]} } A & ...


2

Like this: \documentclass[]{article} \usepackage{booktabs} \usepackage{siunitx} \begin{document} \sisetup{input-symbols = ()} \begin{table}[h] \begin{tabular}{ c S[table-format = 2.1]@{} S[table-format = 2.1] S[table-format = 2.1]@{} S[table-format = 2.1] S[table-format = 3.1]@{} S[table-format = 2.1] S[table-format = ...


2

There is a simpler approach: \documentclass{memoir} \usepackage{siunitx} \newcommand{\tpm}{\ensuremath{\,\pm}} \begin{document} \begin{table}[tbp] \centering \sisetup{ output-decimal-marker = {,}, } \begin{tabular}{ S[table-format=1.1,table-space-text-post=\tpm] S[table-format=2.1,table-space-text-post=\tpm] ...


1

Here's a possibility using collcell; the assumption is that the header is of the form <letter><digits>, with a single letter. \documentclass{memoir} \usepackage{pgfplotstable} \usepackage{siunitx} \usepackage{longtable} \usepackage{multirow} \usepackage{collcell} \pgfplotsset{compat=1.13} \pgfplotstableset{% every head row/.style={before ...


1

This works: \documentclass{article} \usepackage{siunitx} \begin{document} \SI{2 x 2}{\meter} % in some cases, you can use the full expression as an "input symbol"; % however, this looks wrong: \SI[input-symbols=2^n]{2^n x 2^n}{\meter} % so to fix this, one may try: \newcommand{\twon}{2^\mathit{n}} ...


1

The formats parsed by siunitx are 1.23(4) and 1.23 \pm 0.04, and no others. Thus to achieve the desired effect some parsing has to be done separately. One approach is to grab the cell contents, alter the formatting and use the \tablenum command to do the alignment \documentclass[]{article} \usepackage{siunitx} \def\converter\ignorespaces#1(#2){% ...



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