LaTeX forum ⇒ Document Classespreamble not working for a new document

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

preamble not working for a new document

Postby josephcampbell » Wed Sep 26, 2018 5:36 pm

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

  1. \documentclass[a4paper, fontsize=10pt]{scrartcl}
  2. \usepackage{wasysym}
  3. \usepackage{tasks}
  4. \usepackage{multicol}
  5. \usepackage{wrapfig}
  6. \usepackage{textcomp}
  7. \usepackage{mathrsfs}
  8. \usepackage{amsfonts}
  9. \usepackage[T1]{fontenc}
  10. \usepackage{graphicx}
  11. \usepackage{grffile}
  12. \usepackage{longtable}
  13. \usepackage{wrapfig}
  14. \usepackage{rotating}
  15. \usepackage[normalem]{ulem}
  16. \usepackage{textcomp}
  17. \usepackage{amsmath}
  18. \usepackage{amssymb}
  19. \usepackage{amsthm}
  20. \usepackage{epsfig}
  21. \usepackage{mathtools,tikz}
  22. \usepackage{setspace,csquotes, enumitem,endnotes,fontspec, capt-of}
  23. \doublespacing
  24. \usepackage[margin=1in]{geometry}
  25. \usepackage[notes, notetype=endonly, isbn=false, backend=biber]{biblatex-chicago}
  26. \bibliography{shiff2016b}
  27. \let\footnote=\endnote
  28. \let\cite=\endnote
  29. \let\footcite=\autocite
  30. \setlist[enumerate,itemize]{noitemsep,nolistsep,leftmargin=*}
  31. \author{Joe Campbell\\
  32. }
  33. \title{Geometry}
  34. \subtitle{}
  35. \date{}
  36.  
  37. \DeclareInstance{tasks}{alphabetize}{default}{counter-format = {tsk[{}]},
  38. label-width = 1.4em}
  39.  
  40.  
  41. \definecolor{aquamarine}{rgb}{0,0,.9}
  42.  
  43. \definecolor{red}{rgb}{.9,0,0}
  44. \begin{document}
  45.  
  46. hello
  47.  
  48. \end{document}
Last edited by Stefan Kottwitz on Wed Sep 26, 2018 6:59 pm, edited 1 time in total.
Reason: code marked

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

Postby Stefan Kottwitz » Wed Sep 26, 2018 7:03 pm

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
Site admin

User avatar
Johannes_B
Site Moderator
Posts: 3905
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Sep 26, 2018 7:06 pm

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

Postby josephcampbell » Wed Sep 26, 2018 8:28 pm

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

  1. \documentclass[a4paper, fontsize=10pt]{scrartcl}
  2. \usepackage{tasks}
  3. \usepackage{multicol}
  4. \usepackage{wrapfig}
  5. \usepackage{textcomp}
  6. \usepackage{mathrsfs}
  7. \usepackage{amsfonts}
  8. \usepackage[T1]{fontenc}
  9. \usepackage{graphicx}
  10. \usepackage{grffile}
  11. \usepackage{longtable}
  12. \usepackage{wrapfig}
  13. \usepackage{rotating}
  14. \usepackage[normalem]{ulem}
  15. \usepackage{textcomp}
  16. \usepackage{amsmath}
  17. \usepackage{amssymb}
  18. \usepackage{amsthm}
  19. \usepackage{epsfig}
  20. \usepackage{mathtools,tikz}
  21. \usepackage{setspace,csquotes, enumitem,endnotes,fontspec, capt-of}
  22. \doublespacing
  23. \usepackage[margin=1in]{geometry}
  24. \usepackage[notes, notetype=endonly, isbn=false, backend=biber]{biblatex-chicago}
  25. \bibliography{shiff2016b}
  26. \let\footnote=\endnote
  27. \let\cite=\endnote
  28. \let\footcite=\autocite
  29. \setlist[enumerate,itemize]{noitemsep,nolistsep,leftmargin=*}
  30. \author{Joe Campbell\\
  31. }
  32. \title{Geometry}
  33. \subtitle{}
  34. \date{}
  35.  
  36. \DeclareInstance{tasks}{alphabetize}{default}{counter-format = {tsk[{}]},
  37. label-width = 1.4em}
  38.  
  39.  
  40. \definecolor{aquamarine}{rgb}{0,0,.9}
  41.  
  42. \definecolor{red}{rgb}{.9,0,0}
  43. \begin{document}
  44.  
  45. hello
  46.  
  47. \end{document}
Last edited by Stefan Kottwitz on Wed Sep 26, 2018 8:29 pm, edited 1 time in total.
Reason: code marked

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

Postby Stefan Kottwitz » Wed Sep 26, 2018 8:33 pm

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
Site admin

josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

Postby josephcampbell » Thu Sep 27, 2018 5:21 am

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

Postby josephcampbell » Thu Sep 27, 2018 5:26 am

Hmm it looks like it is working in overleaf version 1 but not version 2

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

Postby Stefan Kottwitz » Thu Sep 27, 2018 9:44 am

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
Site admin

josephcampbell
Posts: 9
Joined: Mon Sep 10, 2018 4:12 am

Postby josephcampbell » Thu Sep 27, 2018 5:50 pm

How do I compile with XeLaTeX (or LuaLaTeX)? Is this possible in overleaf?

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

Postby Stefan Kottwitz » Thu Sep 27, 2018 5:55 pm

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
Site admin


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 4 guests