LyXImport of a RAW text file... I need some help! :)

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
asbesto
Posts: 1
Joined: Sun Jun 03, 2018 8:51 am

Import of a RAW text file... I need some help! :)

Post by asbesto »

Hi there,

I used LyX some years ago, creating a book of "haikus", it was a wonderful experience because of the final result - so amazing! :)

Now I'm running into a new idea and I'm struggling with a problem. I need to have a bunch of ASCII logfiles as the content of my "book" - I need to maintain the same formatting because it's ASCII graphics in there, and tables etc.

So any "chapter" in this book is a logfile - a plain text file.

I can't find a nice good way to import those text files into lyx :(

I tried joining all those text files into one single file to try a single big chapter with full text in it) but when I tried "import", everything gone to hell - CPU at 100% and LyX basically locked. (this on my GNU/Linux system, btw)

So I'm trying to find a solution - the best will be to have any of those files (some of them are about 250 - 300K in size) as simple chapters of this kind of book - mantaining the ASCII formatting as it is (and maybe changing the font in it, but that's another question)

Can someone help?
TY in advance

PS I'm using LyX version 2.2.2 under Devuan GNU/Linux (basically it's a Debian Stable)

asbesto

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Import of a RAW text file... I need some help! :)

Post by Stefan Kottwitz »

Welcome to the forum!

You could put the raw text into a .tex file, let's say ascii.tex. Then insert TeX code in LyX ("ERT", "evil red text") that is \input{ascii}.

Stefan
LaTeX.org admin
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Import of a RAW text file... I need some help! :)

Post by rais »

Hi,
asbesto wrote:
I need to maintain the same formatting because it's ASCII graphics in there, and tables etc.
perhaps you're looking for \verbatiminput{} as provided by verbatim package?

KR
Rainer
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Import of a RAW text file... I need some help! :)

Post by scottkosty »

Note that LyX has a "Verbatim" environment. You can select it in the upper-left drop-down box in LyX.
Post Reply