Questions tagged [external-files]

{external-files} is about external files included in a document, e.g., pictures via \includegraphics, or parts of a document via \input or \include. For questions about files automatically generated by LaTeX (.aux, .log, .out, .toc, ...) use {auxiliary-files}.

Filter by
Sorted by
Tagged with
0 votes
1 answer
55 views

Import a picture in LaTeX? [duplicate]

I just started writing in LaTeX. I want to import a picture but failing. The picture is .png format.
  • 39
0 votes
1 answer
43 views

\input function doesn't work: trying to include contents of external text file

I want to include the contents of an external text file into my LaTeX document. I've tried \input{./message}, but all I get is an error containing the very last line of the text file: (./message.txt ! ...
  • 247
1 vote
2 answers
84 views

"! Undefined control sequence." when I use "\def"

Here is a MWE: \documentclass{extbook} \usepackage{xspace} \usepackage{xstring} \usepackage{ifthen} \newcommand\foo[1]{% \def\tempfoo{#1}% #1% } \newcommand\separation[1]{% [\the\numexpr #1\relax ]%...
5 votes
1 answer
216 views

How do I persuade (La)TeX(3) to read a file character by character?

I'm doing the Advent of Code (2022) in LaTeX3 (no, really I am). Each challenge involves some input, which for Day 6 consists of a single line which is very long (4096 characters). This line needs ...
0 votes
0 answers
22 views

Convert a .tex file to PDF before importing it in the document

How can I compile a .tex file as a PDF before importing it into the document? This is related to my previous question, as it could be a possible solution to that question. However, this question is ...
  • 1,700
3 votes
3 answers
244 views

Struggling to Implement FileSystem Based Includes

I'm trying to follow along with this answer to automagically include files based on the filesystem hierarchy. My file structure looks like: article.tex sections/ |-- 00-introductions.tex |-- 10-data....
0 votes
0 answers
40 views

How to include Charis SIL small caps in a .fontspec file?

I have the following CharisSIL.fontspec file in $HOME/texmf/tex/latex: \defaultfontfeatures[CharisSIL] { Path = /path-to-texlive/texlive/2022/texmf-dist/fonts/truetype/SIL/charissil/, Extension =...
  • 2,936
3 votes
1 answer
76 views

Read and process file content line by line with expl3

In a multi-file project organized as: mainfile.tex subfile1/subfile1.tex subfile2/subfile2.tex ... in order to make every subfile compilable on its own and make possible of referencing between ...
  • 7,380
0 votes
0 answers
21 views

Why \read adds extra space to the end of content? [duplicate]

I have file foo.txt with a single byte inside: x. Here is my code: \documentclass{article} \begin{document} \newread\foo \immediate\openin\foo=foo.txt \read\foo to \content \immediate\closein\foo \...
  • 11.1k
0 votes
1 answer
41 views

Is it possible to get the value of --output-directory programmatically from LaTeX code? [duplicate]

I'm trying to save a file first, using \VerbatimOut. Then, I'm using this file in \ShellEscape, where I need to know its absolute path name. Everything works well, until --output-directory is changed ...
  • 11.1k
1 vote
2 answers
60 views

Is it possible to \typeout the content of a file?

I'm trying to do something like this (\read is a pseudo command): \typeout{The content of the file a.tex is: \read{a.tex}} Is it at all possible?
  • 11.1k
0 votes
1 answer
90 views

Accurately display pixel image from data

I am working in image de-noising and therefore want to display an image as accurately as possible (e.g. before and after de-noising). I have my grayscale image represented in a file with 256^2 = 65536 ...
  • 153
0 votes
0 answers
20 views

Only print entries from a specific bib file [duplicate]

Using biblatex and biber, I’m editing a journal with 10+ articles per issue. Articles are added as such: \input{article1.tex} \addbibresource{bib-article1.bib} \input{article2.tex} \addbibresource{bib-...
  • 1,543
2 votes
0 answers
125 views

Reduce file size of imported graphics and their fonts

I am looking to reduce the file size of the final version of my thesis as much as possible without real hassle and any loss of quality. At the moment it is around 7 MB. I read much about it (...
  • 21
0 votes
0 answers
33 views

How to check if different file path refer to the same file

A file may be accessed by different paths. For example, - subpath/myfile.tex - ./subpath/myfile.tex - ../current path/subpath/myfile.tex, - /d/.../current path/subpath/myfile.tex They refer to ...
  • 2,667
0 votes
1 answer
121 views

How to obtain absolute path of a file

Many languages provide functions to obtain the absolute path of a file. I wonder if Tex/LaTex has also such macros. In the following example, given a file name, test if this file really exists. Then, ...
  • 2,667
0 votes
1 answer
51 views

Wrong file location by \IfFileExists

The following code is the content of my main.tex. The file a.tex is in the subdirectory tmp under the directory where main.tex is, that is to say: ./main.tex and ./tmp/a.tex. The problem of my code is:...
  • 2,667
0 votes
1 answer
86 views

How to test if files have been input before by \input

I wonder if there are methods to test if a file(or files) has been input by \input before to avoid multiple inputting which may cause LaTeX Error: Command ... already defined. Example \...
  • 2,667
0 votes
1 answer
130 views

Loop through directory structure and include all *.pdf files

I have a document that is constructed from a number of *.tex files stored in a directory organized as follows: -2022 -07 -01 -note.tex -file1.pdf -differentfilename....
2 votes
0 answers
636 views

BibLaTeX - addbibresource not working

I am using a self-hosted instance of Overleaf/ShareLaTeX, and I cannot get BibLaTeX to work. My preamble looks like this: \documentclass{report} \usepackage[utf8]{inputenc} \usepackage[margin=1in]{...
  • 247
0 votes
0 answers
78 views

Including a file with absolute path

I have a python script which compiles a tex file on my D drive. I would like to include a data file into my tex file. This data file is located on the following directory on Windows: \\filesrv\xxx-sc\...
0 votes
0 answers
40 views

How to input multi parts of a file

I have a .tex document(external.tex, for example) whose content is like this: ... ... %*#<start> some code %*#<end> ... ... %*#<start> some other code %*#<end> ... ... I want ...
  • 2,667
1 vote
2 answers
146 views

How can I read the whole file content verbatim into a (expl3) string variable?

Problem Description As in the title. MWE: \documentclass{article} \begin{document} % first write some file content for demo... \begin{filecontents*}{test test.txt} line 1 !?#\xyz line 2 \end{...
  • 4,981
0 votes
1 answer
53 views

Write lines to file in expl3 [duplicate]

Common programming languages (PL), e.g. Python allow append lines to opened file like file_object = open('sample.txt', 'a'). How it is possible to do in expl3 PL? My MWE adds only last argument of \...
  • 5,296
0 votes
0 answers
71 views

\filecontents worked once but always with error messages. What should I do?

I get error messages that don't make sense running code which I've adapted from https://ftp.acc.umu.se/mirror/CTAN/graphics/circuit_macros/doc/Circuit_macros.pdf. I've rewritten the code with the ...
0 votes
0 answers
23 views

Input file filder - doesn't load graphics in multi file project

I suffer from the same problem as in thread Input file folder I tried the suggestions, so far with no different result. The last answer I tried. Just to clarify, are you giving the path names where ...
  • 1
0 votes
1 answer
167 views

Framework for interactive graphics in LaTeX documents

I've written a prototype LaTeX package and associated viewing framework to allow LaTeX documents to be viewed in an environment that allows for interaction with figures. The figure might have points ...
0 votes
1 answer
31 views

Using answers package in macros

I am compiling a set of problems for my students with hints, and using the answers package for that. The goal would be to have the problems and hints grouped by exercise session, but still within the ...
  • 209
0 votes
0 answers
68 views

Latex No Files found

I do not know what happened. I tried everything I found on line. The problem is as follows: If I include \addbibresource{example.bib}, Latex stops recognizing any files. It doesn't matter what is in ...
  • 1
3 votes
1 answer
278 views

How to Avoid Fontspec When Invoking an External Font

I have recently downloaded a font from https://www.dafont.com, which, when I call it into my document, requires the fontspec package and compilation with lualatex. This has caused several problems, ...
  • 7,272
1 vote
1 answer
79 views

How Might I Use This External Font with Pdflatex?

This post adds another dimension to the question posed in Trying to Imitate an Archaic Gothic Font within a Document Compiled with Pdflatex. There are other fonts outside of TexLive that seem to ...
  • 7,272
0 votes
0 answers
19 views

Error when trying to input an external file with xltabular package `\hline ->\noalign` [duplicate]

I am trying to stack several tables one on another. For this I am using xltabular packages. I want to input text from another file. The following code works without problem when removing / commenting ...
  • 801
2 votes
1 answer
149 views

Compile on a per-chapter basis, from within subfile

My current project has many chapters, which are included via \input{chapters/chapter1.tex} from the main document. (The actual setup is a little more complex, but close enough.) When I am editing ...
  • 6,035
0 votes
1 answer
67 views

Append content to a file containing sharp

In my library, I need to be able to append some text to a file. The problem is that that file may contain the # symbol, and it turns out that every time I append something to a file containing a #, ...
  • 5,507
3 votes
1 answer
77 views

Accessing characters with \symbol

I'm trying to use the \symbol{} command to output UTF8 haracters, but I can't get access any characters higher than 0x7E The following code just outputs a tilde. \documentclass[a4paper,10pt]{article} \...
0 votes
0 answers
36 views

Include `section` headers with `xcomment`

I use the package xcomment to make a stripped down version of mynotes.tex, including only theorems, definitions, etc. E.g.: \documentclass{article} \usepackage{xcomment} \usepackage{docmute} % Other ...
2 votes
2 answers
325 views

How to \include files with commas in their path

I am part of a large project working with big documents (>100 chapters and ~1000 pages per document). As it stands, we input our partial files into the main document via \input. The project would ...
  • 1,413
1 vote
0 answers
718 views

pdfLaTeX error - [closed]

\documentclass[11pt,a4paper,roman]{moderncv} \usepackage[utf8]{inputenc} \moderncvstyle{classic} \moderncvcolor{green} \usepackage[scale=0.75]{geometry} \usepackage{amsmath} \usepackage{amsthm} \...
4 votes
1 answer
172 views

Why does LaTeX tell me that my external text file has a last line which contains the token \par?

Why does LaTeX (TeX Live 2020, Debian) tell me that SomeLines.txt has a 6th line which contains the token \par? I know with \endlinechar being 13 and the catcode of char 13 (carriage return) being 5 ...
14 votes
1 answer
368 views

How to force LaTeX to error when an \include file is missing/misspelled?

The only file which was meant to be compiled in my Main.tex was specified by the following line: \include{transformtaion} It was compiled without any error using the following command: pdflatex -...
  • 284
1 vote
1 answer
47 views

problem creating tex from tex because of missing space

I have saved a name in \Name. It is ABC. So actually I wrote both possibilities this one \immediate\write\file{\read\noexpand\NoFile to \\Name} and this one \immediate\write\file{\read\noexpand\...
  • 141
0 votes
0 answers
36 views

allocate to Variables

I want to use the numbers in Blues.tex, but the number are real number like 234.65 but \setcounter can just use integer like 234. But this is not possible by using \setcounter. I Want to use many txt ...
  • 141
0 votes
1 answer
91 views

Generate an expandable error message when a file does not exist

I would like to understand how to use the expl3 command \msg_expandable_error (as used here) with \IfFileExists to get an expandable error message if some external file does not exist. I deliberately ...
  • 8,959
1 vote
2 answers
227 views

How to use standalone correctly? Scaling issue between standalone and \input

I have to deal with multiple rather large tikz images which I'd like to run isolated as a standalone file. Now, when integrating these images into my main file, the scaling is off. Meaning that I ...
  • 65
0 votes
1 answer
78 views

How to print the value of a counter to a file?

I'm trying to write the value of a counter to a file: \documentclass{article} \begin{document} \newcommand\print[1]{ \newwrite\foo \immediate\openout\foo=foo.txt\relax \immediate\write\foo{#1} ...
  • 11.1k
0 votes
0 answers
49 views

Appending Text to Each Line of an External File Using expl3 Syntax

Let us suppose I have an external questionfileone.tex file where each line of this external file represents a particular question text. It is something that I can use, for example, as a test database ...
1 vote
1 answer
188 views

tikz figure from file

Lets say i have a tikz figure in a file called tik_fig1.tex and tik_fig2.tex with \documentclass[tikz]{standalone} Is it then possible to add these to a main.tex with \documentclass{article} by ...
0 votes
0 answers
22 views

List of extra files used [duplicate]

Is there a way to know the files used to compile a .tex file? This should contain things like... Files imported or "included". Graphics like images (cf \includegraphics for example). ...
  • 12.6k
2 votes
2 answers
202 views

Find if a string exists within external files

I'm trying to look for a way to determine if a particular text or string is present in external .tex files. It is like accepting a text input from a user and determining if that text can be found in ...
0 votes
1 answer
95 views

Redefinition of \includegraphics for inclusion of default figure fails

In an earlier question (Automatic detection of Overleaf for fallback images) I wanted to automatically detect if I am on Overleaf or locally to choose fallback images when on Overleaf, or to re-...
  • 1,721

1
2 3 4 5
13