{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

5
votes
1answer
821 views

Jobname of inputted file?

\begin{filecontents}{foo.tex} \def\foo{\jobname} \end{filecontents} \documentclass{article} \begin{document} \input{foo} \foo \end{document} This outputs the jobname of the main file not "foo". How ...
5
votes
1answer
633 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} ...
5
votes
1answer
57 views

How to include files from a directory specified by a concatenation of text and a macro?

This is almost certainly a silly mistake somewhere. I'm essentially trying to do what is being done here. My MWE project: $ find ./ ./ ./common ./common/preambleCommon.tex ./mydoc ./mydoc/mydoc.tex ...
5
votes
1answer
28 views

Selectively apply \global to some tokens set via an \input file

This should be simple, but I can't quite guess the correct combination of \expandafter needed. The value of \MyTokenGlobal should not be changed via the \input, but the value of \MyTokenLocal should ...
5
votes
1answer
528 views

Iterating over files in a directory and including them

I have a folder called diary which contains a series of files: 20120101.tex 20120105.tex 20120304.tex etc. How can I create a single LaTeX document that includes each of these files, in ...
5
votes
1answer
660 views

What happens to a relative path in a file added with \input{}?

I stumbled upon the following question: In the preamble of my main tex file for my thesis, I've included several other files with definitions for abbreviations which are in the same path as main.tex, ...
5
votes
3answers
65 views

How can I get pgf's foreach to iterate over the contents of an input file

I would like to write something like: \foreach \myline in {\input{filehandle}} {\dosomethingwith\myline} If I have an outside_file.tex: this, is, the content, of, a file and then try to pass it ...
5
votes
1answer
98 views

Mark on document where input starts and what is the filename

I have a master document, and use many input{...} commands to compile the total document from many parts. I would like to mark on the working document, the start of each new input, and, what the ...
5
votes
1answer
244 views

inputting a file not from a subdirectory

I apologise if this question has already been addressed. Say I have a set up like this: I have a main folder in which I have both preamble.tex and a folder sub_1. In sub_1, there is another folder ...
5
votes
1answer
70 views

Hook into \input (or any underlying command) in order to allow transparent preprocessing

