LyXHow to write theorem heading in bold font

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
ALIX
Posts: 11
Joined: Tue Apr 05, 2011 12:45 am

How to write theorem heading in bold font

Post by ALIX »

Hi everybody,
I want to write (Remark) as bold font, like: Theorem, Lemma, Definition, etc.
Please can any one tell me how?

Thanks
Last edited by ALIX on Mon Mar 12, 2012 8:38 pm, edited 1 time in total.

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

justdeath
Posts: 69
Joined: Mon Sep 05, 2011 10:27 am

How to write theorem heading in bold font

Post by justdeath »

I installed LyX, looks weird to me.

But anyway, open your document, go to the place where you want to input the remark, then press Insert TeX code (Ctrl+L).

Paste this before the usage of the custom remark:

Code: Select all

\newtheoremstyle{remboldstyle}
  {}{}{}{}{\bfseries}{.}{.5em}{{\thmname{#1 }}{\thmnumber{#2}}{\thmnote{ (#3)}}}
\theoremstyle{remboldstyle}
\newtheorem{rembold}{Remark}[section]
The number of the remark will depend on sections.

Now you again Insert TeX code where you want to write the remark, just this code:

Code: Select all

\begin{rembold}
Write the body of the remark, and close it by:

Code: Select all

\end{rembold}
And view the document.



Technical stuff below.

Well, the command is not obvious:

Code: Select all

\documentclass{article}
\usepackage{amsthm}

\newtheoremstyle{remboldstyle}
  {}{}{\itshape}{}{\bfseries}{.}{.5em}{{\thmname{#1 }}{\thmnumber{#2}}{\thmnote{ (#3)}}}
\theoremstyle{remboldstyle}
\newtheorem{rembold}{Remark}[section]

\begin{document}
\section{Section}

\begin{rembold}[Cauchy]
The text of the remark.
\end{rembold}

\end{document}
If you want normal text, remove \itshape, just make it {}. Same applies for \bfseries.

Nikolay
ALIX
Posts: 11
Joined: Tue Apr 05, 2011 12:45 am

Re: Bold Font

Post by ALIX »

Thank u so much Nikolay,
but there is a problem, for example, when I write Theorem 1.1.1, and then Lemma 1.1.2, and I want to write the Remark by using this code, becomes Remark 1.1.1
So, is there any way to become Remark 1.1.3 for example?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

How to write theorem heading in bold font

Post by Stefan Kottwitz »

Hi Alix!

as, thanks to the very good explanation of Nikolay, the original problem has been solved, it would be good to open a new topic for the new problem. You can imagine, that nobody would expect a theorem numbering issue in a "Bold Font" topic. Readers, who could help, might overlook your new question. So a new topic with a new and expressive topic subject would be the best.

Anyway, I saw your question and try to help. You could share counters for the theorem environment. This means using another \newtheorem syntax for theorem environments which are based on other such environments:

Code: Select all

\newtheorem{<environment name>}[<numbered like environment>]{<caption>}
For example, if your first theorem environment is called theorem, you may define

Code: Select all

\newtheorem{lemma}[theorem]{lemma}
\newtheorem{rembold}[theorem]{Remark}
and now lemmas and remarks are numbered following the theorem counter.

Stefan
LaTeX.org admin
ALIX
Posts: 11
Joined: Tue Apr 05, 2011 12:45 am

Re: Bold Font

Post by ALIX »

Yes, you're right thank you :) .
Post Reply