LyX ⇒ How to convert a CWEB TeX document into a PDF document ?
-
- Posts: 4
- Joined: Tue Nov 08, 2016 5:30 pm
How to convert a CWEB TeX document into a PDF document ?
Sorry in advance for my scarce knowledge of LyX.
I'm trying without success to convert the attached TeX file "dlx1.tex" into a PDF document, with my LyX version 1.6.10 in a Linux environment.
I know that also the attached TeX file "cwebmac.tex" must be processed, that defines some used macros.
I tried to put both files in the same directory, then to import the dlx1.tex, and finally to convert it into PDF. But I got a long list of errors during such conversion.
NOTE: Both TeX files are public domain in the context of CWEB literate programming of Prof. Donald Knuth. The first is just extracted via CWEB's tool "cweave" from the Knuth's file "dlx1.w". So I don't expect any error in it !
Please, can someone help me ? Thank you.
- Attachments
-
- dlx1.tex
- (43.42 KiB) Downloaded 364 times
-
- cwebmac.tex
- (25.66 KiB) Downloaded 338 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: How to convert a CWEB TeX document into a PDF document ?
I don't even know if LyX can work with plain.
-
- Posts: 4
- Joined: Tue Nov 08, 2016 5:30 pm
Re: How to convert a CWEB TeX document into a PDF document ?
1) I need details on one of Knuth's algorithms, and such algorithm was "coded" in CWEB by Knuth.
2) Sorry, may be due to my lack of knowledge on LyX I don't understand your statements about "pdflatex" and "plain". Usually I use LyX to convert a ".lyx" document to a PDF. My question is: how can I convert the attached ".tex" document to a PDF via LyX ?
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Re: How to convert a CWEB TeX document into a PDF document ?
I suggest, at first try it with TeX (pdfTeX). If that works, than with LyX. That's because LyX bases on TeX.
Maybe Scott takes a look and has a suggestion, he is the LyX expert here.
Stefan
-
- Posts: 4
- Joined: Tue Nov 08, 2016 5:30 pm
Re: How to convert a CWEB TeX document into a PDF document ?
I know that LyX is based on TeX, so I imported the TeX document "dlx1.tex" in LyX via "File -> Import -> LaTeX (plain)".
LyX let me search for a LaTeX (plain) file to import of type "*.tex" and I imported the file above without problems.
The TeX file was displayed in the editor window of LyX in a semi-readable form.
When I tried to convert it to a PDF I got a long list of errors.
I think that errors are there because LyX doesn't process the companion TeX file "cwebmac.tex" (containing the definition of some macros), just because I don't know how to say LyX to do that.
I tried to put the companion TeX file in the same directory of the first imported TeX file, but it doesn't work.
The problem is: HOW CAN I SAY LyX TO PROCESS THE COMPANION TeX FILE "cwebmac.tex" while converting to PDF the imported TeX file "dlx1.tex" ?
I think that CWEB is not a concern (so far) to give an answer to that question.
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: How to convert a CWEB TeX document into a PDF document ?
-
- Posts: 4
- Joined: Tue Nov 08, 2016 5:30 pm
Re: How to convert a CWEB TeX document into a PDF document ?
I was able to convert my TeX document to a PDF using pdftex, as suggested by Stefan.
I realized that "pdftex" program was already installed in my Linux system and I just execute "pdftex dlx1.tex" (after putting both TeX files in the same directory) getting "dlx1.pdf".
(What about LyX capability to convert a plain TeX file into a PDF remains open problem ?)
Thanks to all.
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
How to convert a CWEB TeX document into a PDF document ?
However, you can import plain TeX code by inserting an ERT TeX snippet, but into a LyX file that will be like a LaTeX document. I don't know if this is helpful - but a plain TeX file might work in a LaTeX/LyX document too.
Stefan
-
- Site Moderator
- Posts: 542
- Joined: Sat Sep 01, 2012 6:38 am
How to convert a CWEB TeX document into a PDF document ?
+1Stefan Kottwitz wrote:LyX can import LaTeX formatted files and compile it. The integrated importer was originally called tex2lyx, and this reads LaTeX. I guess it's just a rare requirement to completely use plain TeX with LyX, the popular use is LaTeX.