4

After a recent update the dot between chapter numbers and figure numbers disappeared. Here is a minimal example.

\documentclass[]{memoir}
\begin{document}
\frontmatter
Some text
\mainmatter
\chapter{Chapter name}
\begin{figure}
  \caption{A figure}\label{A caption}
\end{figure}
Some text~\ref{A caption}
\end{document}

The caption should be "Figure 1.1: A figure", but instead I get "Figure 11: A figure".

The complete log file is

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6670 64-bit) (preloaded format=pdflatex 2018.4.19)  19 APR 2018 19:30
entering extended mode
**./aaa.tex
(aaa.tex
LaTeX2e <2018-04-01> patch level 2
Babel <3.18> and hyphenation patterns for 76 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\memoir\memoir.cls"
Document Class: memoir 2018/04/04 v3.7g configurable book, report, article docu
ment class
\onelineskip=\skip41
\lxvchars=\skip42
\xlvchars=\skip43
\@memcnta=\count80
\c@@memmarkcntra=\count81
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"
Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch
)
("C:\Program Files\MiKTeX 2.9\tex\latex\ifetex\ifetex.sty"
Package: ifetex 2018/03/31 v1.2a ifetex

("C:\Program Files\MiKTeX 2.9\tex\plain\ifetex\ifetex.tex"))
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty"
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
\stockheight=\skip44
\stockwidth=\skip45
\trimtop=\skip46
\trimedge=\skip47

