Tagged Questions

{input} is about the \input command which makes LaTeX process the content of a given file basically the same way as if it would be written instead of \input.

learn more… | top users | synonyms

12
votes
2answers
7k views

How to use the import package?

I've read about the import package and am now trying to use it in my document, but I only run into errors. I have a main file named /ProjectPath/header.tex which loads all packages, etc. ...
3
votes
2answers
491 views

Disable including of system files [duplicate]

Possible Duplicate: How can I safely compile other people's LaTeX documents? I've got a Linux server that is rendering LaTeX documents, I want to disable the access of LaTeX to system ...
1
vote
1answer
946 views

cannot scale images with latex fonts which are side by side

Referring to cannot use \caption under minipage, When I use the solution provided to the question in link above, in order to include images with latex math fonts embedded into them and place them side ...
5
votes
1answer
2k views

lstinputlisting does not include file within lstnewenvironment?

I want to use lstinputlisting to include a file with code within an lstlisting block, which is defined through a new environment. However, the lstinputlisting command itself, not the code, is ...
1
vote
1answer
5k views

How to insert one latex document into another.

This is probably online but I am not sure how to word the search. I have a long latex document, and it is getting messy editing it, is there a way to split the chapters into separate latex documents ...
4
votes
1answer
196 views

Parse a file with a regexp and return first match

I need to write a command that searches a file for a string that matches a certain regexp, and inserts that string. I know how to parse a string of text using a regex with \usepackage{l3regex} ...
6
votes
4answers
2k views

How to make “\input” in a “\include”-d file use the correct current path?

I'm having a master file let's say test.tex and also some folders sub1/ and sub2/. There is also a TeX file in each of them: sub1/sub1.tex and sub2/sub2.tex. In the sub1/ and sub2/ are also some ...
7
votes
1answer
152 views

How can I prevent a new paragraph between two \input commands?

I want to use the command \input{} to insert two textfiles, text1.tex and text2.tex, into my latex working file. I want these two textfiles to produce one single paragraph when I am compiling my ...
6
votes
1answer
559 views

How to use “input” on Linux (Fedora 16)? [closed]

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 ...
15
votes
3answers
2k views

Expandable version of \InputIfFileExists or \IfFileExists

From this question: Cannot use \toprule when doing \input inside tabular -- why? I know that everything inside the tabular environment should better be expandable. The MWE below suggests that ...
2
votes
1answer
984 views

Including TikZ image (with external inputs) inside adjustbox adds horisontal spacing, why?

I'm working on my masters thesis and so I have a bunch of tikz files that I want to include in the thesis. This I do by using adjustbox to limit the size to \textwidth as such \adjustbox{max ...
8
votes
2answers
2k views

Cannot use \toprule when doing \input inside tabular — why?

Using \input inside a tabular environment does not seem to work in all cases, but I don't see why. The MWE below gives the following error message: ! Misplaced \noalign. \toprule ->\noalign ...
13
votes
3answers
473 views

Need help creating a custom aux file read/write routine to suit my needs

I require two new commands, \createreference and \citereference, to work with. They should work as shown in the following examples: \createreference{john}{John Q. Citizen} should write the text “John ...
4
votes
1answer
380 views

Add offset to line number (in error message) when using input files

I am compiling a latex document, and when I have errors, I get nice messages like l.1041 \end{frame} which tells me that there is an error somewhere before line 1041. So far, so good. I can use my ...
4
votes
1answer
2k views

inputenc error with unicode chars and verbatim

I am writing a package where I need to save the contents of several environments in verbatim mode to an auxiliary file. Then the auxiliary file is processed by an external program. In the next ...
1
vote
0answers
156 views

Splitting a big document into several output PDF files [duplicate]

Possible Duplicate: Keep chapter number of chapters inserted with \include Can one TeX file output to multiple PDF files? My document structure has: 1 file with preface; 12 individual ...
2
votes
1answer
2k views

Using \newcommand and \input

