0

Trying to restore the ability to compile a complex project with LuaLateX I'm (now that I made it possible to find/use the documentclass) running into this compilation error:

German Hyphenation Patterns (Reformed Orthography, 2006) `dehyphn-x' 2019-04-04
 (WL)))))) (/usr/share/texlive/texmf-dist/tex/latex/csquotes/csquotes.sty
(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/share/texlive/texmf-dist/tex/latex/csquotes/csquotes.def)
(/usr/share/texlive/texmf-dist/tex/latex/csquotes/csquotes.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.sty
(/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype-luatex.def)
(/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.cfg))
(/usr/share/texlive/texmf-dist/tex/lualatex/selnolig/selnolig.sty
=== Package selnolig, Version 0.302, Date 2015/10/26 ===

(/usr/share/texlive/texmf-dist/tex/lualatex/selnolig/selnolig-german-patterns.s ty) (/usr/share/texlive/texmf-dist/tex/lualatex/selnolig/selnolig-german-hyphex.sty )) (/usr/share/texlive/texmf-dist/tex/latex/newfloat/newfloat.sty) ! Undefined control sequence. <recently read> \newfloatsetup

l.276 within=none}

?

After discussion on this page I produced a MWE by copying the content of my custom class/packages. It seems to me that the error is triggered before I actually run into any custom code.

This is my presumable MWE:

\documentclass[%
    fontsize=12,%
    DIV=calc,%
    BCOR=10mm,%
    bibliography=totoc,%
    % TODO: Change this for publication
    oneside,%
    ]{scrbook}

% Seitenlayout \RequirePackage[% includehead,% includefoot,% footskip=0.8cm,% left=2.5cm,% right=5.5cm,% top=1cm,% bottom=1.2cm]{geometry}

% TODO: Das muss noch bearbeitet werden. Ganzseitige Notenbeispiele % funktionieren noch nicht richtig mit lyluatex. % % Additional formatting for headers and footers % (relevant for full-page music examples) %\RequirePackage{scrlayer-scrpage} %\pagestyle{scrheadings} %\cfoot{--,\pagemark,--}

% Seitenlayout \RequirePackage[% includehead,% includefoot,% footskip=0.8cm,% left=2.5cm,% right=5.5cm,% top=1cm,% bottom=1.2cm]{geometry}

% Durchgehende Nummerierung von Fußnoten % (gehört eigentlich nicht zu TOC, passt aber nirgends besser hin) \RequirePackage{chngcntr} \counterwithout*{footnote}{chapter}

% Teil-Inhaltsverzeichnisse pro Buchteil % TODO: Das soll so nicht gemacht werden, minitoc ist nicht % mit KOMA-Script kompatibel. Ich habe aber noch keine % andere Lösung für \part-TOCs gefunden. %\usepackage{minitoc} %\setcounter{minitocdepth}{4}

% \subfiletoc % Titel und TOC, die nur gesetzt werden, wenn wir uns % in einem Subfile befinden. % TODO: Das war eigentlich nur als Hilfe für während der Arbeit gedacht % und wäre mit \part-TOCs obsolet. % Ich glaube, damit könnte man das ganze \issubfile-Zeug entfernen. % Momentan ist \subfiletoc »leer«.

% Check if we're in a subfile and set a flag \makeatletter \newcommand{\issubfile}{ @ifclassloaded{subfiles} {\def\subfiletest{true}} {} } \makeatother % Run it once \issubfile

% Helper function that checks if a flag is set \makeatletter \newcommand*{\ifmacrodefined}[1]{% \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname #1\endcsname\relax \expandafter@secondoftwo \else \expandafter@firstoftwo \fi } \makeatother

% If we are in a subfile % then redefine the respective commands %\ifmacrodefined{subfiletest}{ % \newcommand{\subfiletoc}{% % \maketitle % \setcounter{tocdepth}{3} % \tableofcontents % } %}{ % \newcommand{\subfiletoc}{} %}

\setcounter{tocdepth}{3}

%\newcommand{\subfiletoc}{% %\let\maintocdepth\value{tocdepth}% %\setcounter{tocdepth}{5}% %\tableofcontents

%\setcounter{tocdepth}\maintocdepth %\clearpage %}

\newcommand{\subfiletoc}

% Grundlegende Einbindung der Lua-Funktionalität % TODO: Hier ist mir noch nicht klar, wie das mit dem % Fehlerhandling geht. lyluatex stellt Fehler besser dar. \RequirePackage{luatexbase}

% Separates Kompilieren einzelner Kapitel \RequirePackage{subfiles}

% Grafikdateien \RequirePackage{graphicx}

% Farben \RequirePackage{color}

% Bevorzuge bei Namenskonflikten PDF-Dateien vor PNG \usepackage{grfext} \PrependGraphicsExtensions*{.pdf}

% Einfügen von PDF-Seiten und -Dokumenten % TODO: Kann das nicht gelöscht werden, wenn auch % 'musicexamples' das Paket lädt? \RequirePackage{pdfpages}

% Verwendet zum Einfügen von ganzseitigen Beispielen auf der % nächsten Seite, ohne den Textfluss zu unterbrechen. % TODO: % a) das sollte von 'musicexamples' selbst eingebunden werden % (=> kann hier entfernt werden) % b) das funktioniert noch nicht im Zusammenhang mit lyluatex \RequirePackage{afterpage}

% Listenformatierung \RequirePackage{mdwlist} \RequirePackage{paralist}

% Tabellenformatierung \RequirePackage{booktabs} % insbesondere lange Tabellen über Seitenumbruch hinaus \RequirePackage{longtable}

% Fußnoten % Formatierung \usepackage{ragged2e} \RequirePackage[ragged, hang]{footmisc} \setlength{\footnotemargin}{3ex} % Aufeinanderfolgende Fußnoten sollen durch ein Komma getrennt werden % https://tex.stackexchange.com/questions/40072/incompatibility-between-footmisc-option-multiple-and-hyperref \let\oldFootnote\footnote \newcommand\nextToken\relax \renewcommand\footnote[1]{% \oldFootnote{#1}\futurelet\nextToken\isFootnote} \newcommand\isFootnote{% \ifx\footnote\nextToken\textsuperscript{,}\fi}

% Floatumgebungen mit umlaufendem Text \RequirePackage{wrapfig}

% Mehrspaltiger Text % TODO: Wird derzeit nur einmal für den Satz zweier Gedichte verwendet, % dafür gibt es m.E. aber ein spezialisiertes Package \RequirePackage{multicol}

% Mache Bildunterschriften konfigurierbar \RequirePackage{caption}

% Lade die Lua-Funktionalität mit einem einzelnen Befehl % (damit sie in den verschiedenen Packages genutzt werden kann) \newcommand{\loadLuaFunctions}{% \directlua{ lua = require(kpse.find_file("ulDissLua.lua") or "ulDissLua.lua")}}

% Dieses Package wird nur von dem Pandoc-generierten Code benutzt % und kann nach Durcharbeiten des B-Teils gelöscht werden. \RequirePackage{supertabular}

% Environment: material % % Vorläufig ausformulierter Text, der evtl. verwendet werden könnte. % Oder Text, der herausgenommen wird, ohne ihn gleich zu löschen. % \newenvironment{material}{% \begingroup \color{blue} \medskip \noindent \textsf{Material}

\smallskip \hrule \begin{quote}} {\end{quote} \hrule \medskip \endgroup}

% Environment: stichworte % % Besondere Aufzählungsumgebung für die Gliederung und Planung der Arbeit. % Standardtitel ist »Stichworte/Gliederung:«, % kann durch optionales Argument geändert werden. % \newenvironment{stichworte}[1][Stichworte/Gliederung:]{% {\color{red}{

\textbfsf{#1}

\medskip \hrule}} \begin{itemize} }{% \end{itemize} {\color{red}{\hrule}}

\bigskip }

% auffälliges »TODO« Element. % Titel kann im optionalen Argument geändert werden. \newcommand{\todo}[2][TODO: ]{{\color{red}{\textbf{\textsf{[#1#2]}}}}}

% Allgemeine Typografie-Einstellungen \RequirePackage{fontspec} \frenchspacing

\defaultfontfeatures{ Ligatures=TeX, Scale=MatchLowercase, Numbers=Proportional, Numbers=OldStyle }

% Schriftarten \RequirePackage[osf,proportional]{libertine} \setmonofont[Scale=MatchLowercase]{InconsolataN}

% Sprache \RequirePackage[ngerman]{babel}

% Wird nur von biblatex verwendet \RequirePackage{csquotes}

% Allgemeine typografische Verbesserungen \RequirePackage{microtype} \RequirePackage[ngerman]{selnolig}

% abbildung % % Modifiertes, zentriertes 'figure'-Environment % TODO: ändern in 'manuskript', eigener Zähler, eigenes Verzeichnis \newenvironment{abbildung}[1][htp]{ \begin{figure}[#1] \centering} {\end{figure}}

% Darstellung der Environments \captionsetup[figure]{ format=plain, font=small, labelfont=sf, within=none}

\captionsetup[abbildung]{ format=plain, font=small, labelfont=sf, within=none}

Any idea/hint what could be causing this?

Thank you for any hint/idea.

uli_1973
  • 1,920
  • You should be able to provide a small complete example that makes that error (the command should be defined by newfloat.sty as far as I can see) – David Carlisle Feb 02 '22 at 12:27
  • From the (part of the) error message you report, the undefined command is not \newfloatsetup. – egreg Feb 02 '22 at 15:16
  • AFAIR undefined macros are the noes reported at line end. So from the error shown in the question where should I look for the undefined control sequence? – uli_1973 Feb 02 '22 at 17:36
  • the undefined command as I show in my answer is \newfloatsetup which you use on line 34 of ulDissEnvironments.sty – David Carlisle Feb 10 '22 at 09:47
  • I don't use \newfloatsetup at all, lines 30-34 are \captionsetup[abbildung]{ format=plain, font=small, labelfont=sf, within=none} – uli_1973 Feb 10 '22 at 10:13

2 Answers2

1

This here errors in texlive 2019 but compiles fine in texlive 2021:

\documentclass[]{article}
\usepackage{caption}

\captionsetup[table]{ format=plain, font=small, labelfont=sf, within=none}

\captionsetup[figure]{ format=plain, font=small, labelfont=sf, within=none}

\begin{document} abc \end{document}

(c:/texlive/2019/texmf-dist/tex/latex/newfloat/newfloat.sty
Package: newfloat 2019/09/02 v1.1l Defining new floating environments (AR)
)
! Undefined control sequence.
<recently read> \newfloatsetup 

l.69    within=none}

The problem is that the newfloat package is loaded in a group. As a work-around load it before setting up your floats:

\documentclass[]{article}
\usepackage{caption}
\usepackage{newfloat}
\captionsetup[table]{
    format=plain,
    font=small,
    labelfont=sf,
    within=none}

\captionsetup[figure]{ format=plain, font=small, labelfont=sf, within=none}

\begin{document} abc \end{document}

Ulrike Fischer
  • 327,261
0

The fragment of log you show shows newfloat package being loaded (but not keyval) then \newfloatsetup being undefined after having been scanned previously.

This means you have something essentially equivalent to

\documentclass{article}
\usepackage{graphicx}

{ \usepackage{newfloat}

} \expandafter\newfloatsetup\expanded{ within=none}

\begin{document}

\end{document}

which produces a terminal output of

LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-01-21>
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/usr/local/texlive/2021/texmf-dist/tex/latex/newfloat/newfloat.sty)
! Undefined control sequence.
<recently read> \newfloatsetup

l.10 within=none}

?

The last lines of which exactly match the form that you show.

David Carlisle
  • 757,742
  • If I'm not really mistaken the end of the logfiles indicates that the error happens while loading the newfloat package, not wile processing local code. – uli_1973 Feb 10 '22 at 09:41
  • @uli_1973 no the log fragments shown both in my answer and the question show that newfloat.sty was read without error the error occurs later. – David Carlisle Feb 10 '22 at 09:43
  • @uli_1973 in my case the log shows it is line 10 of the main file and in yours it is line 34 of the file /home/uliska/git/uliska/diss-clone/latexstuff/ulDissEnvironments.sty that you have not shown. – David Carlisle Feb 10 '22 at 09:45
  • Line 34 is within a \captionsetup{}, so I still don't understand which is the undefined control sequence. Errors within the argument, yes, but an undefined control sequence? And wouldn't that be reported differently? – uli_1973 Feb 10 '22 at 09:52
  • @uli_1973 since you have chosen to show no example or a complete error log it is quite hard to reverse enginineer what is wrong with your code. I managed to construct this case which gives the same error. I would expect that your case is very similar but if you do not show any input it is impossible to help more. Given that error occurs so early it must be possible to add a small but complete test case to your question. – David Carlisle Feb 10 '22 at 10:03
  • @uli_1973 the undefined command is \newfloatsetup – David Carlisle Feb 10 '22 at 10:04