[luatex] Computer code listings in attractive labeled boxes
lloyd at writersglen.com
lloyd at writersglen.com
Wed Feb 7 23:55:01 CET 2018
Hi Siep,
Many thanks for your response.
Unfortunately, the listings package doesn't give us quite what we need. It provides formatting and token lighting. We need to mark arbitrary sequences of code to emphasize code changes from previous listings.
I've attached an examples of what we have so far, both screen shots and LaTex code:
listing_9.2.png shows our original attempt at styling code lists.
listing_3.8.png shows our more recent attempt
listings.txt shows code for both approaches
Our problem is that we need to convert several hundred such listings into a visually attractive style.
Best wishes,
Lloyd
-----Original Message-----
From: "Siep Kroonenberg" <siepo at cybercomm.nl>
Sent: Wednesday, February 7, 2018 4:42pm
To: "LuaTeX discussion." <luatex at tug.org>
Subject: Re: [luatex] Computer code listings in attractive labeled boxes
On Wed, Feb 07, 2018 at 12:37:00PM -0500, Lloyd R. Prentice wrote:
> Help!
>
> I’m a long-time lyx user, but brand new to LuaTeX.
>
> I need to know if something is possible and, if so, guidance on how to do it.
>
> My co-author and I have written a computer programming book and typeset it with lyx. It has several hundred code listings. We first formatted the listings with available lyx tools. But they were rather ugly. My co-author found a way to make them more attractive, but the process is kludgy and inordinately time-consuming.
>
> We need a better way.
>
> I’m digging into LuaTeX docs. So far I’ll found tantalizing hints. But it’s still not clear whether or not we can really accomplish in LuaTeX what I hope we can do. From my notes:
>
> Need to know how to:
>
> Create LuaTeX functions
> Call LuaTeX functions from lynx
> Create LuaTeX function to display block of code with normal, bold, and strikeout characters
> Create LuaTeX function to display chapter number (CN)
> Create LuaTeX function to display listing number (LN)
> 6. Create LuaTeX function to display listing header:
> “Listing <CN>.<LN> <comment>
> 7. Create LuaTeX function to display an attractive box around
> listing header and code block
> 8. Automate or efficiently replace all listings in current Build It lyx file
Did you try to export your book to LaTeX? When using LaTeX (or
pdflatex or lualatex) directly, you can use e.g. the listings
package, which supports syntax highlighting and can typeset code
from external files.
--
Siep Kroonenberg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listing_9.2.png
Type: image/png
Size: 11261 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20180207/7f77bf64/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listing_3.8.png
Type: image/png
Size: 32218 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20180207/7f77bf64/attachment-0003.png>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: listings.txt
URL: <http://tug.org/pipermail/luatex/attachments/20180207/7f77bf64/attachment-0001.txt>
More information about the luatex
mailing list