SIunitx が LyX モジュールで失敗する (fancytheorems)

SIunitx が LyX モジュールで失敗する (fancytheorems)

私はLyXでtexliveを使っています。派手な定理モジュールを使用して、カスタマイズされた定理レイアウトを取得します。ただし、モジュールとともに SIunitx パッケージを使用すると、LyX は SIunitx コマンドで「未定義の制御シーケンス」エラーをスローします。pdflatex では、ドキュメントはレンダリングされますが、数回しか表示されません。「article」ドキュメントでは、ams 定理モジュールで問題なく動作しますが、fancy theorem に置き換えるとエラーが発生します。解決策は何でしょうか? ご協力をよろしくお願いします。

質問に応じて、MWE を lyx 形式と tex 形式の両方で追加します。

リックス

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\begin_preamble
\usepackage{physics}
\usepackage{siunitx}
\AtBeginDocument{\RenewCommandCopy\qty\SI}
\end_preamble
\use_default_options true
\begin_modules
fancythm
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #b5bd68
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Section
test
\end_layout

\begin_layout Example
This is an example where we'll assume 
\begin_inset Formula $g=\qty{10}{m.s^{-2}}$
\end_inset

.
\end_layout

\begin_layout Standard

\end_layout

\end_body
\end_document

テックス

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{fancythm}
\declarefancythm{thm}{headfont=\bfseries,bodyfont=\itshape}{Theorem}{blue}{bc-fleur.mps}
\setfancythmkeys{thm}{title=\csname fancythm@thm@defaultname\endcsname}
\declarefancythm{example}{headfont=\bfseries,bodyfont=\upshape\mdseries}{Example}{orange}{bc-plume.mps}
\setfancythmkeys{example}{title=\csname fancythm@example@defaultname\endcsname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{physics}
\usepackage{siunitx}
\AtBeginDocument{\RenewCommandCopy\qty\SI}

\makeatother

\usepackage{babel}
\expandafter\providecommand\csname fancythm@example@defaultname\endcsname{Example}
\expandafter\providecommand\csname fancythm@thm@defaultname\endcsname{Theorem}

\begin{document}

\section{test}
\begin{example}
This is an example where we'll assume $g=\qty{10}{m.s^{-2}}$.
\end{example}

\end{document}

答え1

それは のコード内のバグでしたfancythm。誤ってプリミティブを上書きしてしまいました\fam。最小限の例を含む優れた投稿のおかげで、それを簡単に見つけることができました。

質問でリンクしたリポジトリの最新バージョンでは修正されています。

関連情報