Sometimes, an author has to submit manuscript originally prepared according to one publisher's format (e.g. IEEE) to another publisher's format (e.g., ACM). This may be due to:
- A paper is rejected from one journal and needs to be submitted to another
- After completing manuscript, author finds that its page-length has exceeded that of one publisher (e.g., 14 pages in one journal) and needs to be submitted to another (e.g., 25 pages in another).
- Another journal's scope aligns better than that what was initially thought
- and many other possible reasons…
However, since they use different formats, one has to make lot of changes in text, which may introduce grammatical/formatting errors. It would be really nice to achieve this just by changing the macros in the header .tex fil, without changing .cls or .bst/.bib files or any included .tex files.
Some publishers take source-files only after acceptance, so this approach is most useful for them, since after acceptance, the author has surety and more-time for removing his/her macros than that at submission-time (deadline). If publishers take source-files before acceptance, editors won't like macros, as cfr has correctly pointed out, so this approach is not very useful.
Here I focus on table and citation format differences between ACM (journal template, not conference template) and IEEE.
Citations: IEEE uses numbered citation and ACM uses author-year. I would like to use following in .tex file:
\citeN{Lastname2010title} present a technique
to generate
ACM PDF: Lastname et al. [2010] present a technique
IEEE PDF: Lastname et al. [3] present a technique
Tables: Currently, I have to use following for ACM and IEEE tables, respectively (with MWE). It would be great to just put tabular part in a macro and define that macro differently in header file of IEEE or ACM papers.
\documentclass{acmsmall}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Lastname2010title,
author = "Firstname Lastname and next author and more authors",
title = "Title of paper",
year = "2010",
journal = "Some Journal",
}
\end{filecontents}
\begin{document}
\begin{table}[htbp]
\centering
\tbl{ My Table Title \label{tab:label1}}{
\begin{tabular}{|l|l|} \hline
Key & Value \cite{Lastname2010title} \\\hline
\end{tabular}
}
\end{table}
\citeN{Lastname2010title} present a technique.
\bibliographystyle{ACM-Reference-Format-Journals}
\bibliography{\jobname}
\end{document}
This is for IEEE.
\documentclass{IEEEtran}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Lastname2010title,
author = "Firstname Lastname and next author and more authors",
title = "Title of paper",
year = "2010",
journal = "Some Journal",}
\end{filecontents}
\begin{document}
\begin{table}[htbp]
\centering
\caption{My Table Title}\label{tab:label1}
\begin{tabular}{|l|l|}\hline
Key & Value \cite{Lastname2010title} \\\hline
\end{tabular}
\end{table}
% Currently I have to use this
Lastname et al. \cite{Lastname2010title} present a technique.
\bibliographystyle{IEEEtran}
\bibliography{\jobname}
\end{document}
Here are full templates for ACM and IEEE. I have uploaded *cls and *bst files here to avoid need of downloading and unzipping them.
Best Answer
You can move the
\bibliographystyle
to the preamble or whatever, so it is easier to switch out.That much is unobjectionable. However, everything suggested below this point is subject to a large caveat:
Caveat emptor
You could handle the tabular in this way by providing a command which will not overwrite an existing definition, but only supply a default if none is defined.
produces
Switching classes means we need to alter the preamble to use the relevant bibliography style, but the
\providecommand
can stay. We don't need it, but it does no harm. (It will result in an infinitesimal increase in compilation time as TeX will read the code, but it will not make any difference to the compiled result.)We also still need to change
\cite
to\citeN
etc. as applicable.produces
Note that you could obviously
\providecommand
for\citeN
, too. But you would still need to change the structure of the text in that case.You could work around this by defining a custom citation command,
\myciteN{}{}
which does something different, depending on which class is loaded. For example, usingetoolbox
for testing whether\citeN
is defined,produces
while merely changing the class and the bibliography style in the preamble as follows
now produces
This means that you can write, for example,
and merely comment/uncomment the class line and one preamble line to switch between formats.