名前: 安田 亨 日時: 2006-08-27 01:10:58 IPアドレス: 121.2.97.*
>>44469 ちょうど変則二段組みでparallel.styを用いたものを いじっていたところでした.オリジナルのparallel.sty にはjsarticleで用いると罫線が切れるという不具合が ありましたので.某達人に直していただいたものを以下にあげます. \makeatletterと \makeatotherの間がパッチあてしたparallel.styです.文字数の配分 を変えると罫線左の空きを調整できます. 以下,長いです. \documentclass{jsarticle} %\usepackage{parallel} \setlength\fullwidth{40zw} \setlength\textwidth{\fullwidth} \setlength{\textheight}{40\baselineskip} \makeatletter \newdimen\ParallelLWidth \newdimen\ParallelRWidth \newdimen\ParallelTextWidth \newdimen\ParallelLeftMargin \newdimen\ParallelUserMidSkip \newdimen\ParallelMainMidSkip \newbox\ParallelLBox \newbox\ParallelRBox \newbox\ParallelBoxVar \newbox\ParallelLTok \newbox\ParallelRTok \newcount\ParallelBoolVar \newcount\ParallelBoolMid \newcount\ParallelWhichBox \newcount\ParallelMainMode \newcount\ParallelFNMode \newcount\ParallelLFNCounter \newcount\ParallelRFNCounter \newcount\ParallelMaxFN \newcount\ParallelFNNumMode \newcommand{\ParallelMessage}[1]{\relax} \DeclareOption{Verbose}{% \renewcommand{\ParallelMessage}[1]{\message{#1}} \message{Verbose} } \DeclareOption{OldStyleNums}{% \ParallelFNNumMode=1\ParallelMessage{OldStyleNums}} \DeclareOption{RaiseNums}{% \ParallelFNNumMode=2\ParallelMessage{RaiseNums}} \DeclareOption{ItalicNums}{% \ParallelFNNumMode=3\ParallelMessage{ItalicNums}} \DeclareOption{RomanNums}{% \ParallelFNNumMode=4\ParallelMessage{RomanNums}} \DeclareOption{SeparatedFootnotes}{% \ParallelFNMode=1\ParallelMessage{SeparatedFootnotes}} \newcommand{\ParallelLFootnote}[1]{% \global\advance\ParallelLFNCounter\@ne \footnotemark[\number\ParallelLFNCounter]% \expandafter\gdef% \csname ParallelLFN\romannumeral\ParallelLFNCounter\endcsname{#1}} \newcommand{\ParallelRFootnote}[1]{% \global\advance\ParallelRFNCounter\@ne \footnotemark[\number\ParallelRFNCounter]% \expandafter\gdef% \csname ParallelRFN\romannumeral\ParallelRFNCounter\endcsname{#1}} \newenvironment{ParallelFNEnviron}{% \footnotesize \begin{list}{}{% \leftmargin=4em \rightmargin=\z@ \topsep=\z@skip \itemsep=\z@skip \labelwidth=3em \labelsep=1em% \renewcommand{\makelabel}[1]{{\hfill\footnotesize ##1}}% }% }{% \end{list}% } \newcommand{\ParallelShowFNList}{% % footnotes in left or right column, i.e. left+right>0? \ParallelMaxFN=\ParallelLFNCounter \advance\ParallelMaxFN \ParallelRFNCounter \ifnum\ParallelMaxFN>\z@ \ParallelMessage{Parallel Footnotes (}% \begin{ParallelFNEnviron}% \ParallelMaxFN=\ParallelLFNCounter \global\ParallelLFNCounter=\z@ \loop \ifnum\ParallelLFNCounter<\ParallelMaxFN \global\advance\ParallelLFNCounter \@ne \item[\ifcase\ParallelFNNumMode \number\ParallelLFNCounter% \or \oldstylenums{\the\ParallelLFNCounter}% \or \raisebox{1ex}{\the\ParallelLFNCounter}% \or \textit{\number\ParallelLFNCounter}% \or \romannumeral\ParallelLFNCounter% \else \number\ParallelLFNCounter \fi]% \par {\csname ParallelLFN\romannumeral\ParallelLFNCounter\endcsname}% \par \repeat \end{ParallelFNEnviron}% \ifnum\ParallelFNMode=\@ne \begin{ParallelFNEnviron}% \ParallelMaxFN=\ParallelRFNCounter \global\ParallelRFNCounter=\z@ \loop \ifnum\ParallelRFNCounter<\ParallelMaxFN \global\advance\ParallelRFNCounter \@ne \item[\ifcase\ParallelFNNumMode \number\ParallelRFNCounter\ParallelDot \or \oldstylenums{\the\ParallelRFNCounter}\ParallelDot \or \raisebox{1ex}{\the\ParallelRFNCounter\ParallelDot}% \or \textit{\number\ParallelRFNCounter\ParallelDot}% \or \romannumeral\ParallelLFNCounter% \else \number\ParallelRFNCounter\ParallelDot \fi]% \par {\csname ParallelRFN\romannumeral\ParallelRFNCounter\endcsname}% \par \repeat \end{ParallelFNEnviron}% \fi \global\ParallelLFNCounter=\z@ \global\ParallelRFNCounter=\z@ \ParallelMessage{)}% \else \ParallelMessage{No Parallel Footnotes}% \fi } \def\ParallelParOnePage{% \ifnum\ParallelBoolVar=\@ne \par\begingroup \leftmargin=\z@ \rightmargin=\z@ \parskip=\z@skip \parindent=\z@ \lineskiplimit\z@ \lineskip\z@ %%% この設定を追加 \vbadness=10000 \vfuzz=3ex \splittopskip=\z@skip \loop% \ifnum\ParallelBoolVar=\@ne% \noindent \hbox to\textwidth{% \hskip\ParallelLeftMargin \hbox to\ParallelTextWidth{% \ifvoid\ParallelLBox \hskip\ParallelLWidth \else \ParallelWhichBox=\z@ \vbox{\setbox\ParallelBoxVar =\vsplit\ParallelLBox to\dp\strutbox% \unvbox\ParallelBoxVar}% \fi \strut \ifnum\ParallelBoolMid=\@ne \hskip\ParallelMainMidSkip \vrule \@width\columnseprule \else \hss \fi \hss \ifvoid\ParallelRBox \hskip\ParallelRWidth \else \ParallelWhichBox=\@ne \vbox{\setbox\ParallelBoxVar =\vsplit\ParallelRBox to\dp\strutbox% \unvbox\ParallelBoxVar}% \fi}}% \ifvoid\ParallelLBox \ifvoid\ParallelRBox \global\ParallelBoolVar=\z@ \fi\fi% \fi% \ifnum\ParallelBoolVar=\@ne% \penalty\interlinepenalty \repeat \par \endgroup \fi} \newcommand{\ParallelParTwoPages}{% \ifnum\ParallelBoolVar=\@ne \par\begingroup \global\ParallelWhichBox=\@ne \newpage \vbadness=10000 \vfuzz=3ex \splittopskip=\z@skip \loop% \ifnum\ParallelBoolVar=\@ne% \ifnum\ParallelWhichBox=\@ne \ifvoid\ParallelLBox \mbox{} \newpage \else\global\ParallelWhichBox=\z@\fi \else \ifvoid\ParallelRBox \mbox{} \newpage \else\global\ParallelWhichBox=\@ne\fi \fi \ifnum\ParallelWhichBox=\z@ \ifodd\thepage \mbox{} \newpage \fi \hbox to\textwidth{% \vbox{\vsplit\ParallelLBox to.98\textheight}}% \else \ifodd\thepage\relax\else \mbox{} \newpage \fi \hbox to\textwidth{% \vbox{\vsplit\ParallelRBox to.98\textheight}}% \fi \vspace*{\fill}\newpage \fi \ifvoid\ParallelLBox\ifvoid\ParallelRBox \global\ParallelBoolVar=\z@ \fi\fi \ifnum\ParallelBoolVar=\@ne \repeat \par \endgroup \fi} \newcommand{\ParallelAfterText}{% \global\ParallelBoolVar=\@ne \let\footnote=\ParallelOldFootnote\endgroup} \newcommand{\ParallelCheckOpenBrace}{% \ifx\x\bgroup \else \errmessage{Missing opening brace}% \fi \endgroup} \newcommand{\ParallelLText}{% \everypar{}\@restorepar\begingroup \hbadness=3000 \let\footnote=\ParallelLFootnote \ParallelWhichBox=0 \global\setbox\ParallelLBox=\vbox\bgroup \hsize=\ParallelLWidth \aftergroup\ParallelAfterText \begingroup \afterassignment\ParallelCheckOpenBrace \let\x=} \newcommand{\ParallelRText}{% \everypar{}\@restorepar\begingroup \hbadness=3000 \ifnum\ParallelFNMode=\@ne \let\footnote=\ParallelRFootnote \else \let\footnote=\ParallelLFootnote \fi \ParallelWhichBox=\@ne \global\setbox\ParallelRBox=\vbox\bgroup \hsize=\ParallelRWidth \aftergroup\ParallelAfterText \begingroup \afterassignment\ParallelCheckOpenBrace \let\x=} \newcommand{\ParallelAtEnd}{} \newcommand{\ParallelPar}{} % Dummy \newcommand{\ParallelDot}{\ensuremath{\cdot}} \newenvironment{Parallel}[3][c]{% \begingroup% \ParallelTextWidth=\linewidth \ParallelLeftMargin=\textwidth \advance\ParallelLeftMargin by-\linewidth \if #1p\relax \ParallelMessage{ on Pages (}% \ParallelMainMode=\z@ \renewcommand{\ParallelPar}{\ParallelParTwoPages} \else \if #1a\relax \ParallelMessage{ autocomputed Pages (}% \ParallelMainMode=\tw@ \renewcommand{\ParallelPar}{\ParallelParTwoPages} \else \tolerance=600 % sorry, but neccessary \emergencystretch=.5em % dto. \ParallelMainMode=\@ne \renewcommand{\ParallelPar}{\ParallelParOnePage} \if #1v\relax \ParallelBoolMid=\@ne \ParallelMessage{ in Columns, with VLine (}% \else \if #1c\relax\else \errhelp{possible options: 'p'age, 'c'olumn or columns with 'v'line --- type <return> to proceed in column-mode} \errmessage{bad option '#1' to environment 'Parallel'} \fi \ParallelMessage{ in Columns (}% \fi\fi\fi \def\ParallelArgL{#2} \def\ParallelArgR{#3} \ifx\ParallelArgL\empty\ParallelLWidth=0in\else\ifx\ParallelArgL\space \ParallelLWidth=0in\else\setlength\ParallelLWidth{#2}\fi\fi \ifx\ParallelArgR\empty\ParallelRWidth=0in\else\ifx\ParallelArgR\space \ParallelRWidth=0in\else\setlength\ParallelRWidth{#3}\fi\fi \ifnum\ParallelMainMode=\@ne \ifdim\ParallelLWidth>1em \ifdim\ParallelRWidth>1em \ParallelMainMidSkip=\linewidth \advance\ParallelMainMidSkip by-\ParallelLWidth \advance\ParallelMainMidSkip by-\ParallelRWidth \advance\ParallelMainMidSkip by-.5pt \advance\ParallelMainMidSkip by-\ParallelLeftMargin \divide\ParallelMainMidSkip by 2 \else \ParallelRWidth=\linewidth \advance\ParallelRWidth by-\ParallelLWidth \advance\ParallelRWidth by-2\ParallelUserMidSkip \advance\ParallelRWidth by-\ParallelLeftMargin \ParallelMainMidSkip=\ParallelUserMidSkip \fi \else \ifdim\ParallelRWidth>1em \ParallelLWidth=\linewidth \advance\ParallelLWidth by-\ParallelRWidth \advance\ParallelLWidth by-2\ParallelUserMidSkip \advance\ParallelLWidth by-\ParallelLeftMargin \ParallelMainMidSkip=\ParallelUserMidSkip \else \ParallelLWidth=.5\linewidth \advance\ParallelLWidth by-\ParallelLeftMargin \advance\ParallelLWidth by-\ParallelUserMidSkip \ParallelRWidth=\ParallelLWidth \ParallelMainMidSkip=\ParallelUserMidSkip \fi \fi \else \ifdim\ParallelLWidth>1em \ifdim\ParallelRWidth>1em \else \ParallelRWidth=\linewidth \advance\ParallelRWidth by-\ParallelLeftMargin \fi \else \ifdim\ParallelRWidth>1em \ParallelLWidth=\linewidth \advance\ParallelLWidth by-\ParallelLeftMargin \else \ParallelLWidth=\linewidth \advance\ParallelLWidth by-\ParallelLeftMargin \ParallelRWidth=\linewidth \advance\ParallelRWidth by-\ParallelLeftMargin \fi \fi \fi \global\ParallelLFNCounter=\z@ \global\ParallelRFNCounter=\z@ \let\ParallelOldFootnote=\footnote }{% \ParallelPar% \ParallelAtEnd% \endgroup% \ParallelShowFNList% \let\footnote=\ParallelOldFootnote \ParallelMessage{)}} \ParallelFNNumMode=\z@ \ParallelFNMode=\z@ \ParallelBoolMid=\z@ \ParallelUserMidSkip=.5em \ProcessOptions \makeatother \begin{document} ここは罫線なしの部分 \begin{Parallel}[v]{2zw}{37zw} \setlength{\columnseprule}{0.5pt} \tolerance=1000 \ParallelRText{ 罫線右の文書罫線右の文書罫線右の文書 罫線右の文書罫線右の文書罫線右の文書 罫線右の文書罫線右の文書罫線右の文書 罫線右の文書罫線右の文書罫線右の文書 罫線右の文書罫線右の文書罫線右の文書 罫線右の文書罫線右の文書罫線右の文書 } \end{Parallel} ここは罫線なしの部分 \end{document}
この書き込みへの返事: