3

I need to write an article, the template is provided in MS Word, however the file they accept could be either PDF or MSWord. Then I prefer to write it in latex.

From this question it seems there is no tool for automatic conversion. but I would like to create a latex template manually which covers some basic features. So I would like to find the simplest way to get the following correspondences. I guess it could be a useful question for those who want to start a manual conversion.

Size:

  • Page Size: Letter: 21.59cm x 27.94cm
  • Margins : Top:2.54 cm, Bottom: 2.79 cm, left:1.9cm, Right:2.16cm
  • Two columns, 8.36 wide, Spacing: 0.81cm

Fonts:

  • Text : Times New Roman, 10 pt
  • Heading: Times New Roman, bold 12 pt
  • Subheading: Times New Roman, Regular, 11pt
  • Title : Century, Bold, 18pt
  • Abstract: Times New Roman, 9pt
  • References: Times New Roman, 9pt

Paragraphs:

  • Line Spacing : single
  • Paragraph Spacing : Before: 0pt, After: 0pt
  • Indentation : Before Text: 0pt, After text: 0pt, Special: First Line: 0pt
  • Heading spacing: Before : 20pt, After:10pt
  • Subheading spacing: Before : 10pt, After: 10pt

Captions:

  • Figure Captions: 8pt
  • Tables caption: 8pt
  • Table content: 9pt
  • Table headings: 9pt, bold

Page Numbers:

  • No page number
Ahmad
  • 1,013
  • 1
    What about the paper size: A4, US-Letter (8.5" x 11.0"), or something else? – Mico Jun 12 '16 at 13:51
  • 2
    Please note that font size specifications etc. from Word are not directly usable for LaTeX! –  Jun 12 '16 at 14:07
  • What about indentation of the first line of a paragraph? Where should the page numbers be placed: bottom-center or somewhere else? How wide should the space between the two columns be? What about the font size for level-2 ("subsection") headers? How should section numbers be formatted: Just the number, or number followed by a dot, or something else? – Mico Jun 12 '16 at 14:14
  • Hi Ahmad, your question is quite complex. There are services available that develop templates, but it is rather costly. For us it will be costly in time, so it would be nice if you can split your needs in smaller questions. – Johannes_B Jun 12 '16 at 14:14
  • 4
    Before we explore any further, since a Word template (and just word) is provided, are you sure you are allowed to submit in another format? – Johannes_B Jun 12 '16 at 14:16
  • Related Change section fonts and Setting a document in MS Word-12pt (12bp) which has links to other similar questions. – Alan Munn Jun 12 '16 at 14:16
  • @Johannes_B They want it in pdf, then I think if the output of the latex to be the same of the word, there is no problem. – Ahmad Jun 12 '16 at 16:08
  • 7
    @Ahmad -- just because they want it in pdf doesn't mean they will end up using your pdf file. i have just been through an exercise of preparing an article in latex, submitting the pdf file, and having to identify many corrections because the text was cut-and-pasted from the pdf into word and thence into indesign. things like "ff" ligatures were lost, spacing was quite amazingly "revised" by automatic processes, and there were other horrors too complicated to mention. (fortunately, the editor was understading.) please, for your own sake, find out exactly how your submission will be handled. – barbara beeton Jun 12 '16 at 16:20
  • Now, the question is even more complex and time consuimng to answer. You should split the different things, as as separat questions and merge the snippets yourself. – Johannes_B Jun 12 '16 at 16:25
  • @Mico I added some other features, I tried to make the question useful for further readers, I think these are the most common properties to set, and it is nice have them in one place, otherwise maybe I or others should search for each of them – Ahmad Jun 12 '16 at 16:27
  • For margins, look at the geometry package, for captions, look at the caption package. Pagenumbers: \pagestyle{empty} (assuming the header should be empty as well). And do you really mean to have no separation between paragraphs at all? No indentation, no extra space? – Torbjørn T. Jun 12 '16 at 16:28
  • @Johannes_B the last comment to Mico gives the reason why I think its better we cover them in once place, I don't think that would be so complex for an expert – Ahmad Jun 12 '16 at 16:28
  • 1
    There is a difference between being complex and being time consuming. – Johannes_B Jun 12 '16 at 16:29
  • There appears to be a conflict between "Tables caption: 8pt" and "Table headings: 9pt...". Please clarify. – Mico Jun 12 '16 at 16:49
  • 2
    I recommend converting from Word using wvware in the first instance. The result will not match the original perfectly and you will need to clean it up, but it usually provides a reasonable approximation. Note, however, that it always loads the obsolete times package when I use it, regardless of the original font. You can't directly translate many of those requirements into LaTeX regardless. However, if it needs to look like Word try loading the philosophy package which provides philosophy.sty. It is quite good: the result looks almost as bad as Word. – cfr Jun 12 '16 at 19:34

1 Answers1

10

Here's a suggested template, to be saved in a file named word2latextemplate.sty. I've had to fill in some gaps with educated guesses, as your instructions aren't nearly enough to define a template unambiguously.

%%% Save this file as 'word2latextemplate.sty'
%%% Load it from the main tex file via "\usepackage{word2latextemplate.sty}"

\ProvidesPackage{word2latextemplate}[2016/06/12]

\twocolumn

\usepackage{newtxtext,newtxmath}      % Times Roman clone

