0

I'm trying to create a pdf of formulas for a class I'm taking. I have many code snippets as follows, one of which I've presented as a subset of my document below:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{proof, environ, array}
\begin{document}

\section{Propositional Logic}

\subsection{Introduction of $\wedge$}
    \begin{align*}
      \infer[\rulename{\wedge_i}]
      {\alpha \wedge \beta}
      {\alpha && \beta}
    \end{align*}
    (If you have derived $\alpha$ and $\beta$, then you can conclude $\alpha \wedge \beta$.)
\end{document}

On every single instance of an equation formatted as above, I get an error on the \end{align*} line. The error is shown below:

! Undefined control sequence.
<recently read> \rulename 

l.21     \end{align*}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

For the most part, I have one equation per subsection, as above. If I have more than one equation per subsection, I get this error on all the \end{align*} commands within a subsection.

Thanks in advance for any help.

EDIT: It seems that \rulename is a rule specified by the professor whose equations I copied, but it is not defined within the source file I copied from. The effect I'm trying to achieve looks as follows: Desired effect of my command

Any tips as to how I can achieve this are appreciated!

  • Welcome to TeX.SX! \rulename doesn't seem a command defined by the proof package. Where did you find it? – egreg Apr 24 '18 at 9:45
  • @egreg Thanks! The professor for this class has provided his slides in both pdf and LaTeX source for each individual slide. I basically lifted the align* section from his slides, and pasted it into a subsection with the proof library. I have no idea where \rulename comes from, despite my efforts to try and find out. I'd love to know, but I'm also open to alternatives. – J. Burley Apr 24 '18 at 9:50
  • Apparently your teacher has a definition for it, but it's impossible to guess at it without at least seeing the output. – egreg Apr 24 '18 at 9:54
  • take the latex source and add \show\rulename and tex will stop (as if for an error) and show you how \rulename is defined – David Carlisle Apr 24 '18 at 10:04
  • @egreg I've modified the question to include a screenshot of the intended output of this command, if that helps you determine what the rule may do. – J. Burley Apr 24 '18 at 10:05
0

Since no definition of \rulename is provided, it's hard to guess. However, I can reproduce the output with a “dummy” definition for it, so it possibly is just for markup (and good for possible redefinitions).

\documentclass{article}

\usepackage{amsmath}
\usepackage{proof}

\newcommand{\rulename}[1]{#1}

\begin{document}

\section{Propositional Logic}

\subsection{Introduction of $\wedge$}
\begin{equation*}
 \infer[\rulename{\wedge_i}]
   {\alpha \wedge \beta}
   {\alpha && \beta}
\end{equation*}
(If you have derived $\alpha$ and $\beta$, then
you can conclude $\alpha \wedge \beta$.)

\end{document}

I have minimized the example; don't use align* as a surrogate for equation* when there is just one line.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.