How can I prohibit page break at \\?
I tried \\* and it sometimes worked but sometimes not.
Here is a non-working example:
\documentclass{article}
\usepackage{geometry}
\geometry{textheight=2cm}
\begin{document}
1st line
2nd line
% Expected page break is here
3rd line\\*
4th line\\*% This line is on the 1st page
5th line% But this line appears on the 2nd page
\end{document}
I want to use \\ in description of file format.
I can't use verbose or lstlisting because I want to insert special elements.
Here is a simplified example:
\documentclass{article}
\usepackage{textcomp}
\newcommand{\meta}[1]{\textnormal{#1}}
\newcommand{\variable}[1]{\textnormal{\textlangle\textit{#1}\textrangle}}
\newenvironment{file}{\begin{quote}\normalfont\ttfamily}{\end{quote}}
\begin{document}
\begin{file}
[\variable{section}]\\
\variable{key} = \variable{value}\\
\variable{key} = \variable{value}\\
\meta{...}
\end{file}
\end{document}
\\\is almost never right. If you were to explain what your use case is, someone might be able to suggest a better approach. – Ian Thompson Nov 18 '14 at 13:27