emath saloon (Read Only)

新規発言一覧最新記事過去一覧検索HOME

スレッド

└◇387:
Re:\sectionや\subsectionについて [石原 守] 06/23 07:04

 └◇388:Re[2]:\sectionや\subsectionについて [しゅうすけ] 06/24 01:40
  └◇389:Re[3]:\sectionや\subsectionについて [石原 守] 06/24 06:02
   └◇390:Re[4]:\sectionや\subsectionについて [しゅうすけ] 06/24 10:46<-last


387● Re:\sectionや\subsectionについて[ 石原 守 ] 2007 06/23 07:04
\documentclass[b5paper, 11pt, twoside]{jarticle}

%\usepackage{emath}
\usepackage[papersize]{emathP}

\setlength{\topmargin}{-50pt}
\setlength{\textheight}{21.5cm}
\setlength{\textwidth}{38zw}
\setlength{\oddsidemargin}{-1.05cm}
\setlength{\evensidemargin}{0.15cm}

\makeatletter
%
% section
\newif\ifsecnewpage\secnewpagefalse
\renewcommand{\section}{%
  \pagebreak[2]%
  \ifsecnewpage
    \clearpage
  \fi
  \global\@topnum\z@
  \@afterindenttrue
  \secdef\@section\@ssection}
\def\@section[#1]#2{%
  \ifnum \c@secnumdepth >0
    \refstepcounter{section}%
    \addcontentsline{toc}{section}%
      {\protect\numberline{\thesection}#1}%
  \else
    \addcontentsline{toc}{section}{#1}%
  \fi
  \sectionmark{#1}%
  \@makesectionhead{#2}\@afterheading
  \endsection
}
\def\endsection{\nopagebreak
   \vskip1\baselineskip
   \nopagebreak
}
\def\@makesectionhead#1{%
\vskip2\baselineskip
\begin{zahyou*}(0, 360)(0, 0)
\def\O{(190, 18)} 
\def\P{(-12, 30)} \def\Q{(392, 30)} \Drawline{\P\Q}
\def\R{(-12, 10)} \def\S{(392, 10)} \Drawline{\R\S}
\def\T{(-12, 5)} \def\U{(392, 5)} \Drawline{\T\U}
\def\a{(-12, 0)} \def\b{(80, 0)} \def\c{(60, -20)} \def\d{(-12, -20)}
\def\e{(90, 0)} \def\f{(290, 0)} \def\g{(310, -20)} \def\h{(70, -20)}
\def\i{(392, 0)} \def\j{(300, 0)} \def\k{(320, -20)} \def\l{(392, -20)}
\Drawline{\a\b\c\d} \Drawline{\e\f\g\h\e} \Drawline{\i\j\k\l}
\Nuritubusi[1]{\P\Q\S\R}
\Put\O[c]{\textcolor{white}{\bf \Large 第\;\thesection\;講}}
\def\o{(190, -12)} \Put\o[c]{\bf \LARGE #1}
\def\V{(-12, -25)} \def\W{(392, -25)}
{\allinethickness{2pt}
\Drawline{\V\W}}
\end{zahyou*}
\vspace{\baselineskip}
}%
\makeatother

\begin{document}

\section{2次関数の最大・最小}
$y$が$x$の2次式で表されるとき, $y$は$x$の{\bf {\large 2次関数}}といいます. 

\section{2次関数の極大・極小}
$y$が$x$の2次式で表されるとき, $y$は$x$の{\bf {\large 2次関数}}といいます. 

\end{document}
スレッド一覧


388● Re[2]:\sectionや\subsectionについて[ しゅうすけ ] 2007 06/24 01:40
 ありがとうございます。

この\sectionを使うと、目次もできるのでしょうか?
一度試してみたのですが、\tableofcontentsではできませんでした。

こういうのはどのように勉強すればできるようになるのでしょうか?
正直何をどのようにしてできているのかがわかりません。

勉強になるサイトや本があれば参考にさせていただきます。

これからも色々と勉強させてもらおうと思っています。
よろしくお願いいたします。

スレッド一覧


389● Re[3]:\sectionや\subsectionについて[ 石原 守 ] 2007 06/24 06:02
\documentclass[b5paper, 11pt, twoside]{jarticle}

%\usepackage{emath}
\usepackage[papersize]{emathP}

\setlength{\topmargin}{-50pt}
\setlength{\textheight}{21.5cm}
\setlength{\textwidth}{38zw}
\setlength{\oddsidemargin}{-1.05cm}
\setlength{\evensidemargin}{0.15cm}

\makeatletter
%
% section
\newif\ifsecnewpage\secnewpagetrue
\renewcommand{\section}{%
  \pagebreak[2]%
  \ifsecnewpage
    \clearpage
  \fi
  \global\@topnum\z@
  \@afterindenttrue
  \secdef\@section\@ssection}
\def\@section[#1]#2{%
  \ifnum \c@secnumdepth >0
    \refstepcounter{section}%
    \addcontentsline{toc}{section}%
      {\protect\numberline{\thesection}#1}%
  \else
    \addcontentsline{toc}{section}{#1}%
  \fi
  \sectionmark{#1}%
  \@makesectionhead{#2}\@afterheading
  \endsection
}
\def\@ssection#1{%
%  \addcontentsline{toc}{section}{#1}%この下3行をコメントにしても良い
  \sectionmark{#1}%
  \@makessectionhead{#1}\@afterheading
  \endsection
}
\def\@makessectionhead#1{%
\vskip2\baselineskip
\begin{zahyou*}(0, 360)(0, 0)
\def\O{(190, 18)} 
\def\P{(-12, 30)} \def\Q{(392, 30)} \Drawline{\P\Q}
\def\R{(-12, 10)} \def\S{(392, 10)} \Drawline{\R\S}
\def\T{(-12, 5)} \def\U{(392, 5)} \Drawline{\T\U}
\def\a{(-12, 0)} \def\b{(80, 0)} \def\c{(60, -20)} \def\d{(-12, -20)}
\def\e{(90, 0)} \def\f{(290, 0)} \def\g{(310, -20)} \def\h{(70, -20)}
\def\i{(392, 0)} \def\j{(300, 0)} \def\k{(320, -20)} \def\l{(392, -20)}
\Drawline{\a\b\c\d} \Drawline{\e\f\g\h\e} \Drawline{\i\j\k\l}
\Nuritubusi[1]{\P\Q\S\R}
\Put\O[c]{\textcolor{white}{\bf \Large 目次}}
\def\o{(190, -12)} \Put\o[c]{\bf \LARGE #1}
\def\V{(-12, -25)} \def\W{(392, -25)}
{\allinethickness{2pt}
\Drawline{\V\W}}
\end{zahyou*}
\vspace{\baselineskip}
}
\def\endsection{\nopagebreak
   \vskip1\baselineskip
   \nopagebreak
}
\def\@makesectionhead#1{%
\vskip2\baselineskip
\begin{zahyou*}(0, 360)(0, 0)
\def\O{(190, 18)} 
\def\P{(-12, 30)} \def\Q{(392, 30)} \Drawline{\P\Q}
\def\R{(-12, 10)} \def\S{(392, 10)} \Drawline{\R\S}
\def\T{(-12, 5)} \def\U{(392, 5)} \Drawline{\T\U}
\def\a{(-12, 0)} \def\b{(80, 0)} \def\c{(60, -20)} \def\d{(-12, -20)}
\def\e{(90, 0)} \def\f{(290, 0)} \def\g{(310, -20)} \def\h{(70, -20)}
\def\i{(392, 0)} \def\j{(300, 0)} \def\k{(320, -20)} \def\l{(392, -20)}
\Drawline{\a\b\c\d} \Drawline{\e\f\g\h\e} \Drawline{\i\j\k\l}
\Nuritubusi[1]{\P\Q\S\R}
\Put\O[c]{\textcolor{white}{\bf \Large 第\;\thesection\;講}}
\def\o{(190, -12)} \Put\o[c]{\bf \LARGE #1}
\def\V{(-12, -25)} \def\W{(392, -25)}
{\allinethickness{2pt}
\Drawline{\V\W}}
\end{zahyou*}
\vspace{\baselineskip}
}%
\makeatother

\begin{document}
\pagenumbering{roman}%
\tableofcontents
\clearpage
\pagenumbering{arabic}
\section{2次関数の最大・最小}
$y$が$x$の2次式で表されるとき, $y$は$x$の{\bf {\large 2次関数}}といいます. 

\section{2次関数の極大・極小}
$y$が$x$の2次式で表されるとき, $y$は$x$の{\bf {\large 2次関数}}といいます. 

\end{document}

乙部先生の
 クラスファイル配布
http://argent.shinshu-u.ac.jp/otobe/tex/packages/package.html
「pLaTeX2e for Windows Another Manualシリーズに
 ちょっと似た出力ができるためのクラスファイル」
を改変したものです。

15行目\secnewpagefalseを\secnewpagetrueにすると
必ず改ページされます。

参考書は奥村先生の掲示板にいろいろ載っています。
(ここの過去ログにも数ヶ所あります。)
今は絶版のもののありますが本屋には残っているので
本屋で見かけたら買って損はないと思います。
特に乙部さん,本田・吉永さんのもの
スレッド一覧


390● Re[4]:\sectionや\subsectionについて[ しゅうすけ ] 2007 06/24 10:46
 本当にありがとうございました。

早速色々と勉強させていただきます。
次は自分で\subsectionをカスタマイズすることに挑戦してみます。
もしうまくいかないときはまたここに質問させていただきます。

本当にありがとうございまいした。今後もよろしくお願いいたします。
スレッド一覧

CGIROOM