-2

Is it possible to use Latex for scientific formulas (mathematic, physic, chemistry) that are written on a .txt file ?

example about a chemistry formule

\[
  HC \equiv CH + H_{2}O
  \cto{Hg^{++}}{18\%\ H_{2}SO_{4},\ 90^\circ}{14} 
  CH_{3}-CHO
\]

I have no ideas to do it.

PengOne
  • 48,188
  • 17
  • 130
  • 149
Zeroth
  • 83
  • 1
  • 8
  • What do you actually want to do? Do you want to create a list of images (one for each of the formulas), convert your text file in another format, get some chemical formula information? – Paŭlo Ebermann Sep 08 '11 at 01:12
  • I want to create scientific mcq (with formulas) by using a .txt file because i'll import this .txt file to do it. and instead of writting these formulas on a form, i want to do it on a .txt file. i want the corrrect formulas relateed to the correct mcq. example : http://chemistry.boisestate.edu/people/richardbanks/organic/mc/vol2/mcquestions317b.htm where i have mixed between txt, images and formulas(compiled as images). – Zeroth Sep 08 '11 at 06:01

1 Answers1

1

Save it as a .tex file instead of a .txt file. You'll need to install LaTeX (possibly with some chemistry packages too - they are several packages for typesetting chemisty. You can search for packages on CTAN.). Walk yourself through some examples.

Gregor Thomas
  • 136,190
  • 20
  • 167
  • 294
  • thank you, in fact i have to parse a txt file who build a mcq items, i will have the mcq and i need scientific formulas inside (for scientific mcq) http://stackoverflow.com/questions/7340038/about-importing-txt-files-how-much-size-or-delimiter-can-i-set – Zeroth Sep 07 '11 at 22:45
  • oh ok soi have to parse a file with .tex extension and put everything as a latex document? – Zeroth Sep 07 '11 at 22:56
  • It's very unclear what you are trying to do. LaTex is used most commonly to produce postscript or PDF files. It compiles a .tex file and produces a document. I use LaTex for entire documents, not just single formulas. Perhaps you can extract the LaTex code from your .txt, save it as a .tex, compile it, and then use the image, but why not just skip the .txt and go straight to LaTex? – Gregor Thomas Sep 07 '11 at 23:25
  • because i don't know the correct way to do it. i was thinking to parse a .txt file to extract the data i need, but i totally forget that i can build chemistry mcq. so i have to extract the Latex code, save, compile, use the image .. but how i will put the image on the correct mcq ? – Zeroth Sep 07 '11 at 23:39
  • Probably you'll name the tex file something like "mcq1.tex", and get an image that is "mcq1.pdf". – Gregor Thomas Sep 08 '11 at 01:28