1

I just saved an .eps file that it can not be uploaded to latex and it shows as in the photo , how would I resolve it ? this is the code , when I use smaller dimensions it's in the center , but with this one , I increased a little bit , and it went out of the center

\begin{figure}[H]
\centering
\label{fig:f419}
\caption{Deflection and weight as functions of D11 and D12}
\includegraphics[width=15cm, height=8cm]{4-23.eps}

\end{figure}

also this is my main file codes , that I don't know how to make a minimal , I mean , I know the link to minimal but here it's just too much and confusing

\documentclass[11pt,a4paper,twoside,openright]{report}

\usepackage{setspace}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{tabu}
\usepackage{subfigure}
\usepackage{afterpage}
\usepackage{amsmath,amssymb}            
\usepackage{rotating}  
\usepackage{fancyhdr}  
\usepackage[scriptsize]{caption} 
\hyphenation{a-gen-tiz-za-zio-ne}
\usepackage{float}
\usepackage[parfill]{parskip}
\graphicspath{ {images/} }

\setlength{\paperwidth}{16cm}
\setlength{\paperheight}{24cm}
\setlength{\oddsidemargin} {2. cm}
\setlength{\evensidemargin} {2. cm}
\addtolength{\oddsidemargin} {-0.4 cm}
\addtolength{\evensidemargin} {-0.4 cm}
\linespread{1.1}

\usepackage[USenglish]{babel}
\usepackage[latin1]{inputenc}
\renewcommand{\captionfont}{\normalfont \sffamily \itshape \small}

\pagestyle{empty}


\begin{document}


\include{frontespizio}
\thispagestyle{empty} \normalfont \cleardoublepage
\include{dedica}
\thispagestyle{empty}  \cleardoublepage
\pagenumbering{Roman}
\include{sommario}
\thispagestyle{empty} \vspace*{.75truecm} \cleardoublepage
\include{ringraziamenti}
\thispagestyle{empty} \vspace*{.75truecm} \normalfont \cleardoublepage
\pagestyle{plain}\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}} 
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}         
\fancyhead[LE,RO]{\bfseries\thepage}    

\fancyhead[RE]{\bfseries\leftmark}    
\fancyhead[LO]{\bfseries\rightmark}     
\renewcommand{\headrulewidth}{0.3pt} 

\include{capitolo1}
\include{capitolo2}
\include{capitolo3}
\include{capitolo4}
\include{capitolo5}
\include{capitolo6}
\include{capitolo7}

\cleardoublepage
% ---- Bibliography ----
\addcontentsline{toc}{chapter}{Bibliografia}
\bibliographystyle{plain}
\bibliography{bibl_tesi}
%\nocite{*}

\appendix

