# Making this text look good

I have some problems making this text look good:

This is the LaTeX code I have right now:

$$\begin{split} alert\ http\ \EXTERNAL\_NET\ any\ \rightarrow \HOME\_NET\ any\ (msg:"Hacker\ is\ here!";\ \\ dsize:>100;\ type:"response";\ content:"Bootstrap";\ sid:123;) \end{split}$$


I would appreciate all help to try to make this look better. I know I can't get it on one line but it does not have to be an equation either so the 3.1 is not needed. But maybe you have some ideas? I also don't like the spaces that are automatically added in an equation before the colons.

• To help future users with the same problem find your question, please use more informative titles for your posts which describe the actual problem and not just some generic "make something look good" – user36296 Mar 15 at 14:12

I like this way

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{array}{l} \text{alert http }\EXTERNAL\_NET\ any\rightarrow \HOME\_NET\ any\\ (\\ \qquad\begin{array}{l@{\ }cl} msg&:&\text{Hacker is here!''};\\ dsize&:&>100;\\ type&:&\text{response''};\\ content&:&\text{Bootstrap''};\\ sid&:&123;\\ \end{array}\\ ) \end{array}$
\end{document}


Note: be decisive. Choose the best of your answers to tick the accept mark. In your previous question, I see that you tick all answers, but you can only accept one of them! (But the current accepted answer is good, I think.)

• Hey! This looks perfect. Thank you very much for the help @JouleV – Johan Mar 15 at 12:21
• @Johan You are welcome! – JouleV Mar 15 at 12:21

You should take your time to think about a consistent format for such objects.

Here's an attempt. Remember to define macros for different types of objects, so that it will be easy to change format if you (or other people) so wish.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\envvar}[1]{\texttt{\\$#1}}
\newcommand{\tdesc}[1]{\textup{#1''}}

\begin{document}

$\begin{tabular}{@{}l@{}} alert http \envvar{EXTERNAL\_NET} any \\ \qquad \rightarrow \envvar{HOME\_NET} any ( \begin{tabular}[t]{@{}l@{ }c@{ }l@{}} msg &:& \tdesc{Hacker is here!}; \\ dsize &:& >100; \\ type &:& \tdesc{response}; \\ content &:& \tdesc{Bootstrap}; \\ sid &:& 123; ) \end{tabular} \end{tabular}$

\end{document}