General\input{} command

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
cbergfjord
Posts: 5
Joined: Wed Dec 03, 2008 12:52 am

\input{} command

Post by cbergfjord »

Hi all,

I have a question concerning the \input{} command.

When I wish to include a subfile, called example.tex in my main file, and the subfile looks something like this,
%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Example}
Text..........
\subsection{Another example}
Text.....
%%%%%%%%%%%%%%%%%%%%%%%%%

and I have defined how I want my section headers and subsection headers to look, in the preamble. Why does the \input{} seem to override the preamble?
What I mean is that the \section{} in the main file, yields one result, while \section{} in the subfile yields another result?
How can I work around this problem?

Any help would be highly appreciated.

Cheers,
Christian

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

\input{} command

Post by gmedina »

Hi,

we need to see how exactly did you made those modifications. Please provide a minimal working example showing the undesired behaviour.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
cbergfjord
Posts: 5
Joined: Wed Dec 03, 2008 12:52 am

Re: \input{} command

Post by cbergfjord »

Hi again,

Of course. I have attached a *.zip file with the files I am using.
I use a template created by another person, and all the declarations are defined in the cls-file.
When I write \input{test.tex} in the sample3.tex file, and compile it, you can see the result in section 1.2 where the header occurs larger than the other section headers.

I realize that it is a bit problematic when I haven´t written the code myself, but I want to know why it does not work. I´m wondering if the \input command overrides the declarations in the cls-file, and if I was to write the code myself, I will get the same problem.

Cheers
Chrisitan
Attachments
test.zip
(98.75 KiB) Downloaded 155 times
cbergfjord
Posts: 5
Joined: Wed Dec 03, 2008 12:52 am

Re: \input{} command

Post by cbergfjord »

Hi again,

Sorry that the code is not a minimal working sample. I just realized that it is a bit big.
I don´t have any smaler however, and I don´t know enough to make it smaler I´m afraid.
Hope someone can help however :)

Cheers
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

\input{} command

Post by T3. »

You use \Section commands in your document (note capital S) and \section in your inputed file. TeX command names are case sensitive, so these are two different commands. The first one is not a standard LaTeX command so it must be defined somewhere in your document or in the class you use (note that the standard \section command could also be redefined somewhere).

Cheers,

Tomek
cbergfjord
Posts: 5
Joined: Wed Dec 03, 2008 12:52 am

Re: \input{} command

Post by cbergfjord »

Hi,

Thank you. I will check if this affects anything.

Cheers
cbergfjord
Posts: 5
Joined: Wed Dec 03, 2008 12:52 am

Re: \input{} command

Post by cbergfjord »

Hi agin,

Just tested it, and it works :) Been so used to type \section{}, so I overlooked the \Section{} completely. Thank you for the help

Cheers,

Christian
Post Reply