5

This is a question I am asking due to my personal experience in writing articles: I define commands (parametrized or not) to save time and reduce typos in formulas all around the paper. A very simple example I use very often is the following one:

\documentclass{article}
\usepackage{amsmath}
...
\newcommand{\CC}[1][n]{\mathbb{C}^{#1}}

However, some publishers do not want to process a .tex file containing custom defined commands, and require the author to write down every formula by using only standard LaTeX commands, and this give rise to my question: since commands are basically macros, is it possible to instruct the LaTeX preprocessor in order to produce a .tex file where all commands have been textually substituted by the associated standard LaTeX expressions, or should I have to recur to the powers of Emacs?

  • 1
    emacs is your friend – David Carlisle Aug 24 '17 at 10:58
  • 1
    https://tex.stackexchange.com/questions/67709/ – Torbjørn T. Aug 24 '17 at 11:56
  • 1
    publishers are exhibiting good sense when they tell you not to redefine commands that already exist. but if they tell you you shouldn't define a new command that ensures consistency in your own notation, they're spiting themselves. the only places where it's not wise to use author-defined commands is in top matter (title, abstract, and the like) and bibliography; those elements are often sent on to "aggregators" and indexers, who are (understandably) not equipped to deal with the proliferation of such code. – barbara beeton Aug 24 '17 at 13:12
  • @barbarabeeton: the IEEE journals that I published in has this policy. I believe that they transform the Tex source into an xml file and then generate PDF (via latex) and HTML + mathjax page. Does AMS also generate an HTML version of the paper and if so how do they manage the transformation from Tex to xml/xhtml? – Aditya Aug 24 '17 at 13:55
  • @barbara beeton. In its redaction infosheet, the publisher explains that they jointly process batches of 10+ papers and their processor cannot get rid of too many custom definitions, so they require authors to use only standard commands. I incurred in this problem because, under the advice by my master and friend, I split in two parts a paper that was originally planned to be submitted to another publisher, which adopt a fair policy similar to the one you briefly described: I had two papers written following one set of rules but to be submitted to two different publishers. – Daniele Tampieri Aug 24 '17 at 14:11
  • 1
    @Aditya -- the ams transforms the top matter and bibliography to html to post with online journal contents pages. these elements need to be free of author-defined macros. otherwise, it is usually appreciated that an author has taken care to make notation consistent, as long as existing commands and one-letter command names are avoided. there is no intermediate xml; the html processor used is able to go directly into mathjax. – barbara beeton Aug 24 '17 at 16:11
  • @DanieleTampieri -- batching papers does indeed introduce limitations; when compiling abstracts for a meeting, it is necessary to severely limit the use of extra definitions, but ams processes each full paper individually, so the restriction doesn't apply. but that's particular to each publisher. – barbara beeton Aug 24 '17 at 16:14
  • @barbarabeeton: Thanks for the information. Last time I checked, mathjax could only handle simple tex macros. For example, I use macros like $\VAR X[i](t)$which will typeset as either $X^i_t$ or $X_i(t)$ depending on the convention that I am following. This macro includes conditional checks so that $\VAR X(t)$ and $\VAR X[i]$ do the right thing. Last time I tried, I could not figure out how to use \ifnextcharelse type of macros to MathJax. I always assumed that when publishers say don't use macros, they really mean don't use macros that are too complicated. – Aditya Aug 25 '17 at 02:14
  • @barbarabeeton: I noticed your reply and want to thank you for your informations on Editors methodology in dealing with LaTEX files from different authors. – Daniele Tampieri Dec 17 '17 at 21:27
  • 1
    @barbarabeeton, but surely there is an issue whereby one can never keep track of all the commands that already exist, especially in the journal's own internal workflow? For example, I recently got back some proofs that made it clear that the journal style involved some internal hackery with \ref that (I discovered) made it incompatible with my own internal hackery with \ref, but in totally incomprehensible ways. (My hackery left \ref itself untouched, just defined a raft of auxiliary commands.) – LSpice Jan 09 '19 at 14:39

1 Answers1

10

One publisher's position.

The American Mathematical Society publishes nearly all its books and journals using LaTeX, and with a volume of more than 10,000 pages a year, requires consistency in the source files.

Certain components of a published work are provided to outside organizations -- aggregators and indexers -- for further dissemination. These components include the bibliographic information (essentially the front matter or top matter), the abstract, and the reference list/bibliography. The organizations handling this material are usually not equipped to handle LaTeX (or mathematical notation, for that matter), and in particular, do not have the definitions available that an author has created. In order for this "shared" material to be intelligible, it must therefore be reduced to the least common denominator -- no author-defined macros.

For this reason, authors are requested to refrain from using macros that they have defined in titles, abstracts, and bibliographies. There may be further restrictions -- LaTeX notation is not recognized in PDF bookmarks, so alternate representation should be provided.

Another source of problems is the redefinition by an author of existing commands. Redefinition of, for example, \c, can come to grief when an author with a French name appears in the bibliography (which is "normalized" in AMS publications to the form used in MathSciNet). If the \c was defined to be something that can appear only in a mathematical context, then an error message will result; if, however, the redefinition can appear in text, it may be overlooked, and discovered only after the work has been published -- a possible embarrassment for the author.

However, author definitions for commonly used mathematical notation are encouraged for the main text, as this enhances consistency and can aid in comprehension for a sightless reader who depends on an audio interface from the source file. (Well chosen macro names, ones that are meaningful in context, are important in this situation. This means a name that is not just easy to type, but a term that clearly identifies its target.) Use of one-letter macro names is a bad idea, for reasons of both ambiguity (already defined) and clarity (what does it mean?).

At the AMS, if an author does not follow these instructions, unless there are significant other problems with a submission, the problems will simply be cleaned up in-house. However, since any "tinkering" with a file carries some danger of introducing errors, it is in an author's best interests to follow the guidelines.

Responding to some questions posed in comments, it should be noted that the AMS production stream does not incorporate an xml/html translation, except for a "final" translation to html + mathjax for posting of bibliographical material and abstracts on web pages. Further, when a publication (either a journal or a proceedings collection) contains multiple papers by different authors, each one is processed individually (so author-defined material is not merged or compromised) and the separately composed pdf files are combined into a volume by processes external to LaTeX.