Suppose I have two tex files, document.tex and content.tex document.tex: \documentclass{article}  \begin{document}  This is some content.  \input{content.tex}  \end{document}  content.tex: This is some more content.  Compiling with pdflatex document.tex produces the expected document as pdf. However, I'd like to create a new standalone tex file, that would look like this: \documentclass{article}  \begin{document}  This is some content.  This is some more content.  \end{document}  I'm almost sure there must be a standard tool to do this, but I wasn't able to find anything.
27692
Suppose I have a document with multiple include or input statements  \input{fileA} \input{fileB}   etc.   Is there an easy way to generate a single .tex file where \input{fileA} is replaced by the actual content of fileA etc. without copying it manually?
70938
Let's say I have .tex file which is a set of problems and solutions, of which I want to make two pdf files, one which includes the solutions and one which doesn't. so I need to build the .tex file under two different modes, and specify that parts of the document be ignored under one of the modes.  This is something common in programming context. e.g. in C++ i can code  #ifdef DEBUG   // do this additional stuff ... #endif   How can I do something equivalent in latex?
39505
I have two XML outputs from a program that I would like to include in a LaTeX document. I would like them to appear side-by-side each in its own box. So that a reader can compare the two outputs while reading the document. Can't seem to find a way to do this, without making images for each output and adding both as images/graphics. Could there be a better option?
36209
I have created a tikz picture as a standalone.  Can I export the tex file as an image instead of as a pdf?
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?
76807
Intro  I'm working on a lightweight package that allows you to put any content (typically LaTeX code) in an environment, then use that content multiple times, each time scanned separately, so you can use it both as verbatim output and interpreted as LaTeX.  Its main purpose is to typeset LaTeX code and its 'result' side-by-side; useful for documenting TeX packages without having to copy/paste code. But it has other purposes as well.  After experimenting with \scantokens until I gave up in tears, I arrived at the filecontents environment, which almost solved my problem singlehandedly!  The Problem  The problem is, when reintroducing filecontented code through \input, LaTeX adds an implicit newline at the end, which translates to whitespace that I can't seem to get rid of.  I've seen many semi-related questions floating around, with answers employing techniques like:   reading a file line-by-line, using \everyeof in some clever way, playing with \endlinechar or using packages such as catchfile   but none of them provides a clear answer to the following question:  The Question  How can I \input a file without getting the implicit newline?  Minimal Working Example  \documentclass[margin=1mm]{standalone}  \usepackage{filecontents}  \begin{filecontents*}{tmp.tex}     \LaTeX{}\end{filecontents*}  \begin{document}     \fbox{\input{tmp.tex}} \end{document}     Note the extra whitespace to the right of the box.  Note also that I'm definitely not adding any explicit whitespace. Even a manually produced file (so, not using filecontents) with no newlines at all exhibits the same problem.
59222
The following MWE:  \documentclass{article}  \usepackage{amsmath}  \begin{document}  \[ \begin{split} a &amp;= b \\ c &amp;= d \end{split} \]  \end{document}   compiles fine with pdflatex, but when I run make4ht on it, I get the following error:  ! Package amsmath Error: \begin{split} won't work here.  See the amsmath package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.7 \[ \begin{split} a &amp;= b \\ c &amp;= d \end{split}                                                   \]   Is this an incompatibility of tex4ht? Is there an easy way to deal with this? I could just use align* in this instance, but there is a reason that I want to use split instead.
123047
Is there any way to compile a .tex to pdf without having to install latex.  Is there any python package for this ?  Or even better is there any small stand-alone portable software for this.  Thanks a lot
65818
My problem is that I want to have different .tex files for the preamble, the presentation aroundings (my target is a beamer PDF file) and the content of the presentation.  Mostly I'll be working on the content file. I even think about partitioning this content .tex file into several chapter files for a better overview. My problem with this solution is that I have to open the presentation.tex file to typeset the whole beamer PDF for looking at the results of my previous changes on the content files. (My presentation.tex file includes the preamble and the content.)  Is there any way to get TeXShop to always typeset one particular file (my presentation.tex) although I'm currently working on a different one (e.g. the content.tex)?  A shortcut? A command in the .tex file? An option in TeXShop? Anything?
50858
I know there are a lot of threads on existing Tex-HTML converters already, but I have a question about the feasibility of creating one.  Existing tools use other scripting languages to parse raw TeX and output HTML.  Would it be a better idea to write a package for TeX that overrides commands and outputs content to a HTML file?  For instance overriding \section to write a &lt;h1&gt;{content}&lt;/h1&gt; tag to another file.  Is this feasible? I'm sure everyone knows more about TeX than me so I'd like to hear your thoughts.
47896
I am compiling my dissertation which is composed with several separate papers (with independent LaTeX code).  I have a title for my dissertation and want to insert my individual papers with their own titles (different authors, etc., for each paper).  Someone suggested use  \begin{document} \include{paper1} \include{paper2} \end{document}   where paper1 has the codes as   \begin{document}  \end{document}   But it doesn't solve my problem.  For each individual latex code for the individual paper, I have title code outside of the \begin{document}.  Any suggestion about how to insert the entire LaTeX code of a academic paper, A, into another academic paper, B, while remain everything not changed for A.
2333
Some grant agencies require separate pdf files for the main proposal and the references. I guess, it is easier to work this way in Word :-)  In LaTeX, one can create a single PDF file and then split it later using pdftk or other tools. However, is a direct method of creating two separate PDF files: one that contains the main text (with the correct citation information) and the second with all the list of references. I understand that, at the very least this will involve compiling two separate .tex files. That is okay. I just don't want to use additional tools (can be tricky to install on all computers of all collaborators, etc.)  Here is a MWE to play with:  \begin{filecontents}{test.bib}   @ARTICLE{author,     title={A sample article},     author={Random Author},     journal={Random journal},     volume = {10},     year = {2000},   } \end{filecontents}  \documentclass{article} \usepackage{natbib}  \begin{document} As shown by \citet{author}, using references can be interesting  \newpage \bibliographystyle{apalike} \bibliography{test} \end{document}
37180
I wrote all my coding in the .tex file. The next day when I opened it the coding is all gone and the pdf file is opening with it and is displayed as an output. How do I bring back my coding?
27806
I want to compile sections of the article independently. Clearly, I can make their numbers right just by using something like \setcounter{section}{4}.  How can I get something like \ref{VeryUsefulTheorem} working if the command \label{VeryUsefulTheorem} is in another section (i.e., in another TeX file, which is compiled to its own PDF file)?  I'm using the  package, and, therefore, inter-document links are clickable. Is it possible to make links to a stuff in a different PDF file clickable?
32802
My .tex file:  \documentclass[a4paper,twoside,portrait,12pt,openright,final,pdflatex]{report} \usepackage[bindingoffset=8mm]{geometry} \usepackage[T1]{fontenc} \usepackage{arabtex} \usepackage{utf8} \usepackage{graphicx} \usepackage{float}  \usepackage{caption} \captionsetup{font=small,labelfont=bf} \setcounter{secnumdepth}{3} \usepackage{fixltx2e}  \usepackage{paralist}  \usepackage{hyperref} \hypersetup{pdftex,linktocpage=true,bookmarks=true,colorlinks=true,citecolor=blue,filecolor=black,linkcolor=blue,urlcolor=black,pdfauthor={Ayman Elmasry},pdftitle={Algorithmic Form Generation: A Thermal Building Envelope Design Approach}} \usepackage[all]{hypcap} \usepackage{lipsum}  \begin{document}  \lipsum[1-20]  \end{document}   I compile with pdflatex, and I get this error:  (/usr/local/texlive/2011/texmf-dist/tex/latex/caption/caption.sty (/usr/local/texlive/2011/texmf-dist/tex/latex/caption/caption3.sty Runaway argument? {\caption@CheckCommand \@makecaption {\long \def \@makecaption ##1##2\ETC. ! Paragraph ended before \@gobble was complete. &lt;to be read again&gt;                     \par  l.901         \unskip\kern-2\captionindent\par   When I comment out:  %\usepackage{caption} %\captionsetup{font=small,labelfont=bf}   ... I get an output PDF file with no problems.
82677
Everywhere in the TeX community, I see suggestions like \parskip, \obeylines, \parindent, etc. I'd be surprised not to find them even in the most basic LaTeX packages. So I figured they must be deeper down in the TeX core as primitives. Knowing how they work would be very useful.  Googling for tex primitives takes me to . Is there a printable PDF version of such a reference?
42980
I would like to merge 4 pdfs, pdf1.pdf, pdf2.pdf, pdf3.pdf pdf4.pdf together so that the pdfs are spliced, i.e. the first page will be the first page of pdf1, the second the first of pdf2, the third the first of pdf3, etc.  The pdf files are with plain images, no table of contents.  How would I accomplish this? It would be nice to do it from Terminal as well.