I am using the catchfilebetweentags
library to store equations in an external file and then import them into my document. This is useful when you need to use the same equation in multiple documents. This works for simple equations, but introduces an offset error when used with the multicols
package. Does anyone know of a solution to this problem?
MWE
main.tex
\documentclass{article}
\usepackage{amsmath}
\usepackage{catchfilebetweentags}
\usepackage{multicol}
\newcommand{\loadeq}[1] {
\ExecuteMetaData[./equations.tex]{eq#1}
}
\begin{document}
Loading equations from external file:
\loadeq{001}
Local equations:
\begin{multicols}{2}
\begin{equation}
\label{equ:X2}
X =
\begin{bmatrix}
X_0 \\
X_1 \\
X_2 \\
X_3
\end{bmatrix}
\end{equation}
\begin{equation}
\label{equ:Y2}
Y =
\begin{bmatrix}
Y_0 \\
Y_1 \\
Y_2 \\
Y_3
\end{bmatrix}
\end{equation}
\end{multicols}
\end{document}
equations.tex
\documentclass{article}
\begin{document}
%<*eq001>
\begin{multicols}{2}
\begin{equation}
\label{equ:X}
X =
\begin{bmatrix}
X_0 \\
X_1 \\
X_2 \\
X_3
\end{bmatrix}
\end{equation}
\begin{equation}
\label{equ:Y}
Y =
\begin{bmatrix}
Y_0 \\
Y_1 \\
Y_2 \\
Y_3
\end{bmatrix}
\end{equation}
\end{multicols}
%</eq001>
\end{document}