\pagestyle{fancy} 
\fancyfoot{}                                               
\renewcommand{\chaptermark}[1]{\markboth{\appendixname\ \thechapter.\ #1}{}} 
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}         
\fancyhead[LE,RO]{\bfseries\thepage}    

\fancyhead[RE]{\bfseries\leftmark}    
\fancyhead[LO]{\bfseries\rightmark}     
\renewcommand{\headrulewidth}{0.3pt} 

\renewcommand\bibname{references}
\tableofcontents\addtocontents{toc}{\protect\thispagestyle{empty}}\newpage
\renewcommand\listfigurename{list of figures}\listoffigures
\renewcommand\listtablename{list of tables}\listoftables

%\phantomsection\addcontentsline{toc}{chapter}{list of symbols}\input{FrontMat/Symbols}


\include{appendiceA}
\include{appendiceB}
\include{appendiceC}
\include{appendiceD}
\include{appendiceE}
\include{appendiceF}
\include{references}
\end{document}
Farzad64
  • 379
  • 4
    Probably 15cm is wider than \textwidth, please see Center figure that is wider than \textwidth. Please also see Why does an environment's label have to appear after the caption? because your labeling is incorrect at the moment. :-) – Paul Gessler Mar 29 '15 at 19:20
  • 2
    Also, note that \label should go after \caption, or else any \ref that refers to the figure will be completely wrong. (As in, it will refer to the section number instead of the figure number, or something equally silly.) – Mark Mar 29 '15 at 19:25
  • is this also the same reason that my tables don't center ? – Farzad64 Mar 29 '15 at 19:34
  • 2
    @Farzad64 please use @-username notation (as I've done here for you) to notify other commenters of your replies. It's probably also the reason your tables don't center, but it's impossible to say for sure without a minimal working example (MWE). – Paul Gessler Mar 29 '15 at 19:36
  • 2
    @Farzad64 without a MWE is hard to say if it's the same reason. Belong your snippet, you should define only width or height in your images, at least you want to deform them. – Aradnix Mar 29 '15 at 19:39
  • thanks a lot @PaulGessler i didn't know that , I edited the post , but still i don't know to put it correctly , I will correct the label thanks a lot , so do you think it's reasonable to increase the text width ? I am afraid it's out of the standard of my thesis – Farzad64 Mar 29 '15 at 19:53
  • @Aradnix do you think now it's possible to check ? – Farzad64 Mar 29 '15 at 19:54
  • 2
    @Farzad64 If you post it in a new question (after review the answers about published here and you have not find a solution) with a MWE then it would be possible. – Aradnix Mar 29 '15 at 20:18
  • thank you very much , btw , my document has setlength , but not textwidth , and also I will print it on A4 , I don't know if I can change them @Aradnix – Farzad64 Mar 29 '15 at 20:26
  • 3
    @Farzad64: You should not turn the screw on such lengths as paperwidth directly. Use the excellent geometry package for this –  Mar 29 '15 at 20:44
  • 3
    As SoundsOfSilence says, don't modify these directly unless you really know what you are doing and why you can't avoid it. However, if you are really printing on A4, you do not want paperwidth to be 16cm unless you are doing some complicated layout with trimming or multiple pages to one physical page. The width of A4 paper is 210mm - not 160. – cfr Mar 29 '15 at 20:50
  • thank you dear @SoundsOfSilence , so shall you tell me where to locate it in my code and which else ones to remove ? thaank you so much , I wish you were able to edit my code – Farzad64 Mar 29 '15 at 20:50
  • 1
    @cfr exactly , I am not so good in modifying the presetting of Latex docs – Farzad64 Mar 29 '15 at 20:54
  • 1
    @Farzad64: Your document is hard to 'improve', due to a lot of \include stuff. You could try \usepackage[a4paper,lmargin=2cm,rmargin=2cm]{geometry} and comment out all of the \setlength commands at the beginning (the bunch of them ;-)) –  Mar 29 '15 at 20:55
  • @SoundsOfSilence thank you so much, also should I comment out the addtolength? – Farzad64 Mar 29 '15 at 21:16
  • 1
    @Farzad64: Yes, I think so –  Mar 29 '15 at 21:17
  • @SoundsOfSilence I tried the one in the answer , not yours yet , but now I have a margine around the page the same way as in the answer, like a frame of lines , just don't know if they will apear in printing or not,but solved the centering issue – Farzad64 Mar 29 '15 at 21:23
  • @SoundsOfSilence I tried yours , solved , thanks a lot, even the tables , great , thanks to all – Farzad64 Mar 29 '15 at 21:25

1 Answers1

4

Here's a guess at what you might want, after minimising your example:

\documentclass[11pt,a4paper,twoside,openright]{report}

\usepackage[demo]{graphicx}
\usepackage{float}
\usepackage[scriptsize]{caption}

\usepackage[textwidth=160mm, textheight=240mm, hmarginratio=1:1, showframe]{geometry}

\pagestyle{empty}

\begin{document}

  \begin{figure}[H]
    \centering
    \caption{Deflection and weight as functions of D11 and D12\label{fig:f419}}
    \includegraphics[width=15cm, height=8cm]{4-23.eps}

  \end{figure}

\end{document}

centred image

cfr
  • 198,882
  • thank you so much, I am comparing it with my doc , is the demo in \usepackage[demo]{graphicx} , make difference also ? @cfr – Farzad64 Mar 29 '15 at 21:03
  • 1
    @Farzad64 The demo is because I don't have the image you have. Otherwise, I get an error when I try to compile. demo replaces all such images by black boxes. – cfr Mar 29 '15 at 21:30
  • 3
    @Farzad64: I strongly suggest to read introductory books on LaTeX as well the documentation of packages which is in most cases installed too together with them. –  Mar 29 '15 at 21:45
  • 2
    @cfr: I wished I could upvote your comments, but I run out of upvotes for them ... but anyway (+1) for the post itself ;-) –  Mar 29 '15 at 21:55
  • @SoundsOfSilence ;). That happens to me too. I must upvote lots of comments! – cfr Mar 29 '15 at 22:10
  • @SoundsOfSilence I'd edit the advice to read some basic introduction more than once if I could. – cfr Mar 29 '15 at 22:12