Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slide で \subsubsection が罫線に重なる #27

Closed
aminophen opened this issue Jul 22, 2016 · 13 comments
Closed

slide で \subsubsection が罫線に重なる #27

aminophen opened this issue Jul 22, 2016 · 13 comments
Labels

Comments

@aminophen
Copy link
Member

aminophen commented Jul 22, 2016

forum:1982 より。

\documentclass[slide,papersize]{jsarticle}
\begin{document}
\section{あいうえお}
\subsection{かきくけこ}
\subsubsection{さしすせそ}
\end{document}

などで \subsubsection が罫線に重なる。

@aminophen
Copy link
Member Author

aminophen commented Jul 22, 2016

簡単には以下のようにするとよいようです(jsarticle.cls の \subsubsection を定義している部分):

\if@twocolumn
  \newcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
    {\z@}{\z@}%
    {\normalfont\normalsize\headfont}}
\else
  \newcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
    {\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
    {\if@slide .5\Cvs \@plus.3\Cdp \else \z@ \fi}% <= もとは単に {\z@} でした
    {\normalfont\normalsize\headfont}}
\fi

@okumuralab
Copy link
Member

すばらしいです。ありがとうございますm(__)m

aminophen added a commit to aminophen/jsclasses that referenced this issue Jul 22, 2016
@cmplstofB
Copy link

ありがとうございます.

@aminophen
Copy link
Member Author

aminophen commented Jul 22, 2016

簡単には以下のようにするとよいようです

別の直し方もできて、それは \@xsect の定義を

\def\@xsect#1{%
%%%%% 新しい位置(パラメータは微調整)
  \if@slide
    {\vskip.5\jsc@mpt\maybeblue\hrule height0\jsc@mpt depth1\jsc@mpt\vskip.5\jsc@mpt\relax}%
  \fi
%%%%%
  \@tempskipa #1\relax
  \ifdim \@tempskipa<\z@
    \@nobreakfalse
    \global\@noskipsectrue
    \everypar{%
      \if@noskipsec
        \global\@noskipsecfalse
       {\setbox\z@\lastbox}%
        \clubpenalty\@M
        \begingroup \@svsechd \endgroup
        \unskip
        \@tempskipa #1\relax
        \hskip -\@tempskipa
      \else
        \clubpenalty \@clubpenalty
        \everypar{\everyparhook}%
      \fi\everyparhook}%
  \else
    \par \nobreak
    \vskip \@tempskipa
    \@afterheading
  \fi
%%%%% 元のコード
%  \if@slide
%    {\vskip-6\jsc@mpt\maybeblue\hrule height0\jsc@mpt depth1\jsc@mpt\vskip7\jsc@mpt\relax}%
%  \fi
%%%%%
  \par  % 2000-12-18
  \ignorespaces}

とすることです(上に書いた \subsubsection の定義変更はしない)。これと先ほどの簡単な修正のどちらがよいかはわかりません。

両者の違いは、「\@sect の修正」のほうだと、\subsubsection の罫線と次の行が密着するのに対し、「簡単な修正」のほうだと密着せず \section や \subsection と同じような見た目になります。(「簡単な修正」のほうが見た目的には綺麗になっていると私は思います)

@cmplstofB
Copy link

すいません...
その命令文をどのファイルに付け加えたらよいですか?

@aminophen
Copy link
Member Author

aminophen commented Jul 22, 2016

簡単には以下のようにするとよいようです

のものを試したいということであれば、ご自身のソースファイルのプリアンブルに

\makeatletter
  \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
    {\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
    {\if@slide .5\Cvs \@plus.3\Cdp \else \z@ \fi}% <= もとは単に {\z@} でした
    {\normalfont\normalsize\headfont}}
\makeatother

と書いてみてください。

別の直し方もできて、それは @xsect の定義を

のものを試す場合は、やはりご自身のソースファイルのプリアンブルに

\makeatletter
\def\@xsect#1{%
%%%%% 新しい位置(パラメータは微調整)
  \if@slide
…………… 長いのでここでは省略します ……………
%%%%%
  \par  % 2000-12-18
  \ignorespaces}
\makeatother

と書いてみてください。

@cmplstofB
Copy link

解決しました! 非常にうれしいです.

@cmplstofB
Copy link

解決したと書いてしまいましたが,まだ問題があるようです.
今度は段落題に罫線が重なります.
手間掛けさしてすいません.
簡単な方.pdf
複雑な方.pdf

@aminophen
Copy link
Member Author

aminophen commented Jul 23, 2016

今度は段落題に罫線が重なります

「今度は」というより、前からそうだったと思います。先ほど直したのは \subsubsection だけですので、同じような修正を \paragraph と \subparagraph に入れればよいです。(ちょっと他で手が離せないので、jsarticle.cls の中の当該定義を見つけて私のマネをして \renewcommand してみてください)

