0

I want to let latex only run one of my defined commands and output results to a tax file.

For example, the following tex file:

\documentclass{article}
\usepackage[usenames,dvipsnames]{xcolor}

\newcommand{\note}[3][]{{\color{Orange}#1}{\color{Red}#2}{\color{Cyan}#3}}

\begin{document}

\note[text1]{text2}{text3}

hello world \textbf{here} .

\end{document}

I want latex to only run the \note command and output the results:

\documentclass{article}
\usepackage[usenames,dvipsnames]{xcolor}

\newcommand{\note}[3][]{{\color{Orange}#1}{\color{Red}#2}{\color{Cyan}#3}}

\begin{document}

{\color{Orange}text1}{\color{Red}text2}{\color{Cyan}text3}

hello world \textbf{here} .

\end{document}

into a new tex file for example compiled.tax

Is there anyway to achieve this?

Thanks in advance.

7
  • Is there a reason you're saying tax file instead of tex?
    – A.Ellett
    Apr 9, 2014 at 15:24
  • 1
    In other words, given the above code as input, the output should be the second code? This is not a job for TeX, then.
    – egreg
    Apr 9, 2014 at 15:26
  • I want to have some kind of pre-compile command or macro in tax. The command is a tex command and runs in tex logic... Apr 9, 2014 at 16:18
  • 2
    @Leo: I have a feeling that this is a classic XY Problem. If you add details of exactly what you want to achieve via the pre-processing step (and the subsequent step), someone here can probably suggest a way to accomplish your goal without this temporary file. Apr 9, 2014 at 16:30
  • @PeterGrill Thanks. I will then post another separate question. I basically want to create a change track mechanism similar to that in word by using a new \note command. And you can choose to show these changes and not. And more importantly when progress to next version, you can delete those change tracks in the latex mimicking the accepting all changes in word. I will do another post and let you. Apr 9, 2014 at 16:40

0

Browse other questions tagged .