Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility between cdmath=false and siunitx in math mode #22

Open
aegeeik opened this issue May 26, 2017 · 2 comments
Open

Incompatibility between cdmath=false and siunitx in math mode #22

aegeeik opened this issue May 26, 2017 · 2 comments
Assignees
Labels

Comments

@aegeeik
Copy link

aegeeik commented May 26, 2017

Using tudscrreprt with the option cdmath=false yields some weird behaviour when using siunitx to fontset numbers, it uses the wrong font. Normally siunitx' option detect-all helps to overcome this problem, but with tudscr this does not work for typesetting inside math mode. (Edit: Skip to the the update in the first comment from here on) Only an additional \sisetup{math-sf=\mathrm} can help. I believe this is a bug in tudscr or a weird set font option making it break siunitx.

Here is my MWE:

\documentclass[cdmath=false]{tudscrreprt}
\usepackage[		
		detect-all=true,	%für richtigen Font im Fließtext und Voraussetzung für den richtigen Font im Mathemodus
		]
		{siunitx}
\sisetup{math-sf=\mathrm}	%für richtigen Font im Mathemodus; bei Übergeben dieser Option direkt beim Laden des Pakets hängt sich mein pdflatex auf

\begin{document}
	12340 Text

	\num{12340} Text-Num

	\(\alpha = 12340\) Math

	\(\alpha = \num{12340}\) Math-Num

\end{document}
@aegeeik
Copy link
Author

aegeeik commented May 27, 2017

Update:
The problem seems to be a difference in the way tudscr sets the fonts when defined inside the preamble or after begin{document}. Loading the cd fonts inside the preamble creates the problem, loading them later doesn't create it.

See the updated MWE:

\documentclass[cdfont=false]{tudscrreprt}
  %\TUDoptions{cdfont=true, cdmath=false}	%problematic
  \usepackage[detect-all=true]{siunitx}
  %\TUDoptions{cdfont=true, cdmath=false}	%also problematic
\begin{document}
  \TUDoptions{cdfont=true, cdmath=false}	%okay
  12340 + \num{12340} + \(12340 + \num{12340}\) (First couple and last couple should look the same)
\end{document}

@mrpiggi
Copy link
Member

mrpiggi commented Dec 14, 2023

Using siunitx together with 100 entries or more via biblatex gives some undesired formatting

\documentclass{tudscrreprt}
\listfiles

\usepackage[ngerman,KeepShorthandsActive]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{siunitx}

\usepackage[backend=biber,bibstyle=numeric]{biblatex}
\addbibresource{test.bib}


\begin{document}

\nocite{*}
\printbibliography

\end{document}

MWE.zip
Workaround

\ifcsundef{tud@[email protected]}{%
  \AfterPreamble{\addtolength{\labelnumberwidth}{.75ex}}%
}{%
  \csuse{@latex@warning}{Enlarging \string\labelnumberwidth\space unnecessary!}%
}

@mrpiggi mrpiggi reopened this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants