I've written notes for my students and I want to create different versions of them: a short one, to print, and a long one, to distribute them through internet. So for the same content, and I want to compile it twice with different behaviour.
Here is a MWE of what I do:
- the content of chapter 1 is
content1.tex
\begin{document}
This is some text.
\important{This is very important.}
\remark{This is a remark.}
\end{document}
- the content of chapter 2 is
content2.tex
\begin{document}
\important{This is very very very important.}
\remark{This is a useless remark.}
This is some text
\end{document}
- the file
full_version.texcontains a first set of\newcommands:
\documentclass{standalone}
\newcommand{\important}[1]{\textbf{#1}}
\newcommand{\remark}[1]{\textit{Remark: #1}}
- the file
short_version.texcontains a second set of\newcommands:
\documentclass{standalone}
\newcommand{\important}[1]{\textbf{#1}}
\newcommand{\remark}[1]{}
My solution is the following: to compile the content1 with the full_version preamble, I write this command on Linux shell:
cat full_version.tex content1.tex | latex
It works, but is not very satisfactory (many strange messages); and Linux-shell dependant.
Are there better way to achieve this? Perhaps with precompiled preambles?
\input{content}into your two top level files. – David Carlisle Jul 11 '16 at 06:55latex \input{full_version.tex}\input{content1.tex}– touhami Jul 11 '16 at 07:40multiaudiencepackage. This is an example: http://tex.stackexchange.com/a/266682/1952 – Ignasi Jul 11 '16 at 08:33