TeX - LaTeX Asked by tjk8000 on April 20, 2021
I am currently working on submitting a journal manuscript and am trying to convert my original manuscript from elsarticle
class to cas-dc
based on feedback and recommendations from Elsevier. My code will successfully typeset my document every other time. It runs through, creates the following error message, I re-run and then it deletes the .aux
file and successfully compiles.
Error message:! Missing = inserted for ifnum.
Normally this would not be an issue but as @PhelypeOleinik pointed out in his answer to my original question, I need to successfully compile the document twice in order to get things like author and title notes to work.
I have looked at the following answer/questions without much success:
Compilation problem with siunitx (returning error regarding ifnum): claims that it’s an issue with how versions are maintained and dated, suggests that user update Tex distribution. I have updated everything in MikTex and repeatedly checked for updates until no more updates were available. Issue persists.
Missing=inserted for ifnum: no answer suggests a potential issue with beamer
. I am not using beamer
, do not think that it is an issue.
Missing = inserted for ifnum error when generating bibliography using natbib : suggests deleting the bib aux
file and rerunning. This wont work because I need to re-run without deleting the aux
file in order to get all the notes to show up.
Missing = inserted for ifnum. usepackage: alternately suggest look at the first answer in this list and updating packages/MikTex distribution. I have already updated anything without success.
Error “Missing = inserted for ifnum”: suggests that it is an issue with how the user was using pgfmath
functions in tikz
package. In my MWE I am not using tikz
directly (to my knowledge) and issue persists.
Below is a minimum working example that replicates the issue. I use input
a lot to keep separate files clean and have replicated that structure here in case that is somehow related. All of the separate files are in the same folder.
draft_paper.tex
listfiles
documentclass[sort&compress]{cas-dc}
input{settings_options_parameters} % contains all of the settings/options that I don't think we'll need to change very often
begin{document}
input{frontmatter}
end{document}
settings_options_parameters.tex
usepackage{natbib}
usepackage{lipsum}
ExplSyntaxOn
keys_set:nn { stm / mktitle } { nologo }
ExplSyntaxOff
frontmatter.tex
Based heavily on the documentation for cas-dc
here.
title[mode=title]{Test Title: 101 Reasons Why I Can't LaTeX}
tnotemark[1]
tnotetext[1]{This document is the result of blood, sweat, tears and taxpayer money.}
author[1]{Dummy Author One}[%
type=author,
orcid=]
cormark[1]
fnmark[1]
ead[url]{[email protected], url{fakewebaddress.com}}
credit{Everything}
address[1]{Nowheresville, North America}
author[1]{Dummy Author Two}[%
type=author,
orcid=]
cormark[2]
fnmark[2]
ead[url]{[email protected], url{phishingsupplies.com}}
credit{Nothing}
author[1]{Dummy Author Two}[%
type=author,
orcid=]
cormark[1,2]
fnmark[1,2]
ead[url]{[email protected], url{hackingsupplies.com}}
credit{Nothing}
address[1]{Nowheresville, North America}
cortext[cor1]{Corresponding author}
cortext[cor2]{Principal corresponding author}
fntext[fn1]{This is the first author footnote. but is commonto third author as well.}
fntext[fn2]{Another author footnote, this is a very longfootnote and it should be a really long footnote. But thisfootnote is not yet sufficiently long enough to make two linesof footnote text.}
% Abstract
begin{abstract}[SUMMARY]
lipsum[1-1]
end{abstract}
% Key words
begin{keywords}
LaTeX sep Science sep Crying
end{keywords}
maketitle
These are images of the end result, the first time it compiles, the second time it throws the error mentioned above and it never shows the title notes tnotemark
or author notes cormark
The log
file after the error is thrown can be found here. listfiles
has been added, but if anything else should be added please let me know.
Many thanks for any help on this issue!
els-cas
has... issues. You found two.
First: the optional document of cormark
must be a number, and it is not optional: if you leave it out you get an error. Yes :-)
cormark[]
is invalid, as is cormark[1,2]
, so in principle you cannot put more than one cormark
per author (who knows if it's by design or a bug). Here's a patch to make the optional argument of cormark
really optional and allow cormark[1,2]
(add it yo your preamble):
ExplSyntaxOn
makeatletter
RenewDocumentCommand process@marks { }
{
bool_lazy_or:nnTF
{ cs_if_free_p:c { mark@corautheauthor } }
{ tl_if_empty_p:c { mark@corautheauthor } }
{ ignorespaces }
{ str_set:Nx l_tmpa_str { use:c{ mark@corautheauthor } }
clist_map_inline:Nn l_tmpa_str
{
int_case:nn { ##1 }
{
{ 1 } { sep$ast$ }
{ 2 } { sep$astast$ }
{ 3 } { sep$ast!ast!ast$ }
}
tex_def:D sep{unskip,}
}
}
cs_if_free:cTF { mark@fnautheauthor }
{ ignorespaces }
{ sepuse:c { mark@fnautheauthor }
tex_def:D sep{unskip,}
}
}
makeatother
ExplSyntaxOff
Second: The optional argument of ead
does basically nothing. ead[url]{[email protected]}
is as valid as ead[mashed potatoes]{[email protected]}
. Yes :-)
The only difference is that if the optional argument is not empty, els-cas
uses url
, otherwise it uses detokenize
around the argument. Doesn't make a lot of sense, if you ask me. In any way, ead
does not (properly) support more than one address.
The documentation suggests you to use ead{[email protected], [email protected]}
and make one single URL out of the whole thing, which is wrong (but probably okay, since your paper will be edited by the Elsevier people and the LaTeX template won't be used in the process, so I'd probably go with that.
Another option is to use ead
twice, when you need two addresses:
author[1]{Dummy Author Two}
ead{[email protected]} % e-mail adrress
ead[mashed potatoes]{hackingsupplies.com} % website
Correct answer by Phelype Oleinik on April 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP