3

Goal I am trying to derive my own class from memoir and would like to include all the auto-completiong from the original memoir class.

Problem I wrote a customg .cwl file using #include:class-memoir. But that seems to be ignored as the corresponding commands are not recognized in TexStudio. Is there something wrong with the .cwl?

Setting I am using TexStudio 2.11.2 on an Ubuntu 16.04 with pdflatex. I've put the .cwl file in $HOME/.config/texstudio/completion/user and loaded it in TexStudio explicitly in Options->Configure Texstudio->Completion. I am sure that my .cwl is loaded because I added a test command which is recognized.

MWE

test-derived.tex

\documentclass{derived-from-memoir}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page definitions
\begin{titlingpage}
\title{This is an Awesome Title}
\author{Awesome Name}
\date{\today}
\aliaspagestyle{titlingpage}{plain}
\setlength\droptitle{30pt} % vertical position of the title
\end{titlingpage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\maketitle

\cleartorecto

My awesome text! \testcmd{And the test works!}

\end{document}

derived-from-memoir.cls

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{derived-from-memoir}[2017/05/12 derived-from-memoir class]

\ProcessOptions\relax 

\LoadClass[12pt,a4paper,twoside,onecolumn,openright
%,final
,draft
,fleqn % displayed math environments will be indented an amount \mathindent from the left margin (the default is to center the environments).
,openbib %each part of a bibliography entry will start on a new line, with second and succeding lines indented by \bibindent (the default is for an entry to run continuously with no indentations).
]{memoir}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\let\testcmd\emph

\endinput

class-derived-from-memoir.cwl

#include:class-memoir.cwl

\testcmd{asubd}

After loading class-derived-from-memoir.cwl, the part \testcmd{And the test works!} is recognized, but not the memoir commands, i.e. \droptitle, titlingpage, \aliaspagestyle and \cleartorecto.

1
  • Check maybe completion/autogenerated folder.
    – Sigur
    Commented May 13, 2017 at 15:15

1 Answer 1

0

Maybe your class-derived-from-memoir.cwl file should be

#include:memoir

\testcmd{asubd}
1
  • You should replace #include:memoir with #include:class-memoir
    – mbert
    Commented Jan 23, 2023 at 20:39

You must log in to answer this question.

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