Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.37 KB | None | 0 0
  1. \documentclass{article}
  2. \usepackage{mathpartir}
  3. \begin{document}
  4.  
  5. \newcommand{\testa}{
  6.  This is the intended use:
  7.  \begin{mathpar}
  8.    \inferrule*{
  9.      1\\
  10.      2
  11.    }{
  12.      3
  13.    }
  14.  \end{mathpar}
  15. }
  16.  
  17. \newcommand{\testb}{
  18.   % LaTeX Error: \begin{mathpar} on input line 68 ended by \end{lines}. [\testb]
  19.   But (because the code is generated), I have an environment in the rule:
  20.   \newenvironment{lines}{}{}
  21.  \begin{mathpar}
  22.    \inferrule*{
  23.      \begin{lines}
  24.        1\\
  25.        2
  26.      \end{lines}
  27.    }{
  28.      3
  29.    }
  30.  \end{mathpar}
  31. }
  32.  
  33. \newcommand{\testc}{
  34.  If \textbackslash\textbackslash is renamed \textbackslash{}plop, it works (or well, the output isn't what is expected but I know how to fix it and at least it compiles):
  35.  
  36.  \newcommand{\plop}{\\\relax}
  37.  \newenvironment{lines}{}{}
  38.  \begin{mathpar}
  39.    \inferrule*{
  40.      \begin{lines}
  41.        1\plop
  42.        2
  43.      \end{lines}
  44.    }{
  45.      3
  46.    }
  47.  \end{mathpar}
  48. }
  49.  
  50. \newcommand{\testd}{
  51.   % LaTeX Error: \begin{mathpar} on input line 70 ended by \end{lines}. [\testd]
  52.   And it's not the \textbackslash{}relax that fixes it:
  53.  \newenvironment{lines}{}{}
  54.  \begin{mathpar}
  55.    \inferrule*{
  56.      \begin{lines}
  57.        1\\\relax
  58.        2
  59.      \end{lines}
  60.    }{
  61.      3
  62.    }
  63.  \end{mathpar}
  64. }
  65.  
  66. % Line 66
  67. %\testa
  68. \testb
  69. %\testc
  70. %\testd
  71.  
  72.  
  73. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement