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.

I am not able to compile this tex document

\documentclass{scrartcl}
% \documentclass{article}
\begin{document}
hello    
\end{document}

with htlatex. I am able to do this using pdflatex. If I choose article (see 2nd line) as documentclass, everything is fine. However, I'd like to have pdfs using scrartcl. How can I switch between documentclasses dependent on the compiler I use?

share|improve this question
    
\RequirePackage{ifpdf}\documentclass{\ifpdf scrartcl\else article\fi} –  Manuel Jun 20 at 11:36
    
@Manuel: If you post this as an answer, I can accept it. Thx. –  Stefan Bollmann Jun 20 at 11:39
2  
However, if you want everything available with article, there's nothing stoping you from \usepackage{scrbase} with article class. That way, you have everything from scrartcl available. –  Manuel Jun 20 at 11:44

1 Answer 1

up vote 5 down vote accepted
\RequirePackage{ifpdf}
\documentclass{\ifpdf scrartcl\else article\fi}

\begin{document}
hello    
\end{document}

Or, may be (I don't know) it's better not to risk anything

\RequirePackage{ifpdf}
\ifpdf
  \documentclass{scrartcl}
\else
  \documentclass{article}
\fi

\begin{document}
hello    
\end{document}
share|improve this answer

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.