Text FormattingMath Mode Error for bold Text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
smepal
Posts: 2
Joined: Wed Feb 01, 2012 12:30 pm

Math Mode Error for bold Text

Post by smepal »

Dear community,

I've been investigating a lot of time to solve this issue, but wasn't able to.

The code:

Code: Select all

\documentclass[12pt,a4paper,onecolumn, bibliography=totoc,listof=totoc]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage[ngerman]{babel}
\usepackage[ngerman]{translator}

\begin{document}

Dem Attribut \texttt{APPLICATION_ID} wird die Applikationskennung zugeordnet und dem Attribut \texttt{APPLICATION_CONNECTION_ID} wird die Gerätekennung mit dem Suffix "`_APPLICATION_ID"' zugeordnet. Problematisch wird zum Zeitpunkt der Implementierung die Zuordnung der Gerätekennung gesehen. Durch Tests wurde herausgefunden, dass die \texttt{APPLICATION_CONNECTION_ID} im Gegensatz zur Dokumentation nicht, wie oben beschrieben, verwendet werden kann, sondern der \texttt{NUMERIC_ID} 

\end{document}
So I don't get it? Can anyone help?

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Math Mode Error for bold Text

Post by localghost »

The underscore (_) is reserved for subscripts in math mode. If you want to use it outside math mode, you have to introduce it with a backslash.

Code: Select all

APPLICATION\_ID
Alternatively you can use the \textunderscore command.


Best regards and welcome to the board
Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Math Mode Error for bold Text

Post by Stefan Kottwitz »

Hi,

welcome to the board!

The reason is, that the underscore has a meaning in math mode, for typesetting subscripts. You can use \_ in text mode for all occurences, such as

Code: Select all

\texttt{APPLICATION\_CONNECTION\_ID}
Or, load the underscore package in your preamble, which takes care of the underscores, so you don't need to quote them by a preceding backslash:

Code: Select all

\usepackage{underscore}
Stefan
LaTeX.org admin
Post Reply