0

Edited question

I’d like to write a document with the novel class, which is installed on my distribution.

Because it seems I can’t make my own minimal working example, I took it from the official web documentation from which I delete what I think was not useful:

% !TeX TS-program = LuaLaTeX
% !TeX encoding = UTF-8
\documentclass{novel} % See list of class options; usually none needed.
%%% METADATA (FILE DATA):
\SetTitle{IMPORTANT: Provide Book Title} % Required for PDF/X.
\SetSubtitle{} % Default: empty.
\SetAuthor{} % Default: empty.
\SetApplication{LuaLaTeX with novel and microtype}
\SetProducer{LuaLaTeX with novel-pdfx and hyperref}
\SetPDFX[CGATSTR001]{X-1a:2001}
%%% DIMENSIONS:
\SetTrimSize{5.5in}{8.5in} % Sets width, height of your book.
% Default Media Size equals Trim Size.
% Rarely-used over-ride, except for cover artwork:
% \SetMediaSize[alignment]{width}{height}
% Default margins vary with Trim Size. Defaults for {5.5in}{8.5in}:
\SetMargins{0.5in}{0.5in}{0.5in}{0.75in}
%%% GENERAL FONTS:
% Percent at end of line is necessary, when writing font settings multi-line:
\SetParentFont[%
SmallCapsFeatures={Renderer=Basic},% Effective when small caps requested locally.
Kerning=On, %
Ligatures=TeX, %
]{Libertinus Serif}
% Main text font automatically adds Numbers=OldStyle,Ligatures=Common.
% Default main font size is based on other layout settings.
% Varies from 11pt to 12pt. With all default layouts, value is 11.4pt.
% You may manually choose a different main font size:
% \SetFontSize{length}
% Default lines per page (main textblock) is calculated from other layout settings.
% When using all defaults, the calculated value is 35.
% If used, \SetLinesPerPage manually chooses the value:
% \SetLinesPerPage{integer}
\SetDecoFont{NovelDeco.otf}
\setsansfont{Libertinus Sans}
\setmonofont{Libertinus Mono}
\setmathfont{Libertinus Math} % unicode-math
%%% HEADERS/FOOTERS:
\SetHeadFootStyle{1} % This style has headers only.
\SetHeadJump{1.5}
\SetFootJump{1.5}
\SetLooseHead{50}
\SetEmblems{}{} % Default blanks.
\SetHeadFont[\parentfontfeatures,Letters=SmallCaps,Scale=0.92]{\parentfontname}
\SetPageNumberStyle{\thepage}
\SetVersoHeadText{\theAuthor}
\SetRectoHeadText{\theTitle}
%%% CHAPTERS:
\SetChapterStartStyle{footer} % Equivalent to empty, when style has no footer.
\SetChapterStartHeight{10}
\SetChapterFont[Numbers=Lining,Scale=1.6]{\parentfontname}
\SetSubchFont[Numbers=Lining,Scale=1.2]{\parentfontname}
\SetScenebreakIndent{false}
%%% CUSTOM FONTS:
% \NewFontFamily[]{} % Optional command.
% \NewFontFace[]{} % Optional command.
% \CreateFontFeature{}{} % Optional command.
%%% OTHER:
\setdefaultlanguage[variant=american]{english} % polyglossia
\microtypesetup{config=novel-microtype,stretch=20,shrink=20,final} % microtype

\begin{document}
\clearpage % or \cleartorecto
\end{document} 

Now the issue I have is that I get a bunch of polyglossia error messages when I compile it with LuaTeX such as:

! Package polyglossia Error: language * is not loaded. Please load it before us
! Package polyglossia Error: Could not retrieve key frenchspacing for language

and other error messages like so:

! You can't use `\relax' after \the.

Previous question that wasn’t clear for answers:

Everyone, I am new, so forgive the silliness of my question. I’d like to write a document with the novel class, which is installed on my distribution.

My minimal sample is:

\documentclass[12pt,letterpaper]{novel}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage{•}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{}
\begin{document}
Some text
\end{document}

I’m using Texmaker as my editor, and when I compile with LuaTex the first error I get is

! LaTeX Error: *** this package currently works only with XeTeX ***

But I don’t know how to make it work with XeTeX, because if I compile with XeLateX (is it the same thing?), then I can not compile with LuaTex and the following error appears:

! Class novel Error: Must compile with LuaLaTeX 0.95+.
11
  • You have not shown any input which makes it hard to tell you what is wrong with your input but you have written a document that can not be processed. You are using \documentclass{novel} so you have to use lualatex, but have used \usepackage{something} for some package you have not named which has to be used with xelatex. Sep 24, 2021 at 9:46
  • I edited my question with the minimal sample.
    – Louis
    Sep 24, 2021 at 9:52
  • 1
    oh \usepackage{xltxtra} and \usepackage{xunicode} are not recommended even with xelatex, just delete them both Sep 24, 2021 at 9:56
  • Do you want to print CJK characters in novel class? novel class is designed for print-on-demand, and so pre-configures almost everything, including fonts, and disables many commands, so that, for example, it prevents luatexja (tex.stackexchange.com/questions/240507/…) from working. Depending on what you need to do, there may be workaround(s), but they will depend on the actual code you will be using at that point, and what problem you need to solve.
    – Cicada
    Sep 25, 2021 at 14:51
  • @Cicada I’m not sure what the CJK characters are... nevertheless, what I want is only to be able to write a short story with this class as it suggests is good for that purpose. I will not be doing anything special with my document; a pre-configured document will be perfect for what I need.
    – Louis
    Sep 25, 2021 at 17:49

1 Answer 1

2

You have not shown your input or enough of the error message to fully diagnose but you have a document like

\documentclass{novel}

\usepackage{xeCJK}

\begin{document}

\end{document}

The novel class requires lualatex but the xeCJK class requires xelatex so you get an error in all cases.

pdflatex or xelatex

! Class novel Error: Must compile with LuaLaTeX 0.95+.

See the novel class documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.76 ...uaLaTeX only. No pdfTeX, dvips, or XeTeX.}
                                                  
? 

lualatex

(/usr/local/texlive/2021/texmf-dist/tex/xelatex/xecjk/xeCJK.sty

! Critical Package xeCJK Error: The xeCJK package requires XeTeX to function.
(xeCJK)                         
(xeCJK)                         You must change your typesetting engine to
(xeCJK)                         "xelatex"
(xeCJK)                         instead of plain "latex" or "pdflatex" or
(xeCJK)                         "lualatex".
(xeCJK)                         Loading xeCJK will abort!

Type <return> to continue.
 ...                                              
                                                  
l.43 ...sg_critical:nn { xeCJK } { Require-XeTeX } }
                                                  
? 

The form of the last error is not quite as you show so the package requiring xelatex is not xeCJK in your case, but the basic issue is as shown.

There is essentially no fix for this you need to use a document class that works with xelatex or use a package that works with lualatex.


With the example added in the edited question you are in an easier case you are loading xltxtra and xunicode which are legacy xelatex packages that you can simply delete.

\documentclass[12pt,letterpaper]{novel}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
% dont use these even with xelatex (and they only work with xelatex) \usepackage{xunicode}\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage{•}
\usepackage{amsmath}
\usepackage{amsfonts}
%\usepackage{amssymb}
% not with novel \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\author{}
\begin{document}
Some text
\end{document}
1
  • 2
    I left in \setdefaultlanguage{•} but that clearly errors as is not a language. I assume your real document does not have that. Sep 24, 2021 at 10:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .