Saturday, June 18, 2016

TeX capacity exceeded, sorry [main memory size=5000000]

LaTeX is a weird bird. I ran out of memory. The solution: add the line "main_memory = 8000000" to the file /usr/local/texlive/2015/texmf.cnf
$ sudo fmtutil-sys --all
It's worth noting that 8000000 seems to be the maximum value.

Friday, June 17, 2016

\strip@pt undefined in LaTeX, and the fix.

I could not get the statement \strip@pt in LaTeX to parse. It would always just give an undefined value. The solution is to change context, which is such as hack, but that's how you do it.
\documentclass[journal,letterpaper]{IEEEtran}
\usepackage{fp}     

\begin{document}
\newcommand\bitfieldwidth{32}  
\newcommand\bitfielddivision{8}
\makeatletter
\FPeval{\bitcolumnwidth}{(\strip@pt\textwidth) / \bitfieldwidth}
\makeatother

\begin{tabular}{|c|c|}
\hline
variable & value \\
\hline
textwidth &\the\textwidth \\
\hline
columnwidth &\the\columnwidth \\
\hline
bitcolumnwidth &$\bitcolumnwidth$ \\
\hline
\end{tabular}

\end{document}
The rendered table is: