如何為摘要部分新增文字?

如何為摘要部分新增文字?

我的問題可能不是很清楚!我正在寫一篇關於學生的總結論文。每個學生都有一個部分。在本節中,我詳細說明了其品質和結果,最後我提出了一個值得注意的意見

% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode


\documentclass[11pt]{article}  

\usepackage[utf8]{inputenc}

\usepackage{lipsum}

\newcommand{\Avis}[1]{
\textbf{Avis=#1}
\addcontentsline{toc}{subsection}{Avis=#1}
}

\begin{document}

\tableofcontents
\clearpage

\section{Nom-Prenom1}

\lipsum[2]

\Avis{5}

\section{Nom-Prenom2}

\lipsum[3]

\Avis{8}


\section{Nom-Prenom3}

\lipsum[5]

\Avis{10}


\end{document}

我希望在我們在同一行上找到的摘要中

姓1 名1:意見=8------------------------頁碼。

姓氏2 名字2:意見=5------------------------頁碼。

在此輸入影像描述

答案1

這是一種方法。一些評論:

  • 一個想法是定義一個新環境;然而使用它很笨拙,並且由於某種原因它不喜歡參數,例如#3,在其結尾部分
  • 所以我介紹了\newcommand\student[4]{% last, first, avis, comments ...
  • 它包含cabohah 關於各部分的想法
  • 在文檔正文中,我展示了一些使用它的方法,即透過調整程式碼格式
  • 軟體包:tikz可能在您的系統上,但simpsons可能會遺失(如果您不需要這些,只需註解掉)
  • 基本上你會寫一個普通的 LaTeX 程式碼作為參數#4
  • 如果您錯過了目錄中的點,介紹也沒什麼大不了的

結果

\documentclass[11pt]{article}  
%\usepackage[utf8]{inputenc}
\usepackage{lipsum}

% ~~~ simpsonizing ... ~~~
\usepackage{tikz}       % is probably on your system
\usepackage{simpsons}   % perhaps needs to be installed


% ~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand\student[4]{% last, first, avis, comments
\section[#1, #2: Avis=\ #3]{#1, #2}%
#4%

\textbf{Avis: #3}%
}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
 \tableofcontents
 \clearpage

 \student{Hitchcock}{Alfred}{10}{
Master or horriffic horror secenes. 
 }
 
 \student{Einstein}{Albert}{3}{
    \lipsum[5-6]
 }
 
 % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 \student   {Simpson}
            {Bart}
            {0}
    {
    Do I really need to say more?
    
    \vspace{20pt}
    \begin{tikzpicture}
        \node[draw=red] {You s**k!};
    \end{tikzpicture}
    \Bart
 }

\end{document}

相關內容