Joerg Hau wrote:
Hi,

How does one change the font that is used (a) for the "LyX-Code" environment, (b) for "typewriter" character markup?

I would like to modify the font size, and/or eventually change the font for these two completely. Maybe I have searched in the wrong places ;-), but I have not found an answer to this question yet ... ?

Thanks for any hint,
and have a nice day!

- Joerg



If you mean you want to change LyX-Code globally (for all documents on your system), you need to hack the file lyxmacros.inc in the ...\Resources\lyx\layouts directory on Windows systems (at least for versions 1.3.6 and 1.3.7) or .../share/lyx/layouts on Unix-like systems. You might want to put the hacked version in your "local" layouts directory (under your home) and leave the original intact, just in case.

In the section beginning "Style LyX-Code" there is a \newenvironment command, near the end of which is "\normalfont\ttfamily". You can change \ttfamily to something like \rmfamily or \sffamily (although IMHO a monospaced font would seem to be needed here). You should also be able to append a size command, for instance

\normalfont\rmfamily\large

or

\normalfont\sffamily\fontsize{9pt}{11pt}.

Beneath the preamble insertion in the .inc file is a subsection

Font
  Family  Typewriter
EndFont

I think you'll want to change Typewriter to Roman (or whatever) there as well, so that the screen display matches what you'll get in the output.

Changing the typewriter font itself, so that for instance \ttfamily does something different from what it does now, is something I think you'll have to do with LaTeX commands in the preamble. Perhaps a LaTeX guru (which decidedly excludes me) can help.

/Paul

Reply via email to