I am wondering why LyX uses the non-wrapping space ~ in TeX-style areas?
I understand in LyX-Code blocks that using the ~ prevents wrapping and
forces the text to appear exactly as you enter it.
However, when you are doing a paragraph, and have a few words of
typewriter output set in TeX-style, the tex will not allow a linebreak
inside the TeX-style area because of the use of ~.
I looked at the code, and paragraph.C seems to be the place where this
happens, but I am not sure which of the two lines to change, and what
ramifications it will have.
OK, here is a patch that does what I needed. It uses ~ for LyX-Code
environment, but spaces for Tex-Code in other environments. The test is
to compare the current environment to LyX-Code, and do the ~ only in those
cases.
Also attached is a tex file showing the changed output. Not the \texttt
text does not use ~. This change has fixed the cases where I was
getting texttt text in the margins when the texttt string had a few
lines in it.
My guess is that some type of patch for this should be made, though mine
may be too crude. The LyX code looks quite nice.
--
Bruce Momjian | http://www.op.net/~candle
[EMAIL PROTECTED] | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
*** ./src/paragraph.C.orig Fri Oct 22 17:11:01 1999
--- ./src/paragraph.C Fri Oct 22 18:45:39 1999
***************
*** 2924,2930 ****
texrow.start(this, i+1);
column = 0;
} else if (font.latex() == LyXFont::OFF) {
! if (font.family() == LyXFont::TYPEWRITER_FAMILY) {
file += '~';
} else {
file += ' ';
--- 2924,2931 ----
texrow.start(this, i+1);
column = 0;
} else if (font.latex() == LyXFont::OFF) {
! if (font.family() == LyXFont::TYPEWRITER_FAMILY &&
! style->name == "LyX-Code") {
file += '~';
} else {
file += ' ';
%% This LaTeX-file was created by <root> Fri Oct 22 19:16:25 1999
%% LyX 1.0 (C) 1995-1999 by Matthias Ettrich and the LyX Team
%% Do not edit this file unless you know what you are doing.
\documentclass[11pt,troffms]{article}
\usepackage{palatino}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{geometry}
\geometry{verbose,letterpaper,tmargin=0.25in,bmargin=0in,lmargin=1in,rmargin=1in}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
{\begin{list}{}{
\setlength{\rightmargin}{\leftmargin}
\raggedright
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\ttfamily}%
\item[]}
{\end{list}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% no page number on first page
\let\realmaketitle=\maketitle
\renewcommand{\maketitle}{\realmaketitle\thispagestyle{empty}}
% allow our calendar to have no footnote mark
\renewcommand{\thefootnote {\null}}
\makeatother
\begin{document}
\texttt{tex-code in standard environment}
\begin{lyxcode}
words~in~lyx-code~env
\end{lyxcode}
\end{document}