セクション階層の複製と変更

セクション階層の複製と変更

準備中の大規模な論文スタイルの文書には、以前に準備された作業の挿入として扱われる特定の部分 (LaTeX 階層 \part{}) があります。これには、セクション (章をスキップ) を使用して部分内で階層的に分割する方が適している記事や要約が含まれる場合があります。これは主に、章のフォーマットが根本的に異なる「第 X 章」を回避するためです。

私は、(おそらく newcommand を)コピーし、その後、セクション番号のみを含むようにセクション コマンドを再定義して、章のプレフィックス (例: 1. Intro) を含まない \papersection{} という LaTeX コマンドを呼び出すことができるようにしたいと思います。

完全性を期すために、可能であれば、\papersection*{} と同等の書式と階層を共有できるようにしたいと思います。

\documentclass{report}
%\usepackage{chngcntr}
%\counterwithin{figure}{section}
\begin{document}
\part{(First Part)}
\section{Intro}
     Since this part is for a research paper - the article class would be more appropriate but the report class has been used for the rest of the document as numbering hierarchy such as 1.1 is desired.

     Would rather be using \papersection{Intro} so that all my sections do not include the repetitive and unnecessary 1.x

\end{document}

あるいは (これが私の推奨するアプローチです)、\begin{x} ... \end{x} 環境コマンドを発行して、使用されている \documentclass テンプレートを一時的に再定義することはできますか? このコンテキストでは、ビブユニット、表、図、方程式などのネストされた環境と互換性がある必要があります。

\documentclass{report}
\begin{document}
\part{(First Part)}
\begin{PaperEnvironment}% open up an environment that refers to the article class

\section{Intro}
    Can I change documentclass templates mid stream?  If so, I don't have to redefine section anymore...

\end{PaperEnvironment}
\end{document}

ドキュメントは、レポート テンプレートに基づくカスタム cls ファイルを使用して準備されています。現時点では、memoir、book、scrreport などに切り替えることはできません。

答え1

サブドキュメントを個別にコンパイルし、コンパイルされたファイルを などのパッケージに含めない限り、1 つのドキュメントで複数のドキュメント クラスを使用することはできません。pdfpagesそれができない場合は、新しい環境 (たとえば )を定義して、環境の先頭でセクションをタイプセットするときに章番号を削除し、最後に復元することができます。 を変更するだけでよいため、コマンドpaper全体を複製するよりも簡単です。\section\thesection

星印の付いたセクションコマンドには番号が付いていないので、何を意味しているのかわかりません。

\documentclass{report}
\usepackage{kantlipsum}
\makeatletter
\newenvironment{paper}{%
  \global\let\oldthesection\thesection
  \renewcommand{\thesection}{\@arabic\c@section}%
}{%
  \global\let\thesection\oldthesection}
\makeatother
\begin{document}
\chapter{Chapter First}
\kant[1]
\section{Kant}
\kant[2]
\section{Kant Again}
\kant[3]
\chapter{Chapter Second}
\kant[4]
\part{(First Part)}
\begin{paper}
\section{Intro}
     Since this part is for a research paper - the article class would be more appropriate but the report class has been used for the rest of the document as numbering hierarchy such as 1.1 is desired.

     Would rather be using \section{Intro} so that all my sections do not include the repetitive and unnecessary 1.x
\end{paper}
\part{Second Part}
\chapter{More Kant}
\kant[5]
\section{Kant Keeps Going}
\kant[6]
\end{document}

バリアントセクションの書式設定

関連情報