General\include{file} does not show any output in master file

General information and discussion about TeXnicCenter
Post Reply
LectorStoney
Posts: 3
Joined: Thu Dec 06, 2007 4:33 pm

\include{file} does not show any output in master file

Post by LectorStoney »

Hello folks,

I am a complete Tex novice but feel like doing quite well until now... :oops:
I am working with a master file and save all the relevant chapters as different files, which are saved in the same directory.

I use the command include, and it doesn't give any error messages but just posts No xxxx file in between after building.
In my final document I consequently don't see anything that I have written in my chapters.

The whole thing doesn't work with input because then it simply doesn't find my files.

Is there anybody out there who knows how to solve that problem and save my day?
That would be my greatest gift right now, believe me!

yours Andrea

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

\include{file} does not show any output in master file

Post by gmedina »

Without any code it's really difficult to tell what the problem is. Please post the relevant parts of your main file and one of your chapter. A minimal working example showing the undesired behaviour would be ideal.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
LectorStoney
Posts: 3
Joined: Thu Dec 06, 2007 4:33 pm

Re: \include{file} does not show any output in master file

Post by LectorStoney »

First of all, thanks for your reply!
I will do my best to give all the relevant details.
Here are the most important lines from my main file:

\documentclass[11pt,a4paper,titlepage,twoside,final]{book}
\usepackage{ngerman}
\usepackage[latin1]{inputenc}
\usepackage{float,color}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage[final]{hyperref}
\usepackage{a4}
\usepackage{makeidx}
...
\begin{document}
\include{Titelseite_0}
% I wanted to create a titlepage with picture and all. I am not quite sure whether I need to add all the relevant preambles aswell, after I've read that in here no \documentclass and \begindoc should be inserted.

\tableofcontents

\chapter{Einleitung}
\include{Einleitung_1}
% in this chapter I have only text:
Willkommen und danke dass Sie sich für eine underground\_8 Security Appliance entschieden haben....

The other chapters will include many many pictures.
Would be great to get this \include command working (I know it will just be a big fat stupidity of mine that makes it not).

Thank you for your support!
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

\include{file} does not show any output in master file

Post by gmedina »

I will give you an example of how you should proceed. I will post a minimal main .tex file (copy and save it as maintest.tex, for example) and a typical file to be included (copy and save it in the same directory as the above file as chaptone.tex) Process the maintest file and you will see the chapter one title followed by some text.

The main file will contain the preamble. All the other files that will be included don't need preamble nor the commands \begin{document} or \end{document}.

Here is the contents of the maintest.tex file:

Code: Select all

\documentclass[11pt,a4paper,titlepage,twoside,final]{book}
\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage{float,xcolor}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{makeidx}
\usepackege{blindtext}
\usepackage[final]{hyperref}

\begin{document}
\include{chaptone}
\end{document}
And now the contents of the chaptone.tex file:

Code: Select all

\chapter{The first chapter}
\Blindtext
Some remarks are in order:
1) I changed your preamble a little bit. It's better to use the babel package with the ngerman option than just the ngerman package.
2) It's better to use the xcolor package than the color package.
3) Do not use the a4 package. (you can find the reasons in this document).
4) the blindtext package was loaded only to automatically generate some text. You can delete it safely once the test has been performed.
5) It's a good practice to load the hyperref package after loading all the other packages.
6) Since you are writing in German, maybe you would prefer to use the scrbook class of the KOMA-Script bundle instead of the standard LaTeX book class.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

\include{file} does not show any output in master file

Post by localghost »

In addition to the suggestions of gmedina I recommend to change the documentclass to the classes of KOMA Script. These classes offer more options and more comfort for creating your document, especially regarding the paper format and type area. Originally they were created for German users but will also serve for others as an alternative.

When including external files, avoid characters like "_" in file names and paths. It is reserved for subscript indices in math mode. And finally, add the fontenc package for the right font encoding and as a result better hyphenation. As an alternative to inputenc you can use the selinput package from the oberdiek bundle.

Code: Select all

\documentclass[BCOR13mm,DIV15]{scrbook}
\usepackage[automark,headsepline,footsepline]{scrpage2}
\usepackake[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
	adieresis={ä},
	germandbls={ß},
	Euro={€},
}
\usepackage[ngerman]{babel}
\usepackage{float,xcolor}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{makeidx}
\usepackege{blindtext}
\usepackage{hyperref}

\begin{document}
  \include{chaptone}
\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
LectorStoney
Posts: 3
Joined: Thu Dec 06, 2007 4:33 pm

Re: \include{file} does not show any output in master file

Post by LectorStoney »

@ gmedina and localghost:

you are my heroes!

all of your suggestions are just brilliant and they work perfectly!
I would have never worked that out for myself, so thanks a million for your support!
Have a great day and keep up the good work! :)

Andrea
Post Reply