[BRLTTY] BRLTTY and the latex-access project by means of python brlapi module

Daniel Dalton d.dalton at iinet.net.au
Sat Dec 3 21:32:52 EST 2011


On Sat, Dec 03, 2011 at 11:21:52AM -0500, Dave Mielke wrote:
> [quoted lines by Daniel Dalton on 2011/12/03 at 17:27 +1100]
> 
> >Actually, I'm not even certain that my code in
> >/etc/brltty/nemeth_brltty.ctb is being ran even though it's
> >executable. I made it write some text to a file, and it works when I
> >invoke it manually, but nothing happens when I run brltty... 
> >i.e. the file is not created.
> 
> Yes, that'd be correct. Perhaps I hadn't made it clear enough that I was 
> proposing a new capability. I didn't start implementing it right away as I 
> wasn't sure if you were going to find it useful.

Sorry, my mistake. 

> I can start implementing it right now if you wish? Would you mind sending me a 
> copy of your code, along with a file contianing a few actual latex samples, so 
> that I can have something real to work with? I can fake it, of course, but it's 
> much more fun working with a real application.

Certainly. The code is available via svn, the url is:
https://latex-access.svn.sourceforge.net/svnroot/latex-access

I am also attaching the code I listed in one of my earlier emails to
receive the input from stdin and output to stdout, but it correctly
determines what table to use from our latex-access project. Actually,
I'll include it in svn, it's called latex-access-brltty.ctb.

The various .py and .table files in the root directory of the svn
checkout need to either be coppied to some directory in the python path
or alternatively, and probably much easier (it's what I do), would just
be to append the latex-access checkout directory to the python path. I
suppose the various files like settings.py and ueb.py should probably be
renamed to latex_access_settings.py and latex_access_ueb.py, but that's
something I can do later anyway. 

The settings are usually stored in ~/.latex-access, but working with the
default settings, in this case nemeth will be sufficient for our
purposes. 

I've also attached some sample latex for you. 

> One of the things brltty supports is being able to map a position in the 
> contracted text back to its positioin in the original text. Is your code able 
> to provide this data? If not, how hard would it be to add?

Unfortunately, not at the present time, although it's something I've
been looking to implement. Unfortunately, it will be quite difficult
from what I can see given we have many functions which handle different
latex markup. I have a few ideas though, and shall write to the other
developers to see how they feel about doing this. So for now,
unfortunately cursor routing wouldn't work but it is something I'll
probably be looking to do once I get this up and running. 

What would the best way to store the latex position and it's
corresponding Braille position be? 

Could I have a list where each index number corresponds to the Braille
chars, i.e. list[0] = the first braille char, and the value of each
index represents the corresponding character in the LaTeX? 

I suppose I'd also need to figure out a good way of expanding the text
under the cursor as well. Do you think it would be best to expand the Braille
symbol under the cursor in all cases, for editing purposes, I believe
this is how brltty contraction tables work anyway...

> Did I understand correctly that your code currently uses the BRF format, i.e. 
> the characters within the range 0X20-0X5F, to represent what each cedll should 
> contain?

Yes, I believe so. You can also experiment with the test script provided
in the root directory for nemeth only, but that should show you how it
works. 
It looks like brf to me anyway. 

Finally, you might notice the file brltty.py in the root directory; that
is my implementation of Braille via brltty which works ok, but I haven't
done key bindings yet, but I believe that this implementation should
work much better, and that stuff will be removed once we can do the
convertion via brltty contraction tables. 

Thanks very much,
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.tex
Type: text/x-tex
Size: 803 bytes
Desc: not available
URL: <http://mielke.cc/pipermail/brltty/attachments/20111204/894bcc40/attachment.bin>


More information about the BRLTTY mailing list