Texstudio + 自定义 cwl:#include 命令被忽略

Texstudio + 自定义 cwl:#include 命令被忽略

目标我正在尝试从中派生出我自己的类memoir,并希望包含原始memoir类中的所有自动完成功能。

问题.cwl使用编写了一个自定义文件#include:class-memoir。但这似乎被忽略了,因为 TexStudio 无法识别相应的命令。有什么问题吗.cwl

环境我在 Ubuntu 16.04 上使用带有 pdflatex 的 TexStudio 2.11.2。我已将文件放入.cwl$HOME/.config/texstudio/completion/user在 TexStudio 中明确加载Options->Configure Texstudio->Completion。我确定我的.cwl已加载,因为我添加了一个可识别的测试命令。

平均能量损失

测试派生.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}

源自回忆录.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

从回忆录派生的类.cwl

#include:class-memoir.cwl

\testcmd{asubd}

加载后从回忆录派生的类.cwl,部分\testcmd{And the test works!}可以被识别,但命令不能被识别,memoir\droptitletitlingpage和。\aliaspagestyle\cleartorecto

答案1

也许你的 class-derived-from-memoir.cwl 文件应该是

#include:memoir

\testcmd{asubd}

相关内容