
저는 TeXstudio에서 "revtex4-1" 문서 클래스를 사용합니다. 그러나 구성을 위한 "완료"에서 "revtex4-1.cwl"이라는 용어 앞의 확인란을 선택한 후에도 "widetext" 환경에 "명령이 인식되지 않음"이라는 레이블이 붙는 것을 발견했습니다.
문제는 TeXstudio가 "와이드텍스트"를 인식하도록 하려면 어떻게 해야 합니까?
답변1
~에서FAQ: TeXstudio가 명령을 인식할 수 없는 것으로 표시하는 이유는 무엇입니까?:
TXS는 문서의 모든 LaTeX 명령이 유효한지 확인합니다. 이는 입력하는 동안 이미 발생한 오류(오타 및 로드되지 않은 패키지)를 인식하는 데 도움이 됩니다. 명령이 인식할 수 없는 것으로 표시되면 TXS가 해당 명령에 대한 정의를 찾지 못한 것입니다. 보다TXS는 유효한 명령을 어떻게 알 수 있나요?상세 사항은.
문제 해결 방법을 알아보려면 위의 링크를 따르세요.
답변2
widetext.sty 사용법:
\usepackage{widetext}
\setlength\stripsep{3pt plus 1pt minus 1pt}
다음 내용을 widetext.sty로 저장하고 .tex 파일과 동일한 디렉터리에 배치합니다.
%%---------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{widetext}
%% Mimics the widetext environment of revtex4 for any other class package
%% Eg: article.cls
%%
%% Compiled by: Anjishnu Sarkar
%%
%% Advantages:
%% *) Supports float (eg: figure) in two column format (Advantage over
%% multicol package)
%% *) One and twocolumn exist on the same page
%% *) Flow of text shown via rule
%% *) Equal height of text when in two column format
%%
%% Acknowledgment(s):
%% 1. Instead of re-inventing the wheel, two packages (flushend, cuted) of
%% the sttools bundle are used. The sttools bundle is available from CTAN.
%% Lisence of these packages rests with their corresponding author.
%% Any bug/problem with flushend and cuted should be forwarded to their
%% corresponding package authors.
%% 2. The idea of the rule came from the following latex community website
%% http://www.latex-community.org/forum/viewtopic.php?f=5&t=2770
%%
%% This package just defines the widetext environment and the rules.
%%
%% Usage:
%% \documentclass[a4paper,12pt,twocolumn]{article}
%% \usepackage{widetext}
%%
%% \begin{document}
%%
%% Some text in twocolumn
%%
%% \begin{widetext}
%% Text in onecolumn format.
%% \end{widetext}
%%
%% Some more text in twocolumn
%%
%% \end{document}
%%%%%%%%%%%%%%%%%%%%
%% Package required for equal height while in 2 columns format
\IfFileExists{flushend.sty}
{\RequirePackage{flushend}}
{\typeout{}
\typeout{Package widetext error: Install the flushend package which is
a part of sttools bundle. Available from CTAN.}
\typeout{}
\stop
}
%% Package required for onecolumn and twocolumn to exist on the same page.
%% and also required for widetext environment.
\IfFileExists{cuted.sty}
{\RequirePackage{cuted}}
{\typeout{}
\typeout{Package widetext error: Install the cuted package which is
a part of sttools bundle. Available from CTAN.}
\typeout{}
\stop
}
\newlength\@parindent
\setlength\@parindent{\parindent}
\if@twocolumn
\newenvironment{widetext}
{%
\begin{strip}
\rule{\dimexpr(0.5\textwidth-0.5\columnsep-0.4pt)}{0.4pt}%
\rule{0.4pt}{6pt}
\par %\vspace{6pt}
\parindent \@parindent
}%
{%
\par
\hfill\rule[-6pt]{0.4pt}{6.4pt}%
\rule{\dimexpr(0.5\textwidth-0.5\columnsep-1pt)}{0.4pt}
\end{strip}
}
\else
\newenvironment{widetext}{}{}
\fi