「節題の罫線は二本線だった」というのは事実誤認であると思います。もともとすべてが一本線だったはずですから。また、いま小小節題の罫線が二本線に見えるのは、段落題の罫線が上に持ち上がっているからだと思います。(いま TeX を動かせる環境にいないので間違っているかもしれませんが)

@cmplstofB
Copy link

そうですね.すいません.

@aminophen
Copy link
Member Author

(移動中の電車内から投稿;まだ全然 TeX 動かしていませんが、B-bar さんに質問です)

\paragraph とか \subparagraph はたしか、題名の後に改行が入らないと思います。罫線は行の幅いっぱい引かれますから、短い題名では続く文章にも罫線が引かれている状態が予想されます。果たして

  • 罫線があったほうがよいと思われますか?
  • 罫線が欲しい場合、どのように(長さや位置)引けばよいでしょうか?

(私から単に質問したいだけです。ご意見をお聞かせください)

@cmplstofB
Copy link

私の命令文が悪いのか,\paragraph段落は他と分離しています.

\makeatletter
  \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
    {\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
    {\if@slide .5\Cvs \@plus.3\Cdp \else \z@ \fi}% <= もとは単に {\z@} でした
    {\normalfont\normalsize\headfont}}
\makeatother
\makeatletter
  \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
    {\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
    {\if@slide .5\Cvs \@plus.3\Cdp \else \z@ \fi}% <= もとは単に {\z@} でした
    {\normalfont\normalsize\headfont}}
\makeatother
\makeatletter
  \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
    {\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
    {\if@slide .5\Cvs \@plus.3\Cdp \else \z@ \fi}% <= もとは単に {\z@} でした
    {\normalfont\normalsize\headfont}}
\makeatother

いづれにせよ罫線は欲しいです.さらに我が儘を言うなら,\paragraphや\subparagraphの罫線はかなり細めかが良いです.位置や長さは他の見出し命令と同じ低層で構わないです. 馬鹿丸出しな投稿すいませんがよろしくお願いします.

@aminophen
Copy link
Member Author

遅くなりましたが、ようやく試しました。長ったらしくみえますが、「簡単な方」の方針を \subsubsection 以外の命令にも全部適用しただけです。ご自分でお試しになる場合は、以下のコードをお使いのソースファイルにコピペしてみてください。(\documentclass[twocolumn,slide]{jsarticle} という同時指定の場合にも変なことにならないように弄ってみました)

\makeatletter
\if@twocolumn
  \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
    {\z@}{\if@slide .4\Cvs \else \z@ \fi}%
    {\normalfont\normalsize\headfont}}
\else
  \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
    {\Cvs \@plus.5\Cdp \@minus.2\Cdp}% 前アキ
    {.5\Cvs \@plus.3\Cdp}% 後アキ
    {\normalfont\large\headfont}}
\fi
\if@twocolumn
  \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
    {\z@}{\if@slide .4\Cvs \else \z@ \fi}%
    {\normalfont\normalsize\headfont}}
\else
  \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
    {\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
    {\if@slide .5\Cvs \@plus.3\Cdp \else \z@ \fi}%
    {\normalfont\normalsize\headfont}}
\fi
\if@twocolumn
  \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
    {\z@}{\if@slide .4\Cvs \else -1zw\fi}% 改行せず 1zw のアキ
    {\normalfont\normalsize\headfont ■}}
\else
  \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
    {0.5\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
    {\if@slide .5\Cvs \@plus.3\Cdp \else -1zw\fi}% 改行せず 1zw のアキ
    {\normalfont\normalsize\headfont ■}}
\fi
\if@twocolumn
  \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
    {\z@}{\if@slide .4\Cvs \@plus.3\Cdp \else -1zw\fi}%
    {\normalfont\normalsize\headfont}}
\else
  \renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
    {\z@}{\if@slide .5\Cvs \@plus.3\Cdp \else -1zw\fi}%
    {\normalfont\normalsize\headfont}}
\fi
\makeatother

\paragraphや\subparagraphの罫線はかなり細めかが良いです.位置や長さは他の見出し命令と同じ低層で構わないです.

ただし、現在の jsarticle には罫線の太さを変えるインタフェースが無いので、なにもしていません(もし今後新設するなら、そのやり方をイチから考えて作らなければなりません)。

aminophen added a commit to aminophen/jsclasses that referenced this issue Jul 28, 2016
aminophen added a commit to aminophen/jsclasses that referenced this issue Jul 28, 2016
okumuralab added a commit that referenced this issue Aug 16, 2016
jsclasses.dtx: \subsubsection for slide (#27)
@aminophen aminophen added the bug label Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants