大家好,我想在我的作品中加入图片,这是我的设置:
\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}
我阅读了关于这个主题的所有先前的帖子,并尝试了所有方法,唯一似乎有效的方法是从 graphicx 中删除 dvips,问题是,只要我删除 dvips,图像就会重新出现,但所有文本都会向右移动,并且无法正确阅读。
我不知道是否有用,但我正在使用 Overleaf
(图中姓名非真实姓名)
答案1
您设置\paperwidth
为 16cm,但您没有更改文本宽度,因此您的文本实际上并不适合纸张。当加载 graphicx 时不带任何选项,graphicx 还将确保 pdf 查看器中的背景设置为 16cm,这会给您留下文本突然移动的印象。
使用几何来设置页面大小,而不是手动设置\paperwidth
等\oddsidemargin
:
\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}