Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

I have an excel file including the following table. How should I create something similar to it? Is it better to use the table code in latex or make a figure from it and import it to latex (I did this but the quality of picture was so bad).

If I have to create a table, how should I automatically import those values to latex, because the values are too much to be written without any automatic routine.

enter image description here

share|improve this question

marked as duplicate by yo', percusse, Heiko Oberdiek, Christian Hupfer, Stefan Kottwitz Aug 2 at 10:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. –  yo' Aug 2 at 8:19
1  
Some tools for converting tables from Excel to LaTeX are listed in Comprehensive list of tools that simplify the generation of LaTeX tables. –  yo' Aug 2 at 8:20
    
@tohecz thank you. I did very easily imported my table by use of excel2latex add on introduced in the answer you gave me. –  Enthusiastic Student Aug 2 at 8:29

1 Answer 1

up vote 5 down vote accepted

This should help you. Save the contents of your excel sheet as csv file and use it in the LaTeX code. Here is an example:

enter image description here
The above is an excel sheet. Saving it in csv format as contents.csv.

natural,two,three
1,2,3
2,4,6
3,6,9
4,8,12
5,10,15
6,12,18
7,14,21
8,16,24
9,18,27
10,20,30

Now, the following code illustrates an example:

\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstabletypeset[
    col sep=comma,
    string type,
    columns/natural/.style={column name=natural, column type={|l}},
    columns/two/.style={column name=two, column type={|l}},
    columns/three/.style={column name=three, column type={|c|}},
    every head row/.style={before row=\hline,after row=\hline},
    every last row/.style={after row=\hline},
    ]{contents.csv}
\end{document} 

enter image description here

share|improve this answer

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