使用来自不同目录的图形创建多文件项目

使用来自不同目录的图形创建多文件项目

我正在尝试设置一个多文件文档,用于\input将不同的 .tex 文件添加到我的主文档中。每个 .tex 文件都在其自己的目录/文件夹中。还有一个单独的图形目录。当我编译其中一个包含图形的 .tex 文件(称为“方法”)时,图像会按预期加载。

但是,当我将此文件添加到主文档并进行编译时,图像丢失,并收到以下错误消息:

未找到文件“Testimage”。...ludegraphics[width=1\textwidth]{Testimage}

我能得到一些建议吗?

我已经包含了以下 MWE:

主要文件

\documentclass[12pt,a4paper]{report}
\usepackage{graphicx}
% put all the other packages here:

\usepackage{My_style_package}
\usepackage{hyperref} 
\begin{document}
%TITLE PAGE AND ABSTRACT
    \input{./Title_and_abstract/Title_and_abstract.tex}
    %\tableofcontents
    %\listoffigures
    %\listoftables
    \input{./Intro/Introduction_v0.1.tex}

    \input{./Methods/Methods.tex}
%\maketitle


%\input{./tex/intro.tex}
%\input{./tex/main_part.tex}
%\input{./tex/conclusions.tex}

%\appendix
%\input{./tex/myappendix.tex}


% Bibliography:
%\clearpage
%\input{./tex/mybibliography.tex}

\end{document}

我的风格包- 包含来自各个 .tex 文件的所有前言。

\ProvidesPackage{mystyle}
\usepackage{color}
\usepackage{graphicx, epstopdf}
\usepackage{etoolbox}%This package combined with the \pathcmd rewrites the standard style for 'Chapter' to allow the fancy horizontal and vertical lines. 
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{mystyle}}{}{}
\graphicspath{{"C:/Users/User/Documents/LaTex_issues/Test_for_linking_docs_from_differrent_folders/Visuals"}}
\usepackage{gensymb}
\usepackage{times}
\usepackage{adjustbox}
\usepackage{tabulary}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{booktabs,caption, makecell}
\usepackage{pdflscape,afterpage,caption}
\usepackage[british]{babel}
\usepackage[backend=bibtex, citestyle=ieee, bibstyle=ieee]{biblatex}
\usepackage[section]{placeins}%Allows you to permanently fix figures. 
\addbibresource{library}
\usepackage{titleps}%fancy page borders? 
\usepackage[left=2.8cm, right=2.8cm, top=3.5cm, bottom=3.5cm]{geometry}
%\usepackage{caption}
\captionsetup[figure]{font=scriptsize,labelfont=scriptsize}
\usepackage{microtype}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{datetime}
\newdate{date}{28}{02}{2018}
\date{\displaydate{date}}
\onehalfspacing

    \sloppy%Makes sure that none of the text exceeds text width. Useful if have long chemical words. 

\newpagestyle{mystyle}{%
    \widenhead[\marginparwidth][0pt]{0pt}{\marginparwidth}
    \headrule
    \sethead[~\color{black}\enspace][][]{}{}{\color{black}\enspace}
    \setfoot[{\makebox[\marginparwidth][r]{\thepage~}\smash{\rule[-20ex]{0.6pt}{22ex}}}][][]{}{}{\smash{\rule[-20ex]{0.6pt}{22ex}}\makebox[\marginparwidth][l]{~\thepage}
    }
}%This part creates the fancy top (horizontal) and bottom (verticle) lines that you see from the 'Abstrct' page onwards. 

方法 .tex 文件- 包含图像。

\chapter{Methods}
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
To make your document look professionally produced, Word provides header, footer, cover page, and text box designs that complement each other. For example, you can add a matching cover page, header, and sidebar. Click Insert and then choose the elements you want from the different galleries.
Themes and styles also help keep your document coordinated. When you click Design and choose a new Theme, the pictures, charts, and SmartArt graphics change to match your new theme. When you apply styles, your headings change to match the new theme.
Save time in Word with new buttons that show up where you need them. To change the way a picture fits in your document, click it and a button for layout options appears next to it. When you work on a table, click where you want to add a row or a column, and then click the plus sign.
Reading is easier, too, in the new Reading view. You can collapse parts of the document and focus on the text you want. If you need to stop reading before you reach the end, Word remembers where you left off - even on another device.

\begin{figure}[h!]
    \centering
    \includegraphics[width=1\textwidth]{Testimage}%Since we have identified the graohic location we just need the file name. 
    \caption{Test image}
\end{figure}

提前致谢。

相关内容