Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When using cancel package to cross out something and the package diagbox is also loaded the line does not appear in the proper location. When diagbox is not loaded everything works ok. However, I need to load that package to use it with some cells in tables.

See the following MWE:

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{diagbox} 
\usepackage{cancel}
\begin{document}
Some text $\frac{ \cancel{2} \cdot \cancel{ \left( q_{1}+2 \right) } }{p_1}$
\end{document}
share|improve this question
1  
Welcome to TeX.sx! –  hpesoj626 Apr 1 '13 at 1:40
add comment

1 Answer

up vote 10 down vote accepted

The diagbox package internally loads pict2e which does some redefinitions that cause the problem with cancel; to prevent the redefinitions made by pict2e, load the pict2e package with the original option before diagbox:

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage[original]{pict2e}
\usepackage{diagbox} 
\usepackage{cancel}
\begin{document}
Some text $\frac{ \cancel{2} \cdot \cancel{ \left( q_{1}+2 \right) } }{p_1}$
\end{document}

enter image description here

Another possibility is to pass the original option as class option, so pict2e will pick it up:

\documentclass[12pt,a4paper,original]{article}
\usepackage{amsmath}
\usepackage{diagbox} 
\usepackage{cancel}
\begin{document}
Some text $\frac{ \cancel{2} \cdot \cancel{ \left( q_{1}+2 \right) } }{p_1}$
\end{document}
share|improve this answer
    
Thank you so much! Muchísimas gracias! –  Dom Apr 1 '13 at 1:39
    
@Dom You're welcome! ¡De nada! –  Gonzalo Medina Apr 1 '13 at 1:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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