I am using the listings package to represent verbatim font with breaklines set to true so that line breaks are produced automatically. I have set \emergencystretch to an abnormally large value since it seems the best way to produce (relatively) good looking text without manually editing the formatting all over the place.
However, when the line is broken immediately after a \lstinline (shorthand form of = used in the example below), a space is placed at the start of the following line. How to I remove this space automatically?
\documentclass[10pt,a5paper]{book}
\usepackage{listings}
\lstset{breaklines=true,basicstyle=\ttfamily}
\lstMakeShortInline=
\setlength{\emergencystretch}{35pt}
\begin{document}
Blah blah blah, standard text to highlight that usually the line breaks are normal and no space follows them. The actual issue is highlighted in the next paragraph.
OK. My name is Eddie. This is my first question. =How quick= will it be answered? Only time will tell. Seriously though, it would be nice to get an answer within about 3 and a half minutes.
\end{document}
Produces: (check the space between "quick" and "will" - end of first line, second paragraph.
My initial thought was to specify \lstset{...postbreak=\ignorespaces} but this doesn't work since the linebreak occurs after the \lstinline.
Perhaps it is possible to use a \ifthenelse statement but it would require me to have a switch which lets me know if a linebreak is produced following a \lstinline command (could be hassle since this will only be determined after typesetting).
Any ideas would be massively appreciated.
{}
or ctrl-k key and it will show the block as code. Actually it's a very good question, nice example and answer isn't exactly obvious:-)