Page LayoutDefine a simple Layout with underlined words

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
det
Posts: 5
Joined: Sun Feb 06, 2011 11:38 am

Define a simple Layout with underlined words

Post by det »

I'd like to define a simple layout for typesetting my math lecture notes.

I'd like to use underlines for one word of certain logical paragraphs like "sentence:" oder "reminder:".

How to define a simple group for this? I'd like the underlines to be thicker than \underline and also to stop right at the middle of the closing colon. Also it should be at a fixed position (not lower if there's a 'g', 'j' but rather strike through).
How to set up a group for this?

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

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Define a simple Layout with underlined words

Post by Frits »

This can be done with the soul package. I wrote something about it on my blog, you can read it here.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
det
Posts: 5
Joined: Sun Feb 06, 2011 11:38 am

Re: Define a simple Layout with underlined words

Post by det »

thanks!, this improves the underlining.
Weird thing though is the lines aren't perfect, but there are minimal joints visible, e.g. spots where the line is blacker.

Next step for me now would be: How to define a paragraph style?, so one logical paragraph begins with an underlined word marking the content and then follows arbitrary content.
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Define a simple Layout with underlined words

Post by Frits »

I don't see those joints on my mac. Are they still visible if you print the page? I know that something similar happens when using \underbrace.

Anyway, probably the easiest way to customize the first word of a paragraph would be to define

Code: Select all

\def\parstart #1 {\ul{#1} }
Note that you need the soul package (for the \ul command). Now, begin your paragraph with \parstart:

Code: Select all

\parstart This is the first sentence of a paragraph
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
Post Reply