I like to use variables for my paths, so that if I migrate to another system/username, I don't have to change every path name. This does not seem to be working with the input command. I have the ...
14
votes
1answer
551 views

Why is \input not expandable?

In latex.ltx I found \def\input{\@ifnextchar\bgroup\@iinput\@@input} where \@@inputis expandable. I would like to know if there is an expandable version of \input. The problem comes from an example ...
4
votes
1answer
1k views

Including a text file in LaTeX

I write a program by DevC++ compiler and save it by .cpp format, and want to paste the code in my editor, Do I have to paste all the code each time? Is there a way to include the file instead of ...
4
votes
1answer
532 views

remove unwanted contents from list of listings

The following code adds a wrong line to the list of listings \documentclass{scrbook} \usepackage{listings} \usepackage{filecontents} \begin{document} \begin{filecontents*}{democodefile} ...
7
votes
1answer
324 views

Typesetting multiple TeX files

Q1. Is there an existing template with the following features: (1) Multiple files, which I can typeset individually (as and when necessary). (2) A single .bib file from which I can cite in ...
10
votes
2answers
516 views

randomize the order of text lines in a .tex file

I need to create an environment (let's call it randomizer) that randomly changes the order of its lines, which may contain any text or latex commands (assume without verifying that they don't break ...
6
votes
1answer
733 views

\input only part of a file using catchfilebetweentags package

I would like to include only a part of a .tex file into a different .tex file. The part I want to include is delimited by some comment tags, as it is used by catchfilebetweentags package. I tried the ...
4
votes
4answers
6k views

how to use \input{file.tex} correctly?

Suppose I have two latex files file1 and file2 with the same preamble and so on. Then I want to create a file called bigfile which just puts the two files together. This is not working for some ...
1
vote
1answer
553 views

“Missing $ inserted” in included .tex file via \input

I've included a .tex file by using \input macro, but the problem comes when I use special characters (because I'm writing in Spanish, I use á, é, and characters like that). I can use those caracters ...
4
votes
1answer
6k views

input files in different directories

I have following example directory structure. ArticlesWritten - ArticleA - - FileOnlyInArticleA.tex - - Introduction.tex - - main.tex - - MainAsChapter.tex - - ...
5
votes
1answer
2k views

Including all files within a directory [duplicate]

Possible Duplicate: How to iterate through the name of files in a folder Using \input{filename}, I can input a file canned "filename.tex". I have a directory containing all of the files I ...
0
votes
1answer
386 views

Preprocess LaTeX file, a latex -E equivalent [duplicate]

Possible Duplicate: Replace \input{fileX} by the content of fileX automatically I'm developping a framework for managing LaTeX project's dependencies but I can't figure out if there is a ...
8
votes
4answers
236 views

Checking for a matching entry within a file

I have a file containing a list, like this: apple orange pear pineapple How can I create a macro which checks if an item is on that list. E.g.: \isfruit{pear} returns "1". \isfruit{carrot} ...
8
votes
1answer
217 views

Can I amend the preamble from outside the preamble?

