Text Formattinghorizontal line in figure caption

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

horizontal line in figure caption

Post by yotama9 »

Hello.

Is there a way to insert a horizontal line in the figure captions?

I tried with using \line(1,0){3} but I get a long underscore (_) I tried using \raisebox{2pt}[0pt][0pt]{\line(1,0){3}} but I get the following error:
! TeX capacity exceeded, sorry [input stack size=5000].
Which I found indicate that latex might be stuck in a loop.

Thanks

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

horizontal line in figure caption

Post by Juanjo »

\line should be used inside the picture environment. Use

Code: Select all

\rule[dp]{wd}{hg}
which writes a black rectangle wd wide, hg high and located at dp from the baseline. If wd is "big" and hg is "small", you get an horizontal line. For example, \rule{2cm}{0.4pt} draws an horizontal line 2cm long, having a thickness of 0.4pt; \rule[-5pt]{2cm}{0.4pt} draws the same line 5pt below the baseline.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

horizontal line in figure caption

Post by localghost »

It's recommendable to raise the line in dependence of the font size.

Code: Select all

\rule[1ex]{2cm}{0.5pt}

Best regards
Thorsten
yotama9
Posts: 61
Joined: Thu Sep 24, 2009 2:59 pm

Re: horizontal line in figure caption

Post by yotama9 »

First of all thanks.

Second, my advisor saw the shapes in the figure captions and he didn't like them and told me to remove them so I doesn't have any use to it.

Sorry for wasting your time and thanks a lot. I hope I'll remember this thread on the next time I'll need such a thing.

Yotam
Post Reply