Tag Info

New answers tagged

4

Here's a slightly modified version of what you wrote: \documentclass{article} \usepackage{lmodern} \usepackage{listings,xcolor,etoolbox} \definecolor{verbgray}{gray}{0.9} \newcommand*\prompt{}% empty default \lstnewenvironment{sh}{% % redefine bash prompt: \def\prompt{user@linux:\textasciitilde\$\space}% \lstset{backgroundcolor=\color{verbgray}, ...


3

The problematic line is alsoletter={@,=,>,}, You shouldn't use commas to delimit the characters you want to declare as "letters". If you do, listings takes those commas literally and declares the comma itself as a "letter"; as a result, listings treats if, as an identifier distinct from if. Correct alsoletter syntaxes include alsoletter={@=>}, ...


4

This is what you can do. Define your glossary entry as \newglossaryentry{vector} { name={$\bm{v}$}, description={vector}, user1={$v$} } and then use \glsuseri{vector} when you want the non-bold version. MWE % arara: pdflatex % arara: makeglossaries % arara: pdflatex % arara: pdflatex \documentclass{article} \usepackage[utf8]{inputenc} ...


0

In order to have just one command for both bold text and bold math, one can use the solution suggested on LaTeX Community (/forum/viewtopic.php?t=10866&f=44#p42084, link not allowed). Editing this solution slightly in order to incorporate the bm package, one could use the following. \usepackage{bm} \newcommand*{\B}[1]{\ifmmode\bm{#1}\else\textbf{#1}\fi} ...



Top 50 recent answers are included