Re: LaTeX Legally Blind: Table Wrapping, Overful Hbox and Code Listings

  • From: "Andreas Stefik" <stefika@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Tue, 1 Apr 2008 00:53:16 -0700

Hi Veli-Pekka Tätilä,

I'm writing my dissertation in latex. I'm not an expert, but I have
written a ton of papers, a masters thesis, and am nearly finished with
a dissertation (all in latex), so perhaps I can help.

>  1. How do I ensure that table columns don't wrap?

Unfortunately, I don't know of any easy way to deal with this issue in
Latex. It does output an overfull box message, but as you know, it
spits out an enormous number of warnings, and they are pretty hard to
sort through.

>
>  2. In languages like Finnish, with lots of long compound words and words
>  that do include dashes, is there an easy way to recover from overful
>  hbox and underful badness.

Almost every latex user I know just ignores overfull and underfull
badness. 99.9999% of the time, a sighted user cannot even pick up on
the issue. The only messages you do care about are those where it says
a figure, usually, is outside the margins of the page.

In my dissertation, for example, I currently have about 50 of these
underfull/overfull messages, but the formatting has already been
approved by the graduate school, and honestly, I'm not sure if I can
visually tell why latex is complaining anyway (I'm sighted).

>  Even in standard FInnish text using FInnish
>  babel I get a depressing amount of these warnings and their result seems
>  to be LaTeX's insistance on not wrapping certain lines.

Yaa, latex is picky, just ignore them if you can.


>  Since I've got about 100 pages of raw text I'm formatting with ...

have you tried using TexNic Centre and gsview? (You can also use dvi
with texnic centre)

It's possible texnic centre will make it easier to avoid listening to
the annoying error messages in a screen reader, as those messages come
out in a separate window, which you would have to navigate too to hear
them. I haven't tried it with Jaws though, so I could be wrong.
Anyway, might be worth attempting, here's a link:

http://www.toolscenter.org/downloads.html

You want the download that says: TeXnicCenter Setup, Version 1 Beta
7.01 ('Greengrass')


>  3. If I'd like to do code listings in any language, PErl in this case,
>  straight from the source

Have you tried the listings environment?

In my dissertation I use:

\usepackage{listings}

then after your begin document call, put:

\lstset{language=Perl}

That command sets up the environment for Perl.

For my thesis I also specify some constants, so all my code figures go
to the same place:

\newcommand{\codebump}{1.7in}
\newcommand{\minipagesize}{3.3in}


Then when you specify your code, do something like this:

\hspace{\codebump}
        \begin{minipage}{\minipagesize}
\begin{lstlisting}
if ( a == b ) {
   if ( b == c ) {}
}
\end{lstlisting}
\end{minipage}

It is important you put it in the minipage with these constants, as
then it will place all of your code examples, for your entire thesis,
in the same place on the page. Then if your professor wants you to
change something, you just have to set the one flag and everything
gets reformmated. I think you still have to manually format the code
though (using spaces), but it does make the figures look pretty good.
You can also use verbatim, which I do in some places, but that doesn't
automatically highlight the correct words/etc, like lstings does.

Either way, the above code might not format the tabs and spaces of
code, but it will put all your examples at the same spot on the page,
which will make them look pretty good. listings also automatically
handles things like "syntax highlighting" for perl, which is nice as
well.

I hope this helps, feel free to ask more questions.

Andreas
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: