# Include .tex file from texmf folder

Suppose I have the following files in texmf/tex/latex/

• myclass.cls
• mystyle.sty
• mydoc.tex

What I would like to do is

% file.tex
\documentclass{myclass}
\usepackage{mystyle}
\begin{document}
\input{mydoc}
\end{document}


mydoc.tex contains code to be used after \begindocument (specifically a title page).

• If I put mydoc.tex in the same folder as file.tex this works fine
• If I put mydoc.tex in a different folder (i.e. texmf) this doesn't work

I don't want to always copy mydoc.tex to the same folder as file.tex.

• I'm looking for a simple way include the code from mydoc.tex in file.tex after \begin{document}. I'm not aware of how this is possible using .cls or .sty files

Edit

This is more of a misunderstanding of how Miktex works. I assumed that since I had added the texmf folder to Miktex that when I added new files into the texmf folder, these files would automatically be recognized. However, Miktex only knows about the files in the texmf folder at the time in which the texmf folder was added to Miktex.

• Put mydoc.tex beside myclass.cls and update the file name database. – Ulrike Fischer Aug 1 '15 at 16:46

In think it's not a good idea to mix configuration .cls, .sty files with .tex.

One can declare special folders (at least one) to put .tex files that will be accessible from every where with relative path to this directory.

One can use special environment variable \$TEXINPUTS ; usually it's set to :./,I add to mine a path to a directory with all my exercices : :./:/home/nico/Documents/Maths/Base_Exos/.

This directory contains a subdirectory for each class level, then one per chapter, then one per exercice with its correction and faculative pictures or else.

Then to use a specific exercice in what ever document, I just do :

\input{4eme/Pythagore/exo-003/texte}

By this way you can use your first methode, including several of those files and adding some contextual text in between and last but not least, no need for database updates.