2

LyX refuses to compile any xymatrix containing \varprojlim $\varprojlim$ and \varinjlim $\varinjlim$. (How) Can this be fixed?

Edit: Here's an example of non-working code.

% Preview source code

%% LyX 2.1.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,hebrew]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9,cp1255]{inputenc}
\usepackage[all]{xy}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

% The following chunk fixes export with XeTeX.
% It is needed because polyglossia is used by default
% and \make@lr is only defined by babel.
\@ifundefined{make@lr}
{\def\make@lr#1{\begingroup
    \toks@=\expandafter{#1}%
    \edef\x{\endgroup
  \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
  \x}}{\relax}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{amsmath}
\usepackage{braket}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}
\usepackage{lmodern}
\usepackage{manfnt}
\usepackage{dsfont}
\usepackage{xcolor}
\usepackage{xypic}
\xyoption{2cell}
\UseAllTwocells
\usepackage{tensor}
\CompileMatrices

\def\mymathhyphen{{\hbox{-}}}

\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}

\newcommand{\naturalto}{%
  \mathrel{\vbox{\offinterlineskip
    \mathsurround=0pt
    \ialign{\hfil##\hfil\cr
      \normalfont\scalebox{1.2}{.}\cr
%      \noalign{\kern-.05ex}
      $\longrightarrow$\cr}
  }}%
}

\makeatother

\usepackage{babel}
\begin{document}

\title{קטגוריות}

\maketitle
    \L{
\[
\xymatrix{\varprojlim F\ar[rr]^{v} &  & F\ar[rr]^{u}\ar@{-}[dd] &  & \varinjlim                              F\ar@{-->}[dd]\\
\\
A\ar[rr]_{t}\ar@{-->}[uu] &  & F\ar[rr]_{\eta} &  & A
}
\]
}
\end{document}
4
  • 2
    Can you show an example of non working code?
    – egreg
    Commented Nov 5, 2014 at 14:47
  • Are you sure that amssymb package is loaded?
    – yo'
    Commented Nov 5, 2014 at 15:16
  • I have a non-working code. What is the proper way to enter code here?
    – Exterior
    Commented Nov 5, 2014 at 15:18
  • Update your question. Since you are using LyX and most of us do not, please post LaTeX code.
    – daleif
    Commented Nov 5, 2014 at 15:19

2 Answers 2

2

I had to remove [hebrew] and the Hebrew text in title from your example in order to make it work in my installation of TeXlive 2013. I realized that probably you just need to use \protect\varinjlim and \protect\varprojlim inside \xymatrix. The following works for me:

% Preview source code

%% LyX 2.1.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english
%,hebrew
]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9,cp1255]{inputenc}
\usepackage[all]{xy}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

% The following chunk fixes export with XeTeX.
% It is needed because polyglossia is used by default
% and \make@lr is only defined by babel.
\@ifundefined{make@lr}
{\def\make@lr#1{\begingroup
    \toks@=\expandafter{#1}%
    \edef\x{\endgroup
  \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
  \x}}{\relax}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{amsmath}
\usepackage{braket}
\usepackage{graphicx}
\usepackage[a4paper]{geometry}
\usepackage{lmodern}
\usepackage{manfnt}
\usepackage{dsfont}
\usepackage{xcolor}
\usepackage{xypic}
\xyoption{2cell}
\UseAllTwocells
\usepackage{tensor}
\CompileMatrices

\def\mymathhyphen{{\hbox{-}}}

\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}

\newcommand{\naturalto}{%
  \mathrel{\vbox{\offinterlineskip
    \mathsurround=0pt
    \ialign{\hfil##\hfil\cr
      \normalfont\scalebox{1.2}{.}\cr
%      \noalign{\kern-.05ex}
      $\longrightarrow$\cr}
  }}%
}

\makeatother

\usepackage{babel}
\begin{document}

\title{foobar}%{קטגוריות}

\maketitle
    \L{
\[
\xymatrix{\protect\varprojlim F\ar[rr]^{v} &  & F\ar[rr]^{u}\ar@{-}[dd] &  & \protect\varinjlim                              F\ar@{-->}[dd]\\
\\
A\ar[rr]_{t}\ar@{-->}[uu] &  & F\ar[rr]_{\eta} &  & A
}
\]
}
\end{document}
3
  • Actually it is because of the \CompileMatrices, without it the \protect is not needed (took me a while to fine that one).
    – daleif
    Commented Nov 5, 2014 at 15:46
  • Ah! Beautiful. I'll get rid of \CompileMatrices. By the way, how do you enter text in grey boxes? I used quadruple spaces in the question, which I don't think is the right way.
    – Exterior
    Commented Nov 5, 2014 at 15:49
  • Indent each line by at least four spaces (or high light it and press ctrl+k)
    – daleif
    Commented Nov 5, 2014 at 16:32
1

No problem what so ever. So as egreg says, always provide a minimal example. All seeing crystal balls does not exist in real life.

This works fine for me

\documentclass[a4paper]{memoir}
\usepackage[all]{xy}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{equation*}
  \xymatrix{ 
    \varprojlim x  \ar[r] \ar[d] & \varinjlim  y  \ar[d] \\
    \varprojlim x  \ar[r] & \varinjlim  y \\
  }
\end{equation*}
\end{document}
1
  • Will post non-working examples from now on. Thanks.
    – Exterior
    Commented Nov 5, 2014 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .