Text FormattingTypeset bold faced LaTeX commands

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Sasaman
Posts: 4
Joined: Sat Oct 16, 2010 3:08 pm

Typeset bold faced LaTeX commands

Post by Sasaman »

Please help!!!

How to write a BOLDED latex command(i don
t want to latex recognize it):" \icludegraphics "...

I try it with:" \verb \textbf{\includegraphics} " -that didn't worked.
i try it with:" \textbf{ \verb \includegraphics) } " -nothing. :/

Help,i need for exam.

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Typeset bold faced LaTeX commands

Post by frabjous »

If you hadn't mentioned that it was for an exam, I'd be much more prone to want to help. I'm a professor. I don't like the idea of other people doing my students' homework, so I'm not going to help do yours.
Sasaman
Posts: 4
Joined: Sat Oct 16, 2010 3:08 pm

Re: Typeset bold faced LaTeX commands

Post by Sasaman »

Exam is past now. I didn't get this comamnd on exam. I bag you to show me that command. Thanks anyway.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Typeset bold faced LaTeX commands

Post by frabjous »

Your professor gave you an exam question where you were supposed to do this, but then refused to tell you the right answer even after the exam was turned in? That's extremely weird.

Well, it depends a lot on what packages you want to use, and in what context you want the code to appear in. That's why the Board Rules ask for a minimal working example and not just a snippet. You also need to make sure that the typewriter font you're using actually has bold characters, since a lot them don't. But you can do it for example, with fancyvrb and the beramono font:

Code: Select all

\documentclass[a4paper,twoside]{report}
\usepackage[T1]{fontenc}
\usepackage{fancyvrb}
\usepackage{beramono}
\begin{document}
\begin{Verbatim}[fontseries=b]
\includegraphics
\end{Verbatim}
\end{document}
Sasaman
Posts: 4
Joined: Sat Oct 16, 2010 3:08 pm

Re: Typeset bold faced LaTeX commands

Post by Sasaman »

I didn't get this question on exam,but i need to know that. Listen,i'm new in Latex(and i don't like him) :). We use only this packeges now:

\documentclass[11pt,twocolumn]{article}
\usepackage[cp1250]{inputenc}
\usepackage[serbian]{babel}
\usepackage{amsmath,amssymb,amsfonts}
\begin{document}

I can't use \verb and \textbf in same line. :/ i tried with verbatim,but i didn't succed.

I need to write on the same line this:

"Using a packet \textbf{graphicx}, command (i need a bolded "\includegraphics") and environment \textbf{figure} in document we can insert images " last.

Sorry on my bad english,i'm from Montenegro. :)
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Typeset bold faced LaTeX commands

Post by frabjous »

If all you want is a bolded \includegraphics, in the normal font, then simply use:

Code: Select all

\textbf{\textbackslash includegraphics} 
If you need to use the \verb command, then it's tricky. It's even trickier if you can't change the preamble, given the fact that the default LaTeX font doesn't even have boldface typewriter fonts. If you really can't change the preamble, I suppose you could locally change the default tt font to Latin Modern typewriter bold and then use \verb.

Code: Select all

{\renewcommand{\encodingdefault}{T1}\renewcommand{\seriesdefault}{b}\renewcommand{\ttdefault}{lmtt} \verb|\includegraphics|}
But that's just absurd. It would be far better practice to add the appropriate packages.
Sasaman
Posts: 4
Joined: Sat Oct 16, 2010 3:08 pm

Re: Typeset bold faced LaTeX commands

Post by Sasaman »

I think that is "\textbackslash" command is my option. In school we don't use packages that we not learn yet.

Can you tell me a diference in these commands:

"$"
"$$"
"\begin{equation} \end{equation}"

Use simple words. ;)
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Typeset bold faced LaTeX commands

Post by frabjous »

Sorry, but this whole thing is getting on my nerves. It seems like I'm doing your homework, and I want no part of it.

Besides, if you don't know the difference between $, $$ and \begin{equation}, then you have no business using LaTeX at all. These are beginner topics, which would be covered in any introduction to LaTeX. See the resources for beginners.

You should know however, that $$ is considered obsolete. See l2tabu. Use \[ and \] instead.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Typeset bold faced LaTeX commands

Post by localghost »

Sasaman wrote:[…] Can you tell me a diference in these commands:

"$"
"$$"
"\begin{equation} \end{equation}"

Use simple words. […]
Please don't mix several range of subjects in one thread. You switch from a subject related to »Text Formatting« to one in »Math & Science«. frabjous already pointed you to some useful stuff for beginners. I recommend to follow the advice and do some basic reading.


Best regards and welcome to the board
Thorsten
Post Reply