Which command would be most suitable to be hooked in order to preprocess input before it is passed to TeX? Input file: \begin{document} \input{a} \end{document} Seen by TeX (after a file ...
5
votes
1answer
169 views

Saving in macros plus \scantokens as an alternative to external files

I am generating a lot of TeX code automatically using Python scripts. I've been saving the TeX code to file, and then bringing those files into my documents at the appropriate places via \input. ...
5
votes
1answer
2k views

Supertabular problem with \input

Consider a simple supertabular example: \documentclass{article} \usepackage{supertabular} \begin{document} \begin{supertabular} a & b \\ \end{supertabular} \end{document} Suppose I wanted to ...
5
votes
2answers
117 views

parallel or other parallel text - paragraph alignment feeding from input files

I am scratching my head trying to sort out an issue with parallel text (in a bilingual document). So first off I have seen many examples on stackexchange regarding this problem but not quite the ...
5
votes
2answers
197 views

How can I use `catchfile` package to gobble first characters on a line

When using the fancyvrb environment Verbatim, you can gobble the first n characters of each line before printing it out. I'd like to be able to do something similar, but not via verbatim. In the ...
5
votes
0answers
265 views

Plots from externalized TikZ are rotated [closed]

I just found out about tikzexternalize and I love it - well, almost. This is my situation: I have done simulations in Matlab and used matlab2tikz to get the plots from Matlab into my .tex document. ...
4
votes
4answers
7k 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 ...
4
votes
2answers
220 views

Is there a quick way to split a (very) long equation?

I'm generating LaTeX code from Mathematica, which I must insert into my input .tex file. The problem is that equations are too long to fit on the page, and it takes a long time to split them up. Is ...
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
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
3answers
402 views

Can i automatically load chapters and sections based on the filesystem?

I was interested in knowing if i can load chapters and sections of my book based on the filesystem. For example: Chapter 1/ Section 1.tex Section 2.tex Section 3.tex Chapter 2/ Section 1.tex ...
4
votes
3answers
208 views

How to merge several tex files so that they have one table of contents/List of tables & figures

I have three chapters which I combine into a thesis using pdfpages: as shown in this link Merging several papers This gets me 95% of what I need the only thing I still need is a table of contents ...
4
votes
2answers
183 views

Saving language preferences for inputing source code

Using the listings package, I am trying to input a Java source file into my document using a specified, user-defined style. This works just fine if I have the specified style definition in the same ...
4
votes
2answers
697 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: ...
4
votes
2answers
84 views

Search for files first in the texmf trees

If I want to check first if a file is in the current dir and then look for it in the texmf tree I can do it like this: \documentclass{article} \begin{document} \IfFileExists{./biblatex.def} {yes, ...
4
votes
1answer
540 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} ...
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 ...
4
votes
2answers
78 views

Using \input{} inside caption

I am wondering why I am getting errors when I try to add a caption to table using the \input command. A minimal example is as follows. The file cap2test.tex can be any text file. E.g., mine contains ...
4
votes
3answers
152 views

How to work with command \input{filename.tex}?

I'm writing a book with lots of chapters using a command \input{filename.tex} for each chapter in the book book.tex. How to make it not to have book.tex and all filename.tex in the same directory? Is ...
4
votes
1answer
102 views

Why does this Tikz tower look OK standalone but not when included as a figure in article?

I built two towers in Tikz. Because the document they will be included in takes a while to compile and because my Tikz skills are somewhat limited (so I need to compile often to check if I've done ...
4
votes
2answers
88 views

Why does \ExecuteMetaData break my paragraphs?

I have a lot of content to assemble in several different ways and would like to use excerpts from one file in another. I have specified: \usepackage{catchfilebetweentags} I then have an external ...
4
votes
1answer
231 views

Is this the correct way to format a book in LaTeX?

I have a question that may be subjective but I will try to make it as less subjective as possible. Is this the correct way to format a book in LaTeX? What I have done is the following: ...
4
votes
1answer
347 views

Include one TeX file into another

I have main.tex file with: \documentclass[]{report} \begin{document} \input{filename.tex} \end{document} Let say filename.tex have the following content: \begin{abstract} text \end{abstract} ...
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 ...
4
votes
2answers
41 views

list processing for file to input

i would like to create a 'list' of file names at arbitrary points in a document and use that list in the appendix to load these files. i understand that there's a generalized concept of a list in TeX ...
4
votes
1answer
77 views

How to make LyX process TeX code without converting it into .lyx format?

When I do \input{file} in a .tex document I later import in LyX, LyX converts file.tex into file.lyx and changes \input{file} to \input{file.lyx}. But LyX doesn't do well with the TeX code it does not ...
4
votes
2answers
3k views

Blank pages after \include in LaTeX report class

I'm writing my thesis as several separate chapters and incorporating them into one .tex file. Some of the chapters are pdfs of articles, and they are simply added to my master.tex using \input. ...
4
votes
1answer
207 views

Using a non-centralized structure for tex files - similar to \graphicspath

I have a fairly large document, that I have picked apart into different sections etc, each in their own file. To include graphics that are not in one central directory I use \graphicspath which works ...
4
votes
1answer
85 views

Inserting a document with its own internal section numbering in another document

I have a fairly large LaTeX document, with several chapters. In one chapter, I intend to insert another LaTeX document. "In the following pages, we include (DOCUMENT) ..." I could use \includepdf, ...
4
votes
1answer
198 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} ...
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 - - ...
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 ...
4
votes
1answer
11k views

input index file not found

Dear experts I am using TeXnicCentre. After compiling, while I get an output pdf file, an error is found that says Could't find input index file *pathname* nor *pathname*.idx I am afraid I cant ...
4
votes
1answer
116 views

Can I pass LaTeX commands to latexmk instead of a filename?

This is a follow-up to How can I automate the workflow for producing multiple versions of a document? Here is toy example of my problem. I want to automate the generation of two slightly different ...
4
votes
1answer
116 views

catchfile(betweentags) and obeylines

I'm writing two large documents, both containing much of the same text. To ease the maintenance, I'd like no redundant paragraphs, but rather to use catchfilebetweentags. Everything works well, ...
4
votes
1answer
383 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

Generate a merged LaTeX file, with \input code in place?

I'm currently working on an experiment that involves re-typesetting a digitized physical book from OCRed images. For various reasons involving the workflow, the resulting project architecture is a ...
4
votes
1answer
416 views

Parse \input statements in AucTeX, TeX-insert-quote

AucTeX recognizes for example the statement \usepackage[german]{babel} in a .tex file. Then typing " twice will result in "` before a word resp. "' after a word. However if ...
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 ...
4
votes
1answer
23 views

Combining collcell with input

The following code works perfectly: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{collcell} %The min, mid and max values \newcommand*{\MinNumber}{0.0}% \newcommand*{\MidNumber}{0.5} % ...
4
votes
1answer
83 views

How to automate introduction of section titles in book

I'm using Spundun's method for automating inputing the entries in a diary, in turn inspired by Peter Grill (Using LaTeX to keep a diary), and I would like to add section dividers by year. This should ...