Tag Info

6

You can define an interface to \vary{\SI{12345}{m}}{\SI{23456}{m}} \documentclass[a4paper]{article} \usepackage[per=frac,decimalsymbol=comma,expproduct=cdot]{siunitx} \usepackage[load-headings,load-tasks,]{exsheets} \ExplSyntaxOn \NewDocumentCommand{\varySI}{mm} {% #1 are the values, #2 is the unit \uzsolt_vary_si:nn { #1 } { #2 } } \tl_new:N ...

5

You should use the package siunitx here. But in order to get the tables right, you have to use the S-column. I am showing some example below. If you really need left alignment, let me know. It is not very clear from your post, what the input is, and what output is desired. Speaking of comma and dot. But what ever situation you have, siuntix is able to ...

4

The definition of \electronmass is \DeclareSIUnit{\electronmass}{\text{\ensuremath{m_{\text{e}}}}} Just change it. \documentclass{article} \usepackage{siunitx} \DeclareSIUnit{\electronmass}{\text{\ensuremath{m_{0}}}} \begin{document} \SI{2}{\electronmass} \end{document} However, you must realize you're changing a standard symbol. And this shouldn't ...

4

With older versions of siunitx the standard settings attempted to create abbreviation units macros in such a way that existing definitions caused problems. With opex3 the provided defintion of \as is a shortcut for Appl.\ Spectrosc.\ which is where the issue comes. (Yes, there is a space at the end of that shortcut: not a great plan!) The reason the error ...

3

I suggest you make a few changes to your code. Most importantly, don't encase each and every numeric cell in a \multicolumn{1}{c}{...} wrapper. Not only is it not necessary to do this, it's counterproductive: the wrappers override the intended formatting effects of the basic column type you chose, and in consequence you get none of the intended formatting. ...

3

The keys are expanded various number of times depending on the context they are evaluated. Here, it needs ##1 instead of #1 on the line assign column name/.code=\pgfkeyssetvalue{/pgfplots/table/column name}{{{##1}}}, inside the mytable style. Then the result is identical.

3

For the case of aligning numbers when not using a normal column situation, siunitx provides the \tablenum command. \documentclass{article} \usepackage{siunitx,collcell} \begin{document} \sisetup{table-format = 4.0} \begin{tabular}{>{\collectcell\tablenum}c<{\endcollectcell}} \multicolumn{1}{c}{Header} \\ 1234 \\ 234 \\ 34 \\ 4 \end{tabular} ...

2

use it this way: \documentclass[11pt]{beamer} \usefonttheme{professionalfonts}%% do not define math settings by beamer itself \usepackage[T1]{fontenc} \usepackage[libertine]{newtxmath} \usepackage{libertine} \usepackage{sfmath} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{siunitx} \begin{document} \begin{frame} test $f(x)$ ...

2

This is a minor update! In the most recently updated version (10/28/2014) of siunitx, this code works, and produces the correct symbol and spacing. \usepackage[inter-unit-product=\cdot]{siunitx} The code from the answer here: \usepackage[inter-unit-product=\ensuremath{{}\cdot{}}]{siunitx} no longer seems to work, and will throw an error about a ...

1

OTOH, If you aren't married to \num, you could use something like \documentclass{article} \begin{document} \begin{tabular}{@{}r@{}} 1234\\ 234\\ 34\\ 4 \end{tabular} \end{document} or \documentclass{article} \newcommand{\mynum}[1]{\phantom{0000}\llap{#1}} \begin{document} \mynum{1234}\par \mynum{234}\par \mynum{34}\par \mynum{4} \end{document}

1

Not an answer, but just playing around. If you don't need zeroes inside the number, then it's an answer; because it “replaces” every zero, doesn't matter if it's on the left or on the middle. \documentclass{article} \usepackage{siunitx,calc} \sisetup{minimum-integer-digits=4} \begin{document} \begingroup\mathcode`\0="8000 ...

1

As you have a variable font for the 'unit' part of quantities, and that is a text mode font, I think you are best off using text mode with siunitx \sisetup{unit-mode = text} This will then use whatever the current text font is for units, so the math font will have no impact. (Untested as I don't have the appropriate fonts.)

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