LyXwriting a book - more styles

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Danny20142015
Posts: 2
Joined: Wed Nov 19, 2014 4:22 pm

writing a book - more styles

Post by Danny20142015 »

Hi,
I have switched to lyx few days ago from MS word. I have no background in Latex programming. I am writing a technical book on a programming language. When I write names of functions, I wish them to be connected to a certain style which will be defined as bold with some color. I need it to be a style (or what ever it is called) so I can change the definition of this style in the future as I find fit. For now I didn't find any solution, so I just each time select the words I want, right mouse click and bold them. Can anyone help how to solve this ?

Thanks,
Dan

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

writing a book - more styles

Post by Johannes_B »

Hi and welcome,

LaTeX is a macro language, you can always define new macros like

Code: Select all

\usepackage{xcolor}
\colorlet{function}{blue!50!white}
\newcommand{\function}[1]{{\color{function}\bfseries#1}
You can use it inside LyX using ERT-Boxes. But since you are familiar with programming languages, i think using LaTeX-code directly will be more comfortable for you.

Packages like listings can help you in formatting program code.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Danny20142015
Posts: 2
Joined: Wed Nov 19, 2014 4:22 pm

Re: writing a book - more styles

Post by Danny20142015 »

Thanks
Post Reply