1

Hi everyone I'm trying to include pictures in my work this is my set up:

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

\usepackage[dvips]{graphicx}
\usepackage{chngpage}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{afterpage}
\usepackage{amsmath,amssymb}            
\usepackage{rotating}  
\usepackage{fancyhdr}  
\usepackage[scriptsize]{caption} 
\hyphenation{a-gen-tiz-za-zio-ne}

\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[english]{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} 

\include{appendiceA}
\include{appendiceB}
\include{appendiceC}
\include{appendiceD}
\include{appendiceE}
\include{appendiceF}

\end{document}

I read all the previous posts on the subject I tried everything the only thing that seems to work is removing dvips from graphicx, the problem is that as soon as I remove dvips the images re-appear but all the text shifts to right and it's impossible to read properly.

I don't know if might be useful but I'm working with Overleaf

Before After

(The names in the pictures are not real names)

7
  • Please make this into something self contained. We don't have that contents of those files, so cannot test your code. dvips should not be added as an option to graphicx if needed it will automatically detect it. Exactly which formats do your image exist in? There is no information about it.
    – daleif
    Commented Mar 25, 2020 at 10:13
  • Hi daleif i've tried png, eps, jpg and pdf with the same results, I'll try to update the file
    – Antonio
    Commented Mar 25, 2020 at 10:17
  • Your geometry settings for the margins are wrong. Use a package like geometry to do this correctly. Commented Mar 25, 2020 at 10:17
  • And are those images cropped correctly? you can visualise the size of the image via \fbox{\includegraphics{....}}, so my guess is that there is excessive white space in some of them. But we don't know since we cannot see your images or your code for images.
    – daleif
    Commented Mar 25, 2020 at 10:19
  • @daleif stop looking at the graphics. The problem is simply that with the correct graphicx option \pdfpagewidth is set and so one can see the wrong geometry settings. Commented Mar 25, 2020 at 10:20

1 Answer 1

1

You are setting \paperwidth to 16cm, but you are not changing the text width, so your text actually doesn't fit on the paper. When loading graphicx without any option, graphicx will also ensure that the background in the pdf viewer is set to 16cm and this gives you the impression that the text suddently shifts.

Use geometry to setup the page size instead of setting \paperwidth and \oddsidemargin etc manually:

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

\usepackage{graphicx}

\usepackage[paperwidth=16cm,paperheight=24cm,hmargin=1.6cm]{geometry}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\end{document} 
1
  • Thanks Ulrike, that was exactly the problem, after setting geometry as package and commenting \setlength everything went back to normal.
    – Antonio
    Commented Mar 25, 2020 at 10:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .