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.

I am trying to include a MATLAB UI table (which I have previously saved as an .eps figure and put it into the same folder as my .tex file) into a LaTeX document, using:

\begin{figure}
\centering
\includegraphics{Table_TEST1}        %{Figure name without .eps extension}
\caption{Caption1}
\label{fig:Test1Table}
\end{figure}

However, only a part of the figure appears, one quarter of the figure is chopped off. I tried to use

\includegraphics[scale=.5]{Table_TEST1} 

instead, the figure is rescaled but one part of the figure is still missing. Any idea on how to solve this problem?

When I open the eps figure using an eps viewer, it says that the dimensions are: width:470, height:293.

I don't know if this fact is playing a role in the problem.

share|improve this question
    
What was your export procedure to get .eps from Matlab ? is it possible to provide the problem-sample.eps to test ? Did you test with other.eps figure ? are you using TeXlive(eps to pdf conversion automagic) or MiKTeX(\usepackage{epstopdf}) ? –  texenthusiast Mar 15 '13 at 20:55
    
to get the .eps file, I am just saving the matlab figure (Table_TEST1.fig) as a .eps figure (Table_TEST1.eps ) directly into Matlab. Then I copy-paste the file into my tex folder. However, after doing some Research online, I figured that I needed to compile the document using pdfLatex instead of just latex. Now the figure is no longer chopped up. My only question now is, since my figure is really a Table, I can't seem to find a way to have a caption that says for instance Table 2, instead of Figure 9. And the reason why Ithink is because I did not create that table directly in latex. –  Nodame Mar 15 '13 at 22:10
    
I repaced \"begin/end" {figure} with \"begin/end"{table) and used `\begin{table} \centering \includegraphics{Table_TEST1} \caption{Caption1} \label{fig:Test1Table} \end{figure} and it is working now! –  Nodame Mar 15 '13 at 22:50
    
you are superfast. latex-->dvi-->ps2pdf is somewhat an old way these days unless you need it for ps specials pstricks etc. pdflatexhas become the default engine for many people and editors including TeXworks etc. your figure in table example is shown via writelatex. Hope this is fine. –  texenthusiast Mar 15 '13 at 22:51
    
Thanks! that helps :) –  Nodame Mar 15 '13 at 22:53

2 Answers 2

You need to compile this sequence latex-->dvi-->ps2pdf to include .eps figure and output .pdf. Simplelatex gives only .dvi and pdflatex gives directly .pdf. BTW latex-->dvi-->ps2pdf is a traditional way unless you need it for ps specials,pstricks etc. pdflatex has become the default engine for many people and editors including TeXworks etc.

When your figure is really a Table, to have a Table caption that says for instance Table No, instead of Figure No,

Just include your Table_TEST1 figure without extension inside the Table environment like below example.

\documentclass[12pt]{article}
\usepackage{mwe} % http://www.ctan.org/pkg/mwe
\pagestyle{empty}
\begin{document}
\begin{figure}[!htbp]
\centering
\includegraphics[scale=0.5]{example-image-a}%figure without extension
\caption{Test1Table as figure}
\label{fig:Test1Table}
\end{figure}
 This is example for figure enviroment \ref{fig:Test1Table}.
 %http://tex.stackexchange.com/q/3243/15717 (why table caption is on the top)
\begin{table}[!htbp]
\caption{Test1Table as table} % table caption at top and separate counter 
\centering
\includegraphics[scale=0.5]{example-image-a}
\label{tabl:Test1Table}
\end{table}
This is example for figure inside table enviroment \ref{tabl:Test1Table}.
\end{document}

enter image description here

share|improve this answer

Try matlab2tikz script into matlab.

share|improve this answer
    
Please elaborate a little more, e.g., by showing a usage example. In its current form, your answer is probably of little help due to its brevity. –  mafp Mar 16 '13 at 11:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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