Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

Hi, I am getting a LaTex error with Cadabra 2.2.1(d) I have Anaconda3-5.2.0 and miktex 2.9.6813. I tried uninstalling and reinstalling them multiple times. My OS is Windows 10. I have other installations of python on my laptop but Anaconda is my default. MikTex is the only tex editor I have installed.

The error looks like this -

Generic typesetting error; LaTeX failed. Please report a bug.

. See sglw.2.tex to debug this.

TEXINPUTS = C:\Program Files\Cadabra2/share/cadabra2/latex/:
TMPDIR = C:\Users\User\AppData\Local\Temp\

Thank you for your help

asked in Bug reports by (120 points)

1 Answer

0 votes

Once that happens, can you open a command line window, navigate to the TMPDIR path, and do

pdflatex [filename]

where filename is, in the example above, sglw.2.tex. Then send me the resulting error message (if any).

It is possible that MikTeX is installed to not download missing packages, or perhaps the pdflatex command is not in your path, but I can't see that from the error message you quoted.

answered by (37.9k points)

I couldn't run the pdflatex command for some reason but I opened the file in MikTex manually and it compiled to a blank pdf. So here is the source code for that file (sorry, it's probably annoying to read)-

\documentclass[11pt]{article}
\usepackage[dvips,verbose,voffset=0pt,hoffset=0pt,textwidth=171.32mm,textheight=1713.2mm]{geometry}
\usepackage{hyperref}
\usepackage{setspace}
\usepackage[fleqn]{amsmath}
\usepackage{color}
\usepackage{etoolbox}
\usepackage{amssymb}
%\usepackage{inconsolata}
\usepackage[parfill]{parskip}
%\usepackage{tableaux}
\def\specialcolon{\mathrel{\mathop{:}}\hspace{-.5em}}
\renewcommand{\bar}[1]{\overline{#1}}
\newcommand{\algorithm}[2]{{\tt\Large\detokenize{#1}}\[1ex]
{\emph{#2}}\[1ex]
}
\newcommand{\property}[2]{{\tt\Large\detokenize{#1}}\[1ex]
{\emph{#2}}\[1ex]
}
\newcommand{\algo}[1]{{\tt \detokenize{#1}}}
\newcommand{\prop}[1]{{\tt \detokenize{#1}}}

% Math expressions wrapped in \brwrap will get typeset with
% round brackets around them, which have the appropriate size.
% The expression itself can still be broken over multiple lines.

\newcommand\brwrap[3]{%
\setbox0=\hbox{$#2$}
\left#1\vbox to \the\ht0{\hbox to 0pt{}}\right.\kern-.2em
\begingroup #2\endgroup\kern-.15em
\left.\vbox to \the\ht0{\hbox to 0pt{}}\right#3
}
%\message{\meaning\brwrap{\frac{A}{B}}}
\everymath{\makeatletter\def\old@comma{,}\catcode`\,=13 \def,{%
\ifmmode\old@comma\discretionary{}{}{}\else\old@comma\fi}\makeatother}

% \left.\vbox to \brwrapht {\hbox to 0pt{!}}\right)%

% Long formulas are much easier to read if they break such that
% the '+' or '-' sign ends up on the next line, not at the end
% of the previous

% \makeatletter
% \newcommand{\DeclareMathActive}[2]{%
% % #1 is the character, #2 is the definition
% \expandafter\edef\csname keep@#1@code\endcsname{\mathchar\the\mathcode#1 } % \begingroup\lccode~=#1\relax % \lowercase{\endgroup\def~}{#2}% % \AtBeginDocument{\mathcode#1="8000 }%
% }
%
% \DeclareMathActive{+}{\mathbreak\std{+}}
%
% \newcommand{\std}[1]{\csname keep@#1@code\endcsname}
% \patchcmd{\newmcodes@}{\mathcode\-\relax}{\std@minuscode\relax}{}{\ddt} % \AtBeginDocument{\edef\std@minuscode{\the\mathcode-}}
% \makeatother
%
% \def\mathbreak{\discretionary{}{}{}}
%

% Typesetting Young tableaux, originally in a separate style
% file, now included to avoid path searching problems.
% Some internals for the typesetting macros below; nothing
% user-servicable here; please read on.

\def\@tabforc#1#2#3{\expandafter\tabf@rc\expandafter#1{#2 \^}{#3}}
\def\tabf@@rc#1#2#3\tabf@@rc#4{\def#1{#2}#4\tabf@rc#1{#3}{#4}}
\long\def\ReturnAfterFi#1\fi{\fi#1}
\def\tabf@rc#1#2#3{%
\def\temp@ty{#2}%
\ifx\@empty\temp@ty
\else
\ReturnAfterFi{%
\tabf@@rc#1#2\tabf@@rc{#3}%
}%
\fi
}%

% Sorry, some global registers for sizes and keeping track of
% measurements.

\newdimen\ytsize\ytsize=2mm
\newdimen\ytfsize\ytfsize=4mm
\newcount\repcnt
\newdimen\acchspace
\newdimen\accvspace
\newdimen\raiseh
\newdimen\maxw

\newcommand\phrule[1]{\hbox{\vbox to0pt{\hrule height .2pt width#1\vss}}}

% Typeset a Young tableau with filled boxes. Takes a single
% argument which is a string of symbols for each row,
% separated by commas. Examples:
%
% \ftableau{abc,de}
% \ftableau{ab{d2},f{g3}}

\newcommand\ftableau[1]{%
\def\ctest{,}
\def\Ktest{\^}
\acchspace=0ex
\accvspace=0ex
\maxw=0ex
\vbox{\hbox{%
\@tabforc\thisel{#1}{%
\ifx\thisel\Ktest{%
\ifnum\maxw=0\maxw=\acchspace\fi%
\raisebox{\accvspace}{\vbox to \ytfsize{\hbox to
0pt{\vrule height \ytfsize\hss}}}\kern\acchspace\kern-\maxw}
\else\ifx\thisel\ctest
\ifnum\maxw=0\maxw=\acchspace\fi%
\raisebox{\accvspace}{\vbox to \ytfsize{\hbox to 0pt{\vrule height \ytfsize\hss}}}%
\kern\acchspace\acchspace=0ex
\advance\accvspace by -\ytfsize
\else
\setbox3=\hbox{$\thisel$}%
\raiseh=\ytfsize%
\advance\raiseh by -1ex%
\divide\raiseh by 2%
\advance\acchspace by-\ytfsize%
\raisebox{\accvspace}{\vbox to \ytfsize{\hrule\hbox to%
\ytfsize{\vrule height \ytfsize\hskip.5ex%
\raisebox{\raiseh}{\tiny$\thisel$}\hss}\vss\phrule{\ytfsize}}}%
\fi\fi}}}}

% Typeset a Young tableau with unlabelled boxes. Takes a single
% argument which is a string of numbers, one for the length of
% each row of the tableau. Example:
%
% \tableau{{10}{8}{3}}
%
% typesets a tableau with 10 boxes in the 1st row, 8 in the 2nd
% and 3 in the 3rd. Curly brackets can be omitted if numbers
% are less than 10.

\newcommand\tableau[1]{%
\def\stest{ }
\def\Ktest{\^}
\acchspace=0ex
\accvspace=0ex
\maxw=0ex
\hbox{%
\@tabforc\thisel{#1}{%
\ifx\thisel\Ktest{}
\else
\repcnt=\thisel%
\loop{}%
\advance\acchspace by-\ytsize%
\raisebox{\accvspace}{\vbox to \ytsize{\hrule \hbox to%
\ytsize{\vrule height \ytsize\hss}\vss\phrule{\ytsize}}}%
\advance\repcnt by -1\ifnum\repcnt>1{}\repeat%
\ifnum\maxw=0\maxw=\acchspace\fi%
\raisebox{\accvspace}{\vbox to \ytsize{\hbox to 0pt{\vrule height \ytsize\hss}}}%
\kern\acchspace\acchspace=0ex%
\advance\accvspace by -\ytsize%
\fi}\kern-\maxw}}

% Document start.

\begin{document}
\pagestyle{empty}\everymath{\displaystyle}
\renewcommand{\arraystretch}{1.2}
\tolerance=10000
\relpenalty=10
\binoppenalty=10
\hyphenpenalty=10
\raggedright

% Ensure that maths broken over multiple lines has a bit of spacing
% between lines.
\lineskiplimit=0mm
\lineskip=1.5ex
{\color{red}{\begin{verbatim}SyntaxError: ('unexpected character after line continuation character', ('', 2, 4, '\mu\n'))\end{verbatim}}}
\eject
\end{document}

The fact that you could not start pdflatex from the command line is your problem. You need to get that sorted, because if you cannot start it yourself, neither can Cadabra. Some PATH setting is wrong.

(The pdf file which you produced looks empty, but isn't, it just has weird page dimensions. In any case, that's not the problem).

Yep, my PATH environment variable wasn't updated properly. It works now, thank you so much! This is awesome! My professor will be really happy that we can use this for research :)

Ok, very good!

...