Document Classespreamble not working for a new document

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

preamble not working for a new document

Post by josephcampbell »

Hello,

I was using this preamble and I wanted to use it again for my next document. It works for my previous document but now that I want to make a new, empty document it is not working. I will paste my entire code below. Whats wrong with it?

-Joe

Code: Select all

\documentclass[a4paper, fontsize=10pt]{scrartcl}
\usepackage{wasysym}
\usepackage{tasks}
\usepackage{multicol}
\usepackage{wrapfig}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{amsfonts}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{epsfig}
\usepackage{mathtools,tikz}
\usepackage{setspace,csquotes, enumitem,endnotes,fontspec, capt-of}
\doublespacing
\usepackage[margin=1in]{geometry}
\usepackage[notes, notetype=endonly, isbn=false, backend=biber]{biblatex-chicago}
\bibliography{shiff2016b}
\let\footnote=\endnote
\let\cite=\endnote
\let\footcite=\autocite
\setlist[enumerate,itemize]{noitemsep,nolistsep,leftmargin=*}
\author{Joe Campbell\\
}
\title{Geometry}
\subtitle{}
\date{}

\DeclareInstance{tasks}{alphabetize}{default}{counter-format = {tsk[{}]},
  label-width = 1.4em}
  
  
\definecolor{aquamarine}{rgb}{0,0,.9}

\definecolor{red}{rgb}{.9,0,0}
\begin{document}

hello

\end{document}
Last edited by Stefan Kottwitz on Wed Sep 26, 2018 6:59 pm, edited 1 time in total.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

preamble not working for a new document

Post by Stefan Kottwitz »

Hi Joe,

posting the entire code makes testing easy, thanks!

You need to compile with XeLaTeX, but I guess you are already doing it.

The only issue here is that both wasysym and amsmath/amssymb define integral symbols with the same name. You can fix it, preferring amsmath integral symbols, by adding the [nointegrals] option to wasysym:

\usepackage[nointegrals]{wasysym}

Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

preamble not working for a new document

Post by Johannes_B »

Package wasysymb defines a symbol which is also defined by package amsmath, which is loaded by several of your packages. Easiest solution would be not to load package wasysymb. Chances are pretty high, you don't need it.

Same goes for many of the other packages you load. Are you sure you really need them? Some are obsolete for over twenty years.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

preamble not working for a new document

Post by josephcampbell »

I got ride of wasysymb entirely, but my code is still not working. I am using overleaf.com. Here is my code now.

Code: Select all

\documentclass[a4paper, fontsize=10pt]{scrartcl}
\usepackage{tasks}
\usepackage{multicol}
\usepackage{wrapfig}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{amsfonts}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{epsfig}
\usepackage{mathtools,tikz}
\usepackage{setspace,csquotes, enumitem,endnotes,fontspec, capt-of}
\doublespacing
\usepackage[margin=1in]{geometry}
\usepackage[notes, notetype=endonly, isbn=false, backend=biber]{biblatex-chicago}
\bibliography{shiff2016b}
\let\footnote=\endnote
\let\cite=\endnote
\let\footcite=\autocite
\setlist[enumerate,itemize]{noitemsep,nolistsep,leftmargin=*}
\author{Joe Campbell\\
}
\title{Geometry}
\subtitle{}
\date{}

\DeclareInstance{tasks}{alphabetize}{default}{counter-format = {tsk[{}]},
  label-width = 1.4em}
  
  
\definecolor{aquamarine}{rgb}{0,0,.9}

\definecolor{red}{rgb}{.9,0,0}
\begin{document}

hello

\end{document}
Last edited by Stefan Kottwitz on Wed Sep 26, 2018 8:29 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

preamble not working for a new document

Post by Stefan Kottwitz »

Hi Joseph,
josephcampbell wrote:but my code is still not working. I am using overleaf.com.
please post error messages or details.

Specifically, the code is working, also with Overleaf. Click on "Open in Overleaf" in the code box above. (please mark code using the code button - mark, click - that produces the code box in the post with syntax highlighting and Overleaf link). It shows that it works on Overleaf.

Stefan
LaTeX.org admin
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

preamble not working for a new document

Post by josephcampbell »

I get an error message that looks exactly like this. I am confused because this exact preamble works for other documents.



Compile Error. Sorry, your LaTeX code couldn't compile for some reason. Please check the errors below for details, or view the raw log.
/usr/local/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec.sty, line 28
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Fatal fontspec error: "cannot-use-pdftex"
!
! The fontspec package requires either XeTeX or LuaTeX.
!
! You must change your typesetting engine to, e.g., "xelatex" or
! "lualatex"instead of plain "latex" or "pdflatex".
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.28 \msg_fatal:nn {fontspec} {cannot-use-pdftex}

|'''''''''''''''''''''''''''''''''''''''''''''''
| This is a fatal error: LaTeX will abort.
|...............................................
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

preamble not working for a new document

Post by josephcampbell »

Hmm it looks like it is working in overleaf version 1 but not version 2
User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

preamble not working for a new document

Post by Stefan Kottwitz »

Since you use fontspec, you havt to compile with XeLaTeX (or LuaLaTeX). That has extended font support. Overleaf v1 detects that automatically.

Or, if you don't use it, remove the fontspec package from the document preamble.

Stefan
LaTeX.org admin
josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

preamble not working for a new document

Post by josephcampbell »

How do I compile with XeLaTeX (or LuaLaTeX)? Is this possible in overleaf?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

preamble not working for a new document

Post by Stefan Kottwitz »

I know XeLaTeX is possible in Overleaf v1. No idea about v2 though. You could contact the Overleaf support.

Or remove fontspec in this list

\usepackage{setspace,csquotes, enumitem,endnotes,fontspec, capt-of}

Stefan
LaTeX.org admin
Post Reply