I'm a rookie so I copied/pasted code from a document/template which I found on Overleaf.com to my LaTeX document, in hope of getting the table shown below. However, it did not work as intended.


I believe the above might be the cause of the problem (?)


Here is the code:



\caption{This is a table. Tables should be self-contained and complement, but not duplicate, information contained in the text. They should be not be provided as images. Legends should be concise but comprehensive – the table, legend and footnotes must be understandable without reference to the text. All abbreviations must be defined in footnotes.}
            \thead{Variables} & \thead{JKL ($\boldsymbol{n=30}$)} & \thead{Control ($\boldsymbol{n=40}$)} & \thead{MN} & \thead{$\boldsymbol t$ (68)}\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            stop alternating row colors from here onwards\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            Age at testing & 38 & 58 & 504.48 & 58 ms\\
            \hline  % Please only put a hline at the end of the table

            \item JKL, just keep laughing; MN, merry noise.

source: https://www.overleaf.com/13040643kzzrjnxqfjph#/50009479/

Here is the result:

enter image description here

  • I added some packages (code updated above) and after compiling everything can be viewed. However, it's not as "colorful" as the picture nor is 'TABLE 1' printed the same way as on the picture. Not to mention \headrow \thead \hiderowcolors are unknown commands. – Jonathan.H Jan 3 '18 at 23:06
  • I updated the code once more, this is how it looks even if I save the whole project to my disk. I need to do some research, but I'll post a solution if I find one. – Jonathan.H Jan 3 '18 at 23:23

Copying just the code in the active window does not consider all the other components working with the template/project. You should copy the entire project folder to some local working folder, where you can compile the project. Following the instructions in How to download an Overleaf template?, these are all the files associated with the template:

enter image description here

This is the output for the table when compiling main.tex locally:

enter image description here

You'll have to compile with BibTeX as well if you want the bibliography working properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.