I have been using LaTeX for quite a while now, but I have not found out how to determine the rules for the compilation steps needed to create the document yet.  A couple of questions come up. Please do not hesitate to provide a really short answer, I just do not know where to start.  texify belongs to MikTeX and runs pdflatex plus what else is needed. What is the equivalent for MacTeX?  When I would like to launch a recompilation script, it would probably make sense to run texify only once so that I do not have to take care of running BibTeX, pdflatex and others multiple times. Is that correct?  What would be the best approach to write a simple script that compiles everything that is needed in the correct order?  There is a grunt plugin that compiles latex, but looking at the , I do not understand how a simple pdflatex call could correctly compile everything. Is that possible?
28956
A lot of people write makefiles that say something like  paper.pdf: paper.tex         pdflatex paper         bibtex paper         pdflatex paper         pdflatex paper   To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this?
92499
I work with many documents which I hope will have the same style throughout.. When making a decision about the design, I want that to be applied to all of the documents uniformly. I've created 1 file that has the start and ending code. Then, all of my other files just have the text, and some minimal code (defining things like chapters and sections). E.g.:  \documentclass{article}  \title{The First Document} %\title{The Second Document} %\title{The Third Document}  \begin{document}      \input{document01}     %\input{document02}     %\input{document03}  \end{document}   To compile a different document, I just move the %'s to another line and run pdflatex on this file.   Is there a better system for managing these? Can I put some details, such as the \title information in the beginning of each document (document01.tex, etc.) Is there any way to compile all of the documents at once as separate PDFs?
104286
In a .tex document, I'm using the comment package to produce two different versions (let's say : versionA and versionB) of the document. Each version contains different parts (it could be paragraphs, equations,...). If I use \includecomment{versionA}, it will include all the content between \begin{versionA} and \end{versionA}. Now, let's say some of the parts in each version are marked with a *. How can I ask latex to compile only the * parts in one version ?   It may be clearer on the following example. Let's say I have  \documentclass[10pt,a4paper]{article}  \usepackage{comment} \includecomment{versionA} \excludecomment{versionB}  \begin{document}  \begin{versionA}  *part1  part2  *part3  \end{versionA}  \begin{versionB}  part1  *part2  \end{versionB}  \end{document}   I would like something which enables me to do : "compile all the content of versionA" or "compile only the content marked with * in versionA" (same for versionB). I hope this is clear!
2953
I have a bash script which I use to compile a file with pdflatex twice (to make sure it sorts out references properly, etc.). This is the 'latexbuild' script I use:  module load ctan pdflatex --shell-escape --interaction=nonstopmode $1 bibtex $1 pdflatex --shell-escape --interaction=nonstopmode --interaction=batchmode $1   I would then call this script with latexbuild test.tex. It produces a lot of output which I would like to supress, except for the error messages which I'd like to see. Is there any way to only allow error messages to be displayed?
115355
I use LaTeX on a Mac, using TeXShop. It is possible to compile an index from within the TeXShop interface, except when I have more than one index (say, people and concepts) for the same text. In this case I used to compile it from Terminal:  makeindex MyIndex   say. But since I went from Mac OS 10.5 to 10.6 (Snow Leopard), the latter does not work anymore (albeit normal, single-index compilation from within TeXShop works fine). Any idea?
95852
I have the following situation:  Like most LaTeX users that write much, I have my own header files where the packages I use normally are required and the macros I use often are defined.  So if I write some article, I will normally use my own macros and save a lot of time and redundancies.  Now I send in my article to some journal and they want to publish it! Of course they want me to send in my source code.  Naturally, the following problem arises: The publishers won't want to include my own headers. They want code that compiles on every regular TeX-distribution. How can I convert my source into a file that doesn't contain my own macros anymore?  I need something like a preprocessor, that "inlines"/expands all macros and definitions found in the headers I explicitly specify (my headers), but not those in the other, unmentioned packages (regular headers).  Does anything like this exist? Could it be implemented using TeX/LaTeX or would one have to reimplement the macro expansion mechanism?
115177
Fresh install of Mac OS Sierra, fresh install of MacTeX. If I run with the terminal pdflatex I get   -bash: pdflatex: command not found    Any idea?  Thank you for help and answers.
31534
I'd like to be able to create a TeX file that will output multiple PDF files with one compilation.  I'm not even sure if this is possible.  Here is the setup:  I am writing dozens of cover letters for job applications, and wish for them to all look "personalized".  So I defined a function which calls multiple variables, such as the address, name of the institution, open position, etc., and outputs a "personalized" cover letter for each function call.  The problem is that compilation of the TeX file outputs just one file.  Since I will be submitting all of these files online eventually, I would like each letter to be in its own file.  Is there a way to do this at the TeX level?
39082
I have asked a  about how to manage all the files generated when my LaTeX files are compiled but the approach in the answer I accepted is still unsatisfactory for the many small documents I generate.    I realize the LaTeX  all the files it generates so I can't prevent their creation.    However is there a way to configure pdflatex to make all but the .tex and .pdf files hidden files (i.e., preceded by .)?   (Edit: The two main systems that I use are tex live on Ubuntu Linux and BasicTeX on OS X)
57177
Is it possible to have LaTeX (or another program) to expand a the macros in a .tex file, and output the expanded LaTeX source?   If no such program exists: are LaTeX macros processed simply as string substitutions, before the document is interpreted? If so, it might be easy enough to write my own such converter.  Edit: The reason I ask is journals which don't accept LaTeX submissions with macros. It would be useful to be able to develop with my usual macros, and convert automatically to the 'macro-expanded' format for submission.
100572
If PDFLaTeX fails to compile with     See the LaTeX manual or LaTeX Companion for explanation. Type  H     for immediate help.   I want to press e to get an instance of Emacs. The cursor should be on the position of the error (if TeX knows it)  I guess I should insert   export TEXEDIT="emacs magic"   to my .bashrc but what should I type instead of magic?
30225
Last night, I migrated my MacBook's operating system from 10.10 "Yosemite" to 10.11 "El Capitan". Everything seemed to go smoothly. Happily, regarding my TeX-related work, I am able to use the GUI front ends "TeXworks" and "TeXshop" just fine since completing the OS upgrade. I use MacTeX2015, with all the latest updates installed.  Oddly, though, since completing the upgrade I can no longer run any MacTeX command-line utilities such as texdoc and kpsewhich. (Actually, as I just discovered, I can no longer run pdflatex either from a command line. However, I never do run pdflatex from a command line prompt, so that's not an urgent problem for me -- at least not for now.)  The suggestions given in the posting  do not seem to be applicable to this case, as they all seem to revolve around setting up /usr/texbin correctly -- /usr/texbin is no longer allowed under MacOSX 10.11. The document  by Herb Schulz deals in depth with adjusting settings in the GUI front ends, but it appears not to touch on what to do about /usr/texbin, which appears to be the now-missing link to TeX's command line utilities.   Pointers and solutions most welcome!
23064
I am writing a program, and I want it to do different things depending on which LaTeX packages have been installed.  My current solution is to automatically generate simple .tex files that \usepackage the packages I care about and then automatically check if pdflatex can compile them or not.  This solution seems slow and fragile.  What is a better solution?  Edit: The program I am writing is in Python.
79440
How can I set up a permanent compile loop that keeps trying even when there are errors? I'm using latexmk with a remote compile setup as discussed  and . However, if I save a document with a bug (either a legitimate bug, or I save it before closing a tag), then latexmk halts. Any suggests how I can have it pause, try again, and keep trying again, for ever and ever?
12387
I was looking through some old files recently, and it occurred to me that they might be obsolete in the future.  Are there any steps that I should take for "archiving" my documents so that they will compile properly on later versions of LaTeX?  I once went to a seminar where it was indicated that the .dvi file can be converted back into a plain TeX file, so would it be the best "archival" document?
19555
Occasionally, I see other people's documents starting with two lines like that:  % !TEX TS-program = xelatex % !TEX encoding = UTF-8 Unicode   It's clear to me that the first line declares the engine that should be used for compilation, and the second lines states the text encoding of the input file. It's not clear to me, however, when and why I should use such expressions.  More detailed questions on this subject matter would be:   How can I compile without determining which engine I want to use so that I would even need that comment? Which editors/programs pick up on these directives? Who introduced them? Is there any "documentation" of possible values etc.? Are there more such expressions? Are they standardized in any way? Can I add options to the compilation engine, e.g. pdflatex -enable-write18 or xelatex -interaction=nonstopmode? What does the "TS" in TS-program stand for? What additional value does the encoding line provide if I'm already using inputenc? Are there any downsides to using them or reasons not to use them?   Meta: Even though it technically contains multiple questions, I'm pretty sure this question conforms with our standards as a catch-all question on a narrow topic. I guess I know some partial answers to some of my questions, but I'll leave that up for people who have experience with these expressions. I just wanted to provide a question that allows for a maximal amount of information on this subject matter.
87384
After having updated to Mac OS X El Capitan (10.11), I'm no more able to compile using either TexMaker or TexShop. This is the message I get from TexShop  "/usr/texbin/pdflatex does not exist. TeXShop is  a front end for TeX, but you also need a TeX distribution. Perhaps such a distribution was not installed or was removed during a system upgrade. If so, go to  and follow the instructions to (re)install MacTeX. A less likely possibility is that a tool path is incorrectly configured in TeXShop preferences. This can happen if you are using the macports or fink distributions."  I tried to change the path in Preferences-Engine, as many suggested. Yet, it doesn't work either. Any help?