("C:\Program Files\MiKTeX 2.9\tex\latex\memoir\mem10.clo"
File: mem10.clo 2008/01/30 v0.3 memoir class 10pt size option
)
\binding=\skip48
\spinemargin=\skip49
\foremargin=\skip50
\uppermargin=\skip51
\lowermargin=\skip52
\headdrop=\skip53
\normalrulethickness=\skip54
\mem@maxheadheight=\skip55
\mem@maxfootheight=\skip56
\headwidth=\skip57
\c@storedpagenumber=\count82
\memPD=\dimen102
\m@mabparskip=\skip58
\thanksmarkwidth=\skip59
\thanksmarksep=\skip60
\droptitle=\skip61
\c@book=\count83
\c@part=\count84
\c@chapter=\count85
\c@section=\count86
\c@subsection=\count87
\c@subsubsection=\count88
\c@paragraph=\count89
\c@subparagraph=\count90
\beforechapskip=\skip62
\midchapskip=\skip63
\afterchapskip=\skip64
\chapindent=\skip65
\bottomsectionskip=\skip66
\secindent=\skip67
\beforesecskip=\skip68
\aftersecskip=\skip69
\subsecindent=\skip70
\beforesubsecskip=\skip71
\aftersubsecskip=\skip72
\subsubsecindent=\skip73
\beforesubsubsecskip=\skip74
\aftersubsubsecskip=\skip75
\paraindent=\skip76
\beforeparaskip=\skip77
\afterparaskip=\skip78
\subparaindent=\skip79
\beforesubparaskip=\skip80
\aftersubparaskip=\skip81
\pfbreakskip=\skip82
\c@@ppsavesec=\count91
\c@@ppsaveapp=\count92
\ragrparindent=\dimen103
\everylistparindent=\dimen104
\parsepi=\skip83
\topsepi=\skip84
\itemsepi=\skip85
\parsepii=\skip86
\topsepii=\skip87
\topsepiii=\skip88
\itemsepii=\skip89
\itemsepiii=\skip90
\partopsepii=\skip91
\partopsepiii=\skip92
\m@msavetopsep=\skip93
\m@msavepartopsep=\skip94
\@enLab=\toks14
\abstitleskip=\skip95
\absleftindent=\skip96
\abs@leftindent=\dimen105
\absrightindent=\skip97
\absparindent=\skip98
\absparsep=\skip99
\c@vslineno=\count93
\c@poemline=\count94
\c@modulo@vs=\count95
\c@memfvsline=\count96
\vleftskip=\skip100
\vrightskip=\skip101
\stanzaskip=\skip102
\versewidth=\skip103
\vgap=\skip104
\vindent=\skip105
\vleftmargin=\dimen106
\c@verse=\count97
\c@chrsinstr=\count98
\beforepoemtitleskip=\skip106
\afterpoemtitleskip=\skip107
\c@poem=\count99
\beforePoemTitleskip=\skip108
\midPoemTitleskip=\skip109
\afterPoemTitleskip=\skip110
\col@sep=\dimen107
\extrarowheight=\dimen108
\NC@list=\toks15
\extratabsurround=\skip111
\backup@length=\skip112
\TX@col@width=\dimen109
\TX@old@table=\dimen110
\TX@old@col=\dimen111
\TX@target=\dimen112
\TX@delta=\dimen113
\TX@cols=\count100
\TX@ftn=\toks16
\heavyrulewidth=\dimen114
\lightrulewidth=\dimen115
\cmidrulewidth=\dimen116
\belowrulesep=\dimen117
\belowbottomsep=\dimen118
\aboverulesep=\dimen119
\abovetopsep=\dimen120
\cmidrulesep=\dimen121
\cmidrulekern=\dimen122
\defaultaddspace=\dimen123
\@cmidla=\count101
\@cmidlb=\count102
\@aboverulesep=\dimen124
\@belowrulesep=\dimen125
\@thisruleclass=\count103
\@lastruleclass=\count104
\@thisrulewidth=\dimen126
\ctableftskip=\skip113
\ctabrightskip=\skip114
\abovecolumnspenalty=\count105
\@linestogo=\count106
\@cellstogo=\count107
\@cellsincolumn=\count108
\crtok=\toks17
\@mincolumnwidth=\dimen127
\c@newflo@tctr=\count109
\mem@margin@floatbox=\box26
\@contcwidth=\skip115
\@contindw=\skip116
\abovecaptionskip=\skip117
\belowcaptionskip=\skip118
\subfloattopskip=\skip119
\subfloatcapskip=\skip120
\subfloatcaptopadj=\skip121
\subfloatbottomskip=\skip122
\subfloatlabelskip=\skip123
\subfloatcapmargin=\dimen128
\c@@contsubnum=\count110
\m@mscap@capbox=\box27
\m@mscap@fbox=\box28
\sidecapsep=\dimen129
\sidecapwidth=\dimen130
\m@m@tempdima=\dimen131
\m@mscapraise=\dimen132
\sidecapraise=\dimen133
\m@mscapmainwidth=\dimen134
\m@mscaplkern=\dimen135
\beforeepigraphskip=\skip124
\afterepigraphskip=\skip125
\epigraphwidth=\skip126
\epigraphrule=\skip127
LaTeX Info: Redefining \em on input line 7578.
LaTeX Info: Redefining \emph on input line 7586.
\tocentryskip=\skip128
\tocbaseline=\skip129
\cftparskip=\skip130
\cftbeforebookskip=\skip131
\cftbookindent=\dimen136
\cftbooknumwidth=\dimen137
\cftbeforepartskip=\skip132
\cftpartindent=\skip133
\cftpartnumwidth=\skip134
\cftbeforechapterskip=\skip135
\cftchapterindent=\skip136
\cftchapternumwidth=\skip137
\cftbeforesectionskip=\skip138
\cftsectionindent=\skip139
\cftsectionnumwidth=\skip140
\cftbeforesubsectionskip=\skip141
\cftsubsectionindent=\skip142
\cftsubsectionnumwidth=\skip143
\cftbeforesubsubsectionskip=\skip144
\cftsubsubsectionindent=\skip145
\cftsubsubsectionnumwidth=\skip146
\cftbeforeparagraphskip=\skip147
\cftparagraphindent=\skip148
\cftparagraphnumwidth=\skip149
\cftbeforesubparagraphskip=\skip150
\cftsubparagraphindent=\skip151
\cftsubparagraphnumwidth=\skip152
\prechapterprecisshift=\dimen138
\c@maxsecnumdepth=\count111
\bibindent=\dimen139
\bibitemsep=\skip153
\indexcolsep=\skip154
\indexrule=\skip155
\indexmarkstyle=\toks18
\@indexbox=\insert199
\glossarycolsep=\dimen140
\glossaryrule=\dimen141
\sideparvshift=\skip156
\sideins=\insert198
\sidebartopsep=\skip157
\sidebarhsep=\skip158
\sidebarvsep=\skip159
\sidebarwidth=\skip160
\footmarkwidth=\skip161
\footmarksep=\skip162
\footparindent=\skip163
\footinsdim=\skip164
\footinsv@r=\insert197
\@mpfootinsv@r=\insert196
\m@m@k=\count112
\m@m@h=\dimen142
\m@mipn@skip=\skip165
\sidefootins=\insert195
\sidefootadjust=\skip166
\sidefootheight=\skip167
\sidefoothsep=\skip168
\sidefootvsep=\skip169
\sidefootwidth=\skip170
\m@mdownsf=\skip171
\c@sidefootnote=\count113
\sidefootmarkwidth=\skip172
\sidefootmarksep=\skip173
\sidefootparindent=\skip174
\c@pagenote=\count114
\c@pagenoteshadow=\count115
\mem@pn@lastkern=\skip175
\every@verbatim=\toks19
\afterevery@verbatim=\toks20
\verbatim@line=\toks21
\tab@position=\count116
\verbatim@in@stream=\read1
\verbatimindent=\skip176
\verbatim@out=\write3
\bvboxsep=\skip177
\c@memfbvline=\count117
\c@bvlinectr=\count118
\bvnumlength=\skip178
\fb@frw=\dimen143
\fb@frh=\dimen144
\FrameRule=\dimen145
\FrameSep=\dimen146
\c@cp@cntr=\count119
LaTeX Info: Redefining \: on input line 12100.
LaTeX Info: Redefining \! on input line 12102.
\c@ism@mctr=\count120
\c@xsm@mctr=\count121
\c@csm@mctr=\count122
\c@ksm@mctr=\count123
\c@xksm@mctr=\count124
\c@cksm@mctr=\count125
\c@msm@mctr=\count126
\c@xmsm@mctr=\count127
\c@cmsm@mctr=\count128
\c@bsm@mctr=\count129
\c@workm@mctr=\count130
\c@sheetsequence=\count131
\c@lastsheet=\count132
\c@lastpage=\count133
\c@figure=\count134
\c@lofdepth=\count135
\cftbeforefigureskip=\skip179
\cftfigureindent=\skip180
\cftfigurenumwidth=\skip181
\c@table=\count136
\c@lotdepth=\count137
\cftbeforetableskip=\skip182
\cfttableindent=\skip183
\cfttablenumwidth=\skip184
Package abstract [2008/07/23] emulated by memoir.
Package appendix [2008/07/23] emulated by memoir.
Package array [2016/10/06] emulated by memoir.
Package booktabs [2016/05/16] emulated by memoir.
Package ccaption [2008/07/23] emulated by memoir.
Package changepage [2008/07/23] emulated by memoir.
Package chngcntr [2008/07/23] emulated by memoir.
Package chngpage [2008/07/23] emulated by memoir.
Package crop emulated by memoir.
Package dcolumn [2008/07/23] emulated by memoir.
Package delarray [2014/10/28] emulated by memoir.
Package enumerate [2008/07/23] emulated by memoir.
Package epigraph [2008/07/23] emulated by memoir.
Package ifmtarg [2008/07/23] emulated by memoir.
Package index [2008/07/23] emulated by memoir.
Package makeidx [2008/07/23] emulated by memoir.
Package moreverb [2008/07/23] emulated by memoir.
Package mparhack [2008/07/23] emulated by memoir.
Package needspace [2008/07/23] emulated by memoir.
Package newfile [2008/07/23] emulated by memoir.
Package nextpage [2008/07/23] emulated by memoir.
Package pagenote [2008/07/23] emulated by memoir.
Package parskip [2008/07/23] emulated by memoir.
Package patchcmd [2008/07/23] emulated by memoir.
Package setspace [2008/07/23] emulated by memoir.
Package shortvrb [2008/07/23] emulated by memoir.
Package showidx [2008/07/23] emulated by memoir.
Package tabularx [2016/02/03] emulated by memoir.
Package titleref [2008/07/23] emulated by memoir.
Package titling [2008/07/23] emulated by memoir.
Package tocbibind [2008/07/23] emulated by memoir.
Package tocloft [2008/07/23] emulated by memoir.
Package tocvsec2 [2008/07/23] emulated by memoir.
Package verbatim [2008/07/23] emulated by memoir.
Package verse [2008/07/23] emulated by memoir.
) (aaa.aux)
\openout1 = `aaa.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
 [1{C:/Users/Carlos Tiago/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}


] [2

]
[1

] (aaa.aux) ) 
Here is how much of TeX's memory you used:
 3529 strings out of 492972
 47082 string characters out of 3135837
 136157 words of memory out of 3000000
 7459 multiletter control sequences out of 15000+200000
 5803 words of font info for 21 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 31i,10n,24p,153b,221s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmbx12
.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on aaa.pdf (3 pages, 24368 bytes).
PDF statistics:
 20 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)
  • I just compiled your MWE and I got "Figure 1.1: A figure". See this image: i.imgur.com/69cbgC4.png – Milo Apr 19 '18 at 17:03
  • I'm using pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6670 64-bit). What you obtained was exactly what I wanted ... – Carlos Tiago Apr 19 '18 at 17:17
  • Your code is working when I compile it with pdfLaTeX. I don't know what the problem is. Perhaps you should be using pdfLaTeX not pdfTeX? – Milo Apr 19 '18 at 17:57
  • See the difference between pdfTeX and pdfLaTeX – Milo Apr 19 '18 at 17:59
  • I copy the information "pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6670 64-bit)" from the log file. It says pdfTeX, but I'm compiling with pdfLaTeX. Thanks. – Carlos Tiago Apr 19 '18 at 18:32
3

Until the error is fixed in the new LaTeX format, you can explicitly use the version that memoir still provides by using

\makeatletter
\renewcommand{\counterwithin}{\@ifstar{\@csinstar}{\@csin}}
\makeatother

in your preamble.

Thanks to jfbu for the analysis.

| improve this answer | |
  • 2
    fixed in kernel code, so should show up soon – Frank Mittelbach Apr 22 '18 at 9:38
8

Initially, \thefigure has the dot

> \thefigure=\long macro:
->\thechapter .\@arabic \c@figure .
l.2 \show\thefigure

\frontmatter does \counterwithout {figure}{chapter} which resets \thefigure to

> \thefigure=macro:
->\@arabic \c@figure .
l.12 \show\thefigure

Where the dot has disappeard (in the above the final dot is always added by \show).

As part of expansion of \mainmatter we also see

\@secondoftwo #1#2->#2
#1<-\@nocounterr {chapter}
#2<-\@addtoreset {figure}{chapter}\expandafter \gdef \csname thefigure\expandaf
ter \endcsname \expandafter {\csname thechapter\expandafter \endcsname \expanda
fter \@arabic \csname c@figure\endcsname }

Thus again \thefigure is defined without dot.

The latter comes from expansion of:

\@memmain@floats ->\counterwithin {figure}{chapter} \counterwithin {table}{chap
ter} 

So it seems \counterwithout/\counterwithin is culprit. Perhaps the recent change in the LaTeX format ?

(I will investigate a bit more and report)


With memoir as in TL2017 I see in the log

\@csin #1#2->\@ifbothcntrs {#1}{#2}{\@addtoreset {#1}{#2}\@namedef {the#1}{\@na
meuse {the#2}.\arabic {#1}}}
#1<-figure
#2<-chapter

With memoir + TL2018 current I see

\counterwithin@x #1#2->\@ifbothcounters {#1}{#2}{\@addtoreset {#1}{#2}\expandaf
ter \gdef \csname the#1\expandafter \endcsname \expandafter {\csname the#2\expa
ndafter \endcsname \expandafter \@arabic \csname c@#1\endcsname }}

This is where the dot has disappeared. Both expand from

\@memmain@floats ->\counterwithin {figure}{chapter} \counterwithin {table}{chap
ter} 

but expansion of \counterwithin has changed. The new memoir has

\providecommand{\counterwithin}{\@ifstar{\@csinstar}{\@csin}}
\providecommand{\@csinstar}[2]{%
  \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}}}
\providecommand{\@csin}[2]{%
  \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}%
                        \@namedef{the#1}{\@nameuse{the#2}.\arabic{#1}}}}

whereas the former had

\newcommand{\counterwithin}{\@ifstar{\@csinstar}{\@csin}}
\newcommand{\@csinstar}[2]{%
  \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}}}
\newcommand{\@csin}[2]{%
  \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}%
                        \@namedef{the#1}{\@nameuse{the#2}.\arabic{#1}}}}

LaTeX of TL2017 did not define \counterwithin:

$ latexdef counterwithin

\counterwithin:
undefined

but LaTeX of TL2018 does define it

$ latexdef counterwithin

\counterwithin:
macro:->\@ifstar \counterwithin@s \counterwithin@x 

The cautious \providecommand done by memoir 2018/04/04 v3.7g does not overrule the \counterwithin now from LaTeX. But this one adds no dot...

Thus a report to maintainers of memoir and LaTeX2e is in order...

well this appears to be a LaTeX2e bug because the definition does not include the dot which is in the description: enter image description here

| improve this answer | |
  • github.com/latex3/latex2e/issues/38 – user4686 Apr 19 '18 at 21:34
  • Good investigation. I did indeed just add \providecommand to memoir to prepare for the new format. Where exactly do you see the text in the image? – daleif Apr 20 '18 at 11:35
  • @daleif in source2e.pdf: section 22 Counters and Lengths corresponding to file ltcounts.dtx – user4686 Apr 20 '18 at 11:36
  • Thanks, hopefully they'll have that fixed soon enough, sad though that this is after the TL freeze – daleif Apr 20 '18 at 11:39
  • 1
    @daleif the github commit does include a thorough test for many things and among them \counterwithin{footnote}{subsection}, followed by \show\thefootnote with the comment % \thesubsection.\arabic{footnote}. But the committed expectation was without the dot, in contradiction to comment.. thus the commit went through the validation. I feel sympathy for having myself pushed an update to a package a bit in haste when I belatedly realized TeXLive schedule had been advanced by one full month. Bugs creep-in even in validation suites... – user4686 Apr 20 '18 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.