A command to emphasize a short content

24 views
Skip to first unread message

luciano de souza

unread,
Nov 25, 2012, 6:50:48 AM11/25/12
to latexusersgroup
Hello listers,
Is there a Latex command to enclose a phrase in a centralized box? The
ideia is to give a big enphasis to a short content.
The content is mine, so I think is not appropriate to use quotation.
Actually, I am explaining something about the HTTP protocol. After
some explanation, as an example of HTTP request, I will say:

get http://www.mydearlatex.org http/1.1

How could I enphasize it with a Latex command?
Regards,
Luciano

Peter Flynn

unread,
Nov 25, 2012, 7:48:44 AM11/25/12
to latexus...@googlegroups.com
On Sun, Nov 25, 2012 at 11:50 AM, luciano de souza <luch...@gmail.com> wrote:
Hello listers,
Is there a Latex command to enclose a phrase in a centralized box?

For example:

\begin{center}
\fbox{A short phrase}
\end{center}
 
The idea is to give a big emphasis to a short content.

The content is mine, so I think is not appropriate to use quotation.

Correct. You could say

\newcommand{\important}[1]{%
   \begin{center}\fbox{#1}\end{center}}
 
Actually, I am explaining something about the HTTP protocol. After
some explanation, as an example of HTTP request, I will say:

get http://www.mydearlatex.org http/1.1

How could I emphasize it with a Latex command?

I wouldn't center examples, because they will all be different widths and will look very odd. I'd use the listings package and define the HTTP vocabulary so that it auto-highlights the keywords, eg

\documentclass{article}
\usepackage[svgnames]{xcolor}
\usepackage{listings,parskip}
\lstdefinelanguage{HTTP}
  {morekeywords={get,put,head},
  }[keywords,comments,strings]
\lstloadlanguages{[LaTeX]TeX,HTTP}
\lstset{basicstyle=\color{Black}\ttfamily,
  keywordstyle=\color{DarkGreen}\bfseries,
  identifierstyle=\color{DarkBlue}\upshape,
  commentstyle=\color{Gray}\upshape,
  stringstyle=\color{DarkRed}\upshape,
  emphstyle=\color{MediumBlue}\itshape,
  showstringspaces=false,
  columns=fullflexible,
  keepspaces=true,
  frame=single}
\begin{document}
The common form of a HTTP request looks like this
\begin{lstlisting}[language={HTTP}]
\end{lstlisting}
\end{document}

///Peter
Reply all
Reply to author
Forward
0 new messages