\usepackage[top=2.54cm, bottom=2.79cm, left=1.9cm, right=2.16cm, 
            columnsep=0.81cm, letterpaper]{geometry}

\usepackage{sectsty}
\sectionfont{\large} % 12pt
\subsectionfont{\fontsize{11}{13}\selectfont\mdseries}

\setlength\parindent{0pt} % no indentation of first line of paragraphs

\usepackage{caption}
\captionsetup{size=footnotesize, % 8pt
              font=bf, % bold
              skip=0.25\baselineskip}

\usepackage{etoolbox}
\AtBeginEnvironment{abstract}{\small} % 9pt in 'abstract' env.
\apptocmd{\@xfloat}{\small} % 9pt in tables and figures
% no page numbers on title pages:
\apptocmd{\maketitle}{\thispagestyle{empty}}{}{} 
% no page numbers on 'plain' pages
\pagestyle{empty} 

\endinput % end of "word2latextemplate"

Load it from your main tex file with the instruction \usepackage{word2latextemplate}.

Note that I didn't try to resolve what I perceive to be a conflict between the requirements "Tables caption: 8pt" and "Table headings: 9pt...". I gave the nod to the first-mentioned requirement.

Note also that not all formatting-related instructions are contained in the style file. Some additional formatting still has to be performed in the main tex file, as is done in the following MWE (minimum working example). Specifically, font-related commands have to be provided in the argument of \title.

\documentclass{article}
\usepackage{word2latextemplate}
\usepackage{lipsum}  % for filler text
\begin{document}

\title{\renewcommand{\rmdefault}{qcs} % Century clone
       \fontfamily\familydefault
       \fontsize{18}{22}\selectfont  % set font size
       \bfseries                     % set bold weight
       Article Title}
\author{FirstName LastName}
\date{January 1, 3001}
\maketitle

\begin{abstract}
\lipsum[2]
\end{abstract}

\section{Hello World}
\subsection{Good Morning}

\lipsum[2-4]

\begin{table}[h!]
\small  % switch to 9pt font size for body of 'table' env.
\caption{A table}
\centering
\begin{tabular}{lll}
\hline
a & b & c \\
d & e & f \\
\hline
\end{tabular}
\end{table}

\lipsum[6]

\end{document}

Here's a screenshot to go with the MWE:

enter image description here

Guido
  • 30,740
Mico
  • 506,678
  • Thank you very much, just as I see your output, there is an indentation for the first line of each paragraph, while in my template there is no indentation, 0pt before text – Ahmad Jun 13 '16 at 04:27
  • @Ahmad - I've added an instruction to the .sty file. I must say I was confused by the indentation-related instruction, especially the "After text: 0pt" part. I thus thought it (along with the "Before text: 0pt" part) was referring to some kind of block indentation of every paragraph! – Mico Jun 13 '16 at 05:33
  • Why do not use \appto{\table}{\small} to change the size of the font inside a table? – Guido Jun 13 '16 at 05:52
  • @Guido - Your suggestion may not work if there's a positioning specifier associated with the table. E.g., \begin{table} should be OK but \begin{table}[t] is not. – Mico Jun 13 '16 at 07:09
  • Thank you, I also edited the indentation section in my question, I meant fist line actually, however Before and After text in msword is 0pt also. – Ahmad Jun 13 '16 at 07:17
  • @Mico Correct there are problems with optional positioning arguments. However, I tested with \appto{\@xfloat}{\small} and it seems to work also with positioning arguments. – Guido Jun 13 '16 at 09:22
  • @Guido - Thanks! The answer is marked "community wiki", so please feel free to amend it as you see fit. :-) – Mico Jun 13 '16 at 10:42
  • excuse me, which software do you use to compile it? I use miktex 2.9, texstodio 2.10, and tex works 0.6 but couldn't compile it, some packages are not found like newtxtext or sectsty – Ahmad Jun 13 '16 at 12:36
  • @Ahmad - I have TeXlive on my system. Did you install MikTeX with just a minimum number of packages? You can always run MiktTeX's Package Manager ("MPM") utility to add "missing" packages such as sectsty, newtxtext, and newtxmath. – Mico Jun 13 '16 at 13:17
  • @Ahmad - If you want, you can check out any number of postings on this site for information on how to add "missing" packages to a MikTeX distribution. – Mico Jun 13 '16 at 13:20
  • @Mico Thanks I will test that, however TexStudio or TexWorks automatically download and install any missing package (as maybe it is done by MikTex API), but the problem was that the download dialogue stops for awhile and then says File xxx not found. By the way, I put your sty in the same directory of the tex. – Ahmad Jun 13 '16 at 14:38
  • @Ahmad - I'm not sure what you're saying: Has the problem of the missing packages been resolved, or does it persist? – Mico Jun 13 '16 at 14:43
  • @Mico it persists, I usually hadn't such a problem with any other package, they usually were downloaded and installed successfully, then I doubt these are specific packages or maybe my Miktex is old... – Ahmad Jun 13 '16 at 15:42
  • my problem is like this question http://tex.stackexchange.com/questions/251405/problem-with-new-mnras-style-files-newtx-on-arxiv, however in my case txfonts also is not installed. – Ahmad Jun 13 '16 at 15:48
  • 1
    @Ahmad - May I suggest that you post a new query, in which you ask about how to go about instructing MiKTeX to install missing packages? – Mico Jun 13 '16 at 16:43