Graphics, Figures & Tablesctable | Table not compilable with every Compiler Engine

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gandym
Posts: 3
Joined: Tue Aug 14, 2012 3:39 pm

ctable | Table not compilable with every Compiler Engine

Post by gandym »

Hi,

I am relatively new to writing in LaTeX and I have hit a problem I am unable to solve.

When I process the following MWE with latex-dvips-ps2pdf I get a properly formatted table. However, when I use PDFLaTeX directly, the compiler hangs indefinitely.

Code: Select all

\documentclass{report}
\usepackage{ctable}
\usepackage{auto-pst-pdf}

\newcolumntype{Y}{>{\centering\arraybackslash}X}

\begin{document}

\ctable[caption = {Caption},width = 120mm,pos = h,]{YYY}{}{
                               \FL
Column 1 & Column 2 & Column 3 \ML
     (H) &       80 &       90 \NN
    (Mu) &       50 &       70 \LL
}

\end{document}
I am using TeXStudio with MiKTeX 2.9 on a Windows 7 (x64) system.
Based on reports of similar problems I have tried changing the option for PdfLaTeX in TexStudio to
  • pdflatex -synctex=1 --enable-write18 -interaction=nonstopmode %.tex or
  • pdflatex --shell-escape %.tex
without success.

I have also attached the log files after an attempted PDFLaTeX run.

Any help with this would be greatly appreciated.
Thanks,
gandym
Attachments
example2.log
(13.98 KiB) Downloaded 249 times
example2-autopp.log
(8.22 KiB) Downloaded 235 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

ctable | Table not compilable with every Compiler Engine

Post by Stefan Kottwitz »

Hi Gandym,

welcome to the board!

auto-pst-pdf doesn't work in all cases.

How about removing that, and using XeLaTeX instead, if you needed it because of PSTricks? Or just delete it, if you don't use PSTricks and compile with pdfLaTeX.

Stefan
LaTeX.org admin
gandym
Posts: 3
Joined: Tue Aug 14, 2012 3:39 pm

ctable | Table not compilable with every Compiler Engine

Post by gandym »

Hi Stefan_K,

Thanks for your fast response. Unfortunately, I was rather hoping for a solution which uses auto-pst-pdf.

If I comment out auto-pst-pdf, then the table compiles. But if I then include the graphicx package and a simple \includegraphics{chemimage.eps} then pdflatex generates an error: File 'chemimage.eps' not found. This same code happily compiles with latex-dvips-ps2pdf. If I instead use chemimage.pdf, then it compiles, but I cannot use chemnum package to replace TMP labels in the graphic.....

Including the [crop=off] options for auto-pst-pdf allows the EPS graphic to compile but it still hangs when compiling the table.

So my problem boils down to the fact that auto-pst-pdf won't work with the table and the EPS graphic/chemnum numbering won't work without it.

Also, I also tried your suggestion regarding XeLaTeX using TeXworks but I encountered the same problems.

Any other ideas? :?

Thanks,
gandym
gandym
Posts: 3
Joined: Tue Aug 14, 2012 3:39 pm

ctable | Table not compilable with every Compiler Engine

Post by gandym »

I still don't have a good solution for this but I have found a fairly tedious workaround.

In my expanded MWE below, I have included an image with a temporary label to be changed by chemnum. When running pdflatex, the auto-pst-pdf package generates an error if I try to use a ctable with a column width Y, predefined as \newcolumntype{Y}{>{\centering\arraybackslash}X}.

To get around this I run pdflatex with column width set with {ccc} exactly as shown in the MWE. Once complete, I change \usepackage{auto-pst-pdf} to \usepackage[off]{auto-pst-pdf} and {ccc} to {YYY} and run pdflatex again. The second pdflatex run uses the images generated in the first run, but now formats tables as desired.

This process also works for images that occupy an entire row in ctables, as demonstrated if all of the code is uncommented – but, I doubt this would produce the correct alignment if the image was confined to a single cell.

So tedious, but I find it does work, even in my 100+ page thesis containing ctables throughout.

I am sure there must be other, more automated ways around this...

Code: Select all

\documentclass{report}

\usepackage{ctable}
\usepackage{chemstyle}
\usepackage{chemnum}
\usepackage{auto-pst-pdf}

\newcolumntype{Y}{>{\centering\arraybackslash}X}

\begin{document}

Some text.

{
\cmpdref{one}
\ctable[caption = {Caption},width = 120mm,pos = h,]{ccc}{}{
\multicolumn{3}{c}{\includegraphics{chemimage.eps}}\\
                                                    \FL
   Column 1   &      Column 2      &     Column 3   \ML
     (H)      &         80         &        90      \NN
     (Mu)     &         50         &        70      \LL
}
}

\end{document}
Post Reply