← Back to team overview

ubuntu-developer-manual team mailing list archive

Re: Inline code and the pipe symbol (|)

 

Hey, Belinda.

On Mon, Jan 17, 2011 at 9:00 AM, Belinda Lopez
<belinda.lopez@xxxxxxxxxxxxx> wrote:
> Kevin,
>  this concerns me quite a bit b/c this resource will be housed as an online
> resource and I can see many folks wanting to simply cut and paste from the
> text.  I know this only affects raw source and not the final output it seems
> like an extra (unnecessary) step to have to edit all the source for this
> markup technique.  I would rather use the verbatim or something else rather
> than forcing authors and markup folks to have to alter code samples.  I
> think this introduces too many opportunities for errors in the process.

The code in the \begin{lstlisting} ... \end{lstlisting} environment is
considered verbatim and doesn't need to be modified.

The inline code in \lstinline|code| or simply |code| is also
considered verbatim and doesn't need to be modified.  If you have
inline code which itself contains a | character, you must use
\lstinline+code+ (where + is any character you wish to use as a
delimiter as long as it doesn't appear in that particular inline
code).

These are the same restrictions that apply to the verbatim environment
and \verb command.

The only time you need to use \textpipe is when you're *not* in a
verbatim-style environment (such as the terminal environment or just
randomly in the body text).

Does this address your concerns?  (I'm not quite sure I understand
what your concerns were, so let me know if I've misinterpreted.)

--Kevin



References