On 02/17/2016 05:10 PM, Aaron W. Hsu wrote:

> I'm attempting to do some literate programming using the noweb module in
> LyX. I need to insert some Unicode text into verbatim environments. I
> notice that when I copy and paste the code directly into a noweb chunk
> or just a plane verbatim environment that it seems to work, but when I
> attempt to type the unicode characters directly into a verbatim
> environment, LyX says that the verbatime environment does not permit
> these characters.

I learned a bit more about Unicode, Lyx, and the module system to
understand how Verbatim environments and environments like that were
getting caught up in this Unicode problem.

Basically, the noweb module uses the following InsetLayout command to
define a new inset:

InsetLayout "Flex:Chunk"
    LabelString          "Chunk"
    LatexType            none
    LyXType              Custom
    Counter              chunk
    RightDelim           <br/>@
    Decoration           Classic
    Font
      Color              latex
      Family             typewriter
    EndFont
    #LabelFont
      #Color              latex
      #Size               Small
    #EndFont
      MultiPar            true
    CustomPars            false
    ForcePlain            true
      PassThru            1
      ParbreakIsNewline   1
    KeepEmpty             true
    Spellcheck            0
    FreeSpacing           true
    ForceLTR              true
    Argument 1
            Mandatory     1
            LabelString   "Options"
            Tooltip       "Options"
            LeftDelim     <<
            RightDelim    >>=<br/>
    EndArgument
    ResetsFont false
End

I was going through this and playing with the various settings to clean
up how I want my Noweb programs to be displayed when I figured out that
the PassThru option is the one triggering the problem. Despite the fact
that I'm using LuaTeX, and can work with UTF-8 all day long in my TeX
back-end, Lyx refuses to permit unicode when the PassThru option is
attempted.

It is not possible to get good results by disabling PassThru, as LyX
does too much processing of the input for that. Yet, by all accounts,
LyX has a hard-coded behavior to force PassThru to use Latin only
characters.

I would prefer to be able to choose whether I want to allow UTF-8
passthrough or not. I thought that maybe the ForceLTR option would do
this, but it does not. So, maybe a "ForceLatin" option that would choose
whether to allow or disallow UTF-8 in the verbatim/passthru
environments? Is this already possible?

        Yours truly,

                Aaron W. Hsu


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to