# Table and citation formats that are portable across publishers

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:

1. A paper is rejected from one journal and needs to be submitted to another
2. 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).
3. Another journal's scope aligns better than that what was initially thought
4. 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.

• Is your goal to have one/same content and publish it in two journals? Jun 19, 2016 at 14:20
• I have edited the question to include the motivation behind the question, which addresses your comment. Jun 20, 2016 at 0:52
• You really can't sensibly want not to change the \documentclass and \bibliographystyle lines. Unless you just want to create a custom wrapper class which decides between them. You could do that, but I don't see it is really any more work to change those 2 lines in the source - after all, something has to change in the source - and it will just obfuscate the code for no good reason. I've suggested something below which arguably goes too far, but is still hopefully (somewhat) transparent.
– cfr
Jun 20, 2016 at 2:51

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:

If you are submitting source - as opposed to PDF - you should not do this as it will only annoy. In particular, it will piss off copy editors no end. They do not want a highly customised preamble and a body which uses a bunch of user-defined macros.

# 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.

\documentclass{IEEEtran}
\providecommand\tbl[2]{%
\caption{#1}%
#2}
\bibliographystyle{IEEEtran}

\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}
% Currently I have to use this
Lastname et al. \cite{Lastname2010title} present a technique.
\bibliography{\jobname}
\end{document}


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.

\documentclass{acmsmall}
\providecommand\tbl[2]{%
\caption{#1}%
#2}
\bibliographystyle{ACM-Reference-Format-Journals}

\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.
\bibliography{\jobname}
\end{document}


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, using etoolbox for testing whether \citeN is defined,

\documentclass{acmsmall}
\usepackage{etoolbox}
\providecommand\tbl[2]{%
\caption{#1}%
#2}
\providecommand\myciteN[2]{%
\ifundef\citeN{%
#1 \cite{#2}%
}{%
\citeN{#2}%
}%
}
\bibliographystyle{ACM-Reference-Format-Journals}

\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}
\myciteN{Lastname et al.}{Lastname2010title} present a technique.
\bibliography{\jobname}
\end{document}


produces

while merely changing the class and the bibliography style in the preamble as follows

\documentclass{IEEEtran}
\usepackage{etoolbox}
\providecommand\tbl[2]{%
\caption{#1}%
#2}
\providecommand\myciteN[2]{%
\ifundef\citeN{%
#1 \cite{#2}%
}{%
\citeN{#2}%
}%
}
\bibliographystyle{IEEEtran}

\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}
\myciteN{Lastname et al.}{Lastname2010title} present a technique.
\bibliography{\jobname}
\end{document}


now produces

This means that you can write, for example,

\documentclass{IEEEtran}
% \documentclass{acmsmall}
\usepackage{etoolbox}
\providecommand\tbl[2]{%
\caption{#1}%
#2}
\providecommand\myciteN[2]{%
\ifundef\citeN{%
#1 \cite{#2}%
}{%
\citeN{#2}%
}%
}
\bibliographystyle{IEEEtran}
% \bibliographystyle{ACM-Reference-Format-Journals}

\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}
\myciteN{Lastname et al.}{Lastname2010title} present a technique.
\bibliography{\jobname}
\end{document}


and merely comment/uncomment the class line and one preamble line to switch between formats.

• this is quite helpful, great! Jun 20, 2016 at 5:00
• Table solution is perfect. If myciteN could have been simplified, it would have been really great. Still, thanks a lot. I have responded to your comment by editing question. Jun 21, 2016 at 0:58
• @user984260 If you can find a way to extract the author information in IEEE, then you could simplify it. I'm not familiar with the class and nothing looked immediately obvious. Without that, you have no way to access that information.
– cfr
Jun 21, 2016 at 1:06