#Latex Nested folder with Subfiles package


I got a handy and pretty solution to deal with a nested files issue while I am using subfiles package. I am a fan of subfiles because we can compile and see a latex file without involving the main latex file.

suppose that, we have a latex project:
main.tex
-chapter1
–chapter1.tex
-figures
–chapter1
—figure.jpg

then we should write the main.tex and chapter1.tex as follows:

main.tex:
\usepackage{graphicx, epsfig}
\usepackage{graphics}
\usepackage{subfiles}
\begin{document}
\newcommand{\main}{.}
\subfile{chapter1/chapter1.tex}
\end{document}

chapter1.tex
\documentclass[../main.tex]{subfiles}
\providecommand{\main}{..}
\begin{document}
\includegraphics[width=0.6\textwidth]{\main/figures/chapter1/figure.jpg}
{document}

  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s