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

采用(著者—出版年制)格式,参考文献处字符第二行只缩进1个字不是缩进两个字,不清楚在哪里可以修改缩进的字 #433

Open
4 of 10 tasks
ilovezcx opened this issue Jan 16, 2024 · 5 comments

Comments

@ilovezcx
Copy link

检查 / Check

编译环境 / Compilation Environment

  • 操作系统 / Operating System

    • Windows 7/8/10
    • macOS
    • Linux
  • TeX 发行版 / Tex Distribution

    • TeX Live
    • MiKTeX
    • CTeX

描述问题 / Problem Description

问题描述:
编译后的参考文献只缩进了一个字符,模板要求的缩进两个字符,图片标注的地方,不知道参考文献这个地方需要缩进怎么修改

日志文件 / .log file

将编译生成的 .log 文件拖入下行空白处:

问题截图 / Screenshots

将出现的问题或需要实现的效果的 截图照片 拖入下行空白处:
image

最小工作示例(MWE) / Minimal Working Example

image

@ilovezcx ilovezcx changed the title 采用(著者—出版年制)格式,参考文献处字符第二行只缩进1个字不是缩进两个字 采用(著者—出版年制)格式,参考文献处字符第二行只缩进1个字不是缩进两个字,不清楚在哪里可以修改缩进的字 Jan 16, 2024
@sikouhjw
Copy link

要考虑修改 article 之类的相关源码

\documentclass{ctexart}
\usepackage{gbt7714}
\bibliographystyle{gbt7714-author-year}

\makeatletter
\renewcommand\@openbib@code{% article.cls
  \advance\leftmargin\bibindent
  \itemindent -\bibindent
  \listparindent \itemindent
  \parsep \z@
  }%
\renewenvironment{thebibliography}[1]% article.cls
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@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}
\makeatother

\begin{document}
\cite{1962kangxizidian}

\begin{thebibliography}{1111}
\bibitem[196(1962)]{1962kangxizidian}
佚名, 1962.
\newblock 康熙字典: 巳集上: 水部\allowbreak[M].
\newblock 同文书局影印本.
\newblock 北京: 中华书局: 50.
\end{thebibliography}
\end{document}

猜测应该是通过修改 \@openbib@code 实现。

@ilovezcx
Copy link
Author

要考虑修改 article 之类的相关源码

\documentclass{ctexart}
\usepackage{gbt7714}
\bibliographystyle{gbt7714-author-year}

\makeatletter
\renewcommand\@openbib@code{% article.cls
  \advance\leftmargin\bibindent
  \itemindent -\bibindent
  \listparindent \itemindent
  \parsep \z@
  }%
\renewenvironment{thebibliography}[1]% article.cls
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@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}
\makeatother

\begin{document}
\cite{1962kangxizidian}

\begin{thebibliography}{1111}
\bibitem[196(1962)]{1962kangxizidian}
佚名, 1962.
\newblock 康熙字典: 巳集上: 水部\allowbreak[M].
\newblock 同文书局影印本.
\newblock 北京: 中华书局: 50.
\end{thebibliography}
\end{document}

猜测应该是通过修改 \@openbib@code 实现。

这串代码在哪个文件里我找了没有找到

@sikouhjw
Copy link

这串代码在哪个文件里我找了没有找到

article.cls

@ilovezcx
Copy link
Author

这串代码在哪个文件里我找了没有找到

article.cls

image
我的模板结构这样的,我在ucasthesis.cls也没有找到类似的代码行,我再找找看

@sikouhjw
Copy link

article.cls 是 latex 基础文件,不在项目里。由于你用的是 Overleaf 而不是本地编译,因此你无法在你的电脑上找到该 cls 文件。

综上,建议别改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants