LyXFormatting a Description List

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
uudruid74
Posts: 6
Joined: Fri Jun 20, 2014 3:54 am

Formatting a Description List

Post by uudruid74 »

I want to do a few things to a Description List. Ideally, I don't want to have to manually configure these options for every list in the document (its going to be big - a large book). I don't know LaTeX, so giving me latex code is pretty frustrating.

I want the item's tag/title to be in the typewriter font, and bold (standard is bold sans-serif since I'm using KOMA-Script's Book class). I want to reduce the indenting of the definition portion, and remove the spacing between descriptions. I enabled EnumItem in the Modules List (and yes, I read the instructions for EnumItem). In the Description, I have entered into the "Description Options" box

Code: Select all

[font=\ttfamily,itemsep=0pt,parsep=0pt,leftmargin=0.25cm]
This fixes the margin and spacing, but its printing "\ttfamily" as part of the item name. What is the correct way to set the font to TypeWriter? I've tried a bunch of things to no avail.

Finally, how do I make these changes for ALL Description Lists in the document instead of adding this bit of text to each one? From my research maybe Listings? How?

Editting my own post with an answer. I added the following to the LaTeX Preamble under Document Settings. Now I just need the FONT:

Code: Select all

\setlist{itemsep=0ex,parsep=1ex,leftmargin=0.25cm}
\setenumerate{itemsep=1ex,parsep=1ex}
\setitemize{itemsep=0ex,parsep=0ex,leftmargin=1cm}
If there is a better way for any of this (maybe a KOMA option?), by all means tell me!

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

Formatting a Description List

Post by Johannes_B »

I think this should be fairly easy adding

Code: Select all

\addtokomafont{descriptionlabel}{\ttfamily}
to your preamble.

Code: Select all

\documentclass{scrbook}
\usepackage{blindtext}
\begin{document}
\begin{description}
	\item [Something] text
\end{description}
\addtokomafont{descriptionlabel}{\ttfamily}
\begin{description}
	\item [Something else] text
\end{description}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
uudruid74
Posts: 6
Joined: Fri Jun 20, 2014 3:54 am

Re: Formatting a Description List

Post by uudruid74 »

That does it! And easily. I'd been trying to set the font using EnumItem and its appears it was easier to use a KOMA feature. Learning .. but slowly. I just wish there were GUI options for all this.

Thank You!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Formatting a Description List

Post by Johannes_B »

There are soooo many options you can set, either by packages or classes. You can even define your own options. Putting all that in a gui and make it clickable is impossible.

Once you got the hang of it, you know where to look up stuff and things will come out easy and good.

You might want to take a look at LyX tough. The lyX people are trying to make a clickable and easy to use environment. But only a part of all possibilities is implemented.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
uudruid74
Posts: 6
Joined: Fri Jun 20, 2014 3:54 am

Formatting a Description List

Post by uudruid74 »

Uhmm ...
You might want to take a look at LyX tough. The lyX people are trying to make a clickable and easy to use environment. But only a part of all possibilities is implemented.
This is the LyX forum right? I'm using LyX!

I realize you can't have ALL possible options, but I think the goal is to match the options available with a regular word processor while still having the LaTeX backend for quality and more options. A Gui dialog for setting the defaults of each "tag" (chapter, section/subsection, descriptions, etc) would be nice and not terribly difficult to implement if someone were reasonably fluent in LaTeX (I'm not).

I've been using LyX for about 15 years or so. Its the only thing I trust to not annoy the &^%! out of me because I can trust it to do the right thing rather than doing it wrong and making me manually fiddle with every paragraph to fix it (like Word). You just can't beat LaTeX for output quality and LyX makes it easy enough that my mom can do the basics. Until now, I've stuck to the basics and not mandated specific formatting, so I've never needed to fiddle with LaTeX parameteres. Now I'm writing a book and I want it to look a specific way (specific fonts, etc).
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Formatting a Description List

Post by Johannes_B »

Hi, i am reading so many post, and also write some of my own that sometimes, threads get confused.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply