Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This seems like a trivial thing, but I can't figure out how to use input properly on Fedora. When I used Windows 7, I would put the following into my document

\input{D:/Dropbox/Code_Library/LaTeX/custom_headings_1.tex}

The file is now located at /home/[user_name]/Home/Dropbox/Code_Library/LaTeX/custom_headings_1.tex

But when I try to use input{/home/[user_name]/Home/Dropbox/Code_Library/LaTeX/custom_headings_1.tex} I get a "file not found" error.

In retrospect, since I still use Windows regularly, doing this is probably not a good idea because I won't be able to compile documents on both platforms. Can any one suggest a better file inclusion system than putting a "custom_headings_1.tex" file in every new document's folder?

share|improve this question
    
Does [user_name] have spaces? –  egreg Apr 8 '12 at 13:27
    
No, not at all. –  xiongtx Apr 8 '12 at 17:40
add comment

closed as too localized by Stefan Kottwitz Apr 8 '12 at 20:10

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 6 down vote accepted

Using the same file on Windows and on a Unix system can be accomplished by the following code

\usepackage{ifplatform}
\ifwindows
  \newcommand{\dropboxprefix}{D:/Dropbox/Code_Library/LaTeX}
\else
  \newcommand{\dropboxprefix}{/home/[user_name]/Home/Dropbox/Code_Library/LaTeX}
\fi

and then

\input{\dropboxprefix/customheadings_1.tex}

should work on both systems.

About TeX not finding the file on the GNU/Linux platform only guesses can be cast: what does the shell command

kpsewhich /home/[user_name]/Home/Dropbox/Code_Library/LaTeX/custom_headings_1.tex

answer?

Of course in all this [user_name] should be replaced by the actual user name.

share|improve this answer
2  
As it turns out, my filepath was simply wrong. It was actually /home/[user_name]/Dropbox/Code_Library/LaTeX/custom_headings_1.tex. There is no 'Home', although I could have sworn that there was. Thanks for everyone's help. –  xiongtx Apr 8 '12 at 19:40
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.