[texworks] ver 567 Scripts - Cariag/Line returns now coming back as ??

Paul A Norman paul.a.norman at gmail.com
Mon Mar 15 23:55:38 CET 2010


Dear Jonathan or Stefan,

I've updated my scripts to use the new api and that is working well.

However (I'm still using LUA) when I pass a series of selected
(highlighted in the editor) blocks of text to a script, the carriage
returns/ line breaks between the blocks of text  are now returned as
?? with no carriage return/ line breaks and all the text runs together
of course.

This didn't used to happen under previous rev.s of TeXWorks

I've tried changing the document encoding (EDIT/Preferences), but it
happens under UTF-8 and windows-1250.

Here is a script that causes this effect. The requested \n in the
script work ok producing the expected line-breaks/carriage returns in
the editor, its the line breaks passed to the script in   txt =
TW.target.selection   that no longer work ok.

--[[TeXworksScript
Title: multiCols{}
Description: (updated) Puts the current selection in to multicols environement
Author: Paul A Norman
Version: 0.2
Date: 2010-03-09
Script-Type: standalone
]]

txt = TW.target.selection

env = "\\begin{multicols}{3}\n" .. txt .. "\n\\end{multicols}\n"

-- replaceSelectedText
TW.target.insertText(env)


More information about the texworks mailing list