I am writing a document (mydoc.tex) that will include a section as a separate document (mysection.tex) using \input{mysection.tex}. If I want to include something in the preamble (specifically ...
4
votes
2answers
675 views

how do I use the \input command on windows, combined with \IfFileExists?

I'm trying to use a command in my LaTeX file that inputs a file if it exists, and if it doesn't exit, inputs another one. This is the command: ...
5
votes
1answer
613 views

Creating a common settings file

I have created a file which provides convenient options to change the settings for all of my documents. For e.g.: \def\BookFontRoman{Gentium Plus} \def\BookFontCJK{Adobe Song Std} \def\PageWidth{280} ...
7
votes
3answers
1k views

How to make nonstopmode really not stop on a missing input file

I have a file test.tex with these contents: \input{missing} \input{present} When I run PDFLaTeX with --interaction=nonstopmode it stops after the first missing input file: $ pdflatex ...
7
votes
2answers
1k views

Avoid warnings in TeXlipse

I'm using TeXlipse, an Eclipse plugin, to create my TeX documents. To structure my files I use \input{filename}. Now the problem is, that every file is one section or subsection. TeXlipse shows me a ...
4
votes
4answers
1k views

Import LaTeX File into a Template?

I have the following Task todo: I have made me a default structure for lecture notes and now I want to compile my notes into separate PDFs for learning. So my goal is to have for every course a ...
4
votes
1answer
1k views

Split table into multiple files with \input

I want to split my table into multiple files: \input{table_head.tex} with following content \begin{table}[htpb] \centering \caption{Caption} \begin{tabular}[r]{ccc} \addlinespace \toprule A & B ...
1
vote
1answer
145 views

Is that a bug between `xymatrix`, the `input` command and .sty file?

I have a problem compiling the following document. First, I have a file macros.sty that consists of : \newcommand{\test}{ \xymatrix@R=0mm{x} } Then, I have an auxiliary file out.aux that consists ...
3
votes
2answers
547 views

Linewidth resets when using input files

I'm trying to set some figure files in standalone .tex files, and then input them in the main file. Those files looks something like this \ifx \plotwidth \undefined \newlength{\plotwidth} ...
6
votes
1answer
456 views

Get {standalone} to ignore blocks of text from \input files (e.g., \begin{spacing} and \maketitle)

I've got a number of separate .tex files that are all \documentclass{article}. I'm inputting these into a \documentclass{book} file as chapters. In the book.tex file, then, I've got inputs like this: ...
12
votes
2answers
2k views

Splitting a large document into several files

Why is it recommended to split a large document into several parts and include them with \include? Is it only a relic of the past times when computers and LaTeX compilers were slower, or is it still ...
7
votes
1answer
2k views

\input{…} is ignored with beamer option ignorenonframetext

I'm using beamer to create my slides and wanted to use beamerarticle to create written paper which is not just printed slides 3 on 1 page. The option ignorenonframetext for the beamer class forces it ...
1
vote
1answer
221 views

Adding new parameter in lyx

In texmaker, I create document_setting.tex for input some document attribution like the author, publisher, some attribution in acknowledgements. And then input document_setting in master document ...
4
votes
2answers
3k views

How to prevent a \lstinputlisting being split across pages?

This question shows how to prevent a long listing from being split across several pages when the code is written directly into the tex file. I want to achieve the same effect when including code in ...
7
votes
1answer
329 views

How could I use \input within soul arguments?

So, I basically want to do something like this: \documentclass{article} \usepackage{soul} \begin{document} \so{Hello} \so{\input{key.tex}} \end{document} Now the first "so" works but the second ...
4
votes
2answers
173 views

Can a file know if it has been \include'ed or \input'ed?

I have a somewhat large User's Guide for a code I've been working on with collaborators. Each chapter is in a subdirectory of the top directory, which includes the .tex file that grabs and stitches ...
12
votes
2answers
918 views

How to avoid automatic .tex extension in filenames?

I am in an mildly unfortunate situation in which, because of the way I prepared the files automatically, I ended up with a file to be attached but also another file with the same name but ending in ...
8
votes
4answers
1k views

How to write a command to file

I am trying to write to a auxillary file using \newwrite\tempfile [...] \immediate\openout\tempfile=list.tex \immediate\write\tempfile{Text to write to file} \immediate\closeout\tempfile It works ...
6
votes
3answers
274 views

Is there a way to load additional packages specified in the document environment?

It seems strange but I really need this. Is there a built-in macro to load additional packages specified in the document environment? % main.tex \documentclass{article} \begin{document} ...
15
votes
3answers
2k views

Create list of all external files used by master LaTeX document?

Is there an easy way to create a list of all external files (complete path) which are used by a LaTeX document (and its "sub-documents") by \input \include \includegraphics ? (may I have forgotten ...
0
votes
1answer
709 views

How to fix the location of tables when they're imported with \input? [duplicate]

Possible Duplicate: Keeping tables/figures close to where they are mentioned I'm using MiKTeX and TexMaker 2.2.2. Using the latabstat command in Stata I create small tex files of some ...