1

I am using acm template and want < and > bracket. I checked out some posts regarding this question and they have suggested to use \left and \right. But the problem is when I use them, they give me error saying ! Missing delimiter (. inserted). I want to write html code like <html>.

I do not want the elongated '<' which is a delimiter from mathsymbols. I want the simple '<'.

Here is the sample code

\documentclass[prodmode,acmtecs]{acmsmall}

% Package to generate and customize Algorithm as per ACM style
\usepackage[ruled]{algorithm2e}
\usepackage{listings}
\usepackage{array}
\renewcommand{\algorithmcfname}{ALGORITHM}
\SetAlFnt{\small}
\SetAlCapFnt{\small}
\SetAlCapNameFnt{\small}
\SetAlCapHSkip{0pt}
\IncMargin{-\parindent}

% Document starts
\begin{document}

% Title portion
\title{Some Title}
\author{Some Name
\affil{Some University}}
\maketitle

$\left$ source $\right$
\end{document}

But if I use $\langle$ and $\rangle$ it doesn't give me any error but gives weird left and right angles.

1 Answers1

3

I would suggest creating a command that would represent your HTML tags. Something like \htmltag:

enter image description here

\documentclass{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\newcommand{\htmltag}[1]{%
  \scalebox{.6}[1]{$<$}{\ttfamily#1}\scalebox{.6}[1]{$>$}%
}
\begin{document}
There is \htmltag{source} and also \htmltag{img}.
\end{document}​

graphicx's \scalebox is used to shrink < and > horizontally (to 60% of its original width) while maintaining its vertical height. You can substitute this for any other symbol (like \langle and \rangle) if you wish, and also modify the .6 horizontal scale parameter or remove the scaling altogether. You don't need to resize the delimiters using \left and \right.

For now the contents is set using \ttfamily. However, depending on the usage, you may wish to put it in an \mbox to avoid breaking at the text block boundary if your tags are comprised of multiple words.

Werner
  • 603,163