Skip to content

Instantly share code, notes, and snippets.

@yuw
Created April 8, 2018 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yuw/48764995abf8ed7ab3525fb34fec107f to your computer and use it in GitHub Desktop.
Save yuw/48764995abf8ed7ab3525fb34fec107f to your computer and use it in GitHub Desktop.
参考文献の行長を字幅の整数倍にする
\documentclass{jlreq}
\makeatletter
\renewenvironment{thebibliography}[1]{%
\jlreq@oldfontcommand@enable
\section*{\refname}%
\@mkboth{\refname}{\refname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\@tempdimb\labelwidth
\advance\@tempdimb\labelsep
\@tempdima1\zw
\loop\ifdim\@tempdima<\labelwidth\relax
\advance\@tempdima1\zw\relax
\repeat
\labelwidth\@tempdima
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\itemindent=0pt
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty\clubpenalty
\widowpenalty4000%
\sfcode`\.\@m
}{%
\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist
\jlreq@oldfontcommand@disable
}
\makeatother
\begin{document}
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
\begin{thebibliography}{9}
\bibitem{one}
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
\bibitem{two}
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
□□□□□□□□□■□□□□□□□□□■□□□□□□□□□■
\end{thebibliography}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment