Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a LyX document filled with text and equations like in a scientific paper. To focus only on the math sometimes it can be really useful to only print/output the formulas and not the text around it. Is there any way to do this automatically in LyX? So far I manually copy all the equations but that is not convenient in the long run. All equations are numbered and centered in the math mode.

share|improve this question
add comment

3 Answers

try with the following in the preamble:

\usepackage[
  active,
  generate=file,
  extract-env={equation,align}
]{extract}

then it generates a new file with the chosen contents.

share|improve this answer
add comment

It is with extreme reluctance that I suggest a perl script that I once wrote called mathgrep for this purpose. It was designed to mess with mathematics inside a LaTeX document, leaving non-mathematics environments alone. It is not particularly sophisticated in that if you mess with how you start and stop maths sections then you can easily confuse it, but on a regular document it ought to work (so long as you've used proper LaTeX \( ... \) and not TeX $ ... $).

You can get it from mathgrep. It needs Perl (plus a couple of perl libraries). If you've not used any weird maths environments, then:

mathgrep '/.*/' latex_file.tex

should produce all of the mathematics (inline maths includes surrounding text, by the way). You'd need to include the preamble yourself.

share|improve this answer
add comment

You can put the equations or the text in a branch. Then you can activate or inactivate the branch. Inactivated branch will not be printed when you convert the document into PDF.

Go to Documents -> Settings, select branches, enter a name for the branch, click on add and then high lighten the branch and select either activate or deactivate. In the document itself begin typing your equation and when you need to insert a text do the following: Go to Insert -> Branch and click on the name of the branch you need to insert. type your text inside this branch. Hope that this will be clear

share|improve this answer
1  
As @tohecz mentioned, please provide a usable and understandable solution to the problem. –  Camil Staps Jan 9 '13 at 8:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.