如何将其他来源的引文插入到 tex 中

如何将其他来源的引文插入到 tex 中

通常,当插入别人说的东西时,我们想特别标记并格式化它,例如在论坛中,您可以使用[quote][/quote]bbcode 格式,甚至使用 markdown \>

在我的 tex 示例中:

\documentclass[a4paper,25pt]{report}
\usepackage[a4paper,footskip=0.25in]{geometry}

\usepackage{makeidx}
\usepackage{polyglossia}
\usepackage{csquotes}
\usepackage{xltxtra}
\usepackage{xunicode}
\usepackage{libertine}
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage{url}

% Uncomment it and uncomment any \lipsum notation as well.
% Afterwards build and see how beautifull result is displayed
\usepackage{lipsum}


\usepackage[backend=bibtex, bibstyle=numeric, citestyle=numeric-comp, sorting=none]{biblatex}
\bibliography{./material.bib}

\usepackage[pdfauthor={"Dimitrios Desyllas, Ioannis anagnostou"},
    pdftitle={"Setting up a LoRa IoT communication using LoRaWAN"},
    pdfsubject={"iot"},
    pdfkeywords={"privacy by design, privacy, howto, technologies, legal requirements"},
    hidelinks
]{hyperref}

\setdefaultlanguage{english}
\setotherlanguages{greek}

\setmainfont{Liberation Serif}
\newfontfamily\greekfont[Script=Greek]{Linux Libertine O}
\newfontfamily\greekfontsf[Script=Greek]{Linux Libertine O}
\setmainfont[Kerning=On,Mapping=tex-text]{Linux Libertine O}

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{Univercity Of MOE OTAKUS}
\fancyhead[R]{Legion on Otakus \& Weabos}


\title{Motteke Seifuku}
\date{Univercity of Moe Otakus - 2018}
\author{Dimitrios Desyllas (Nekomimi1233)}

\begin{document}
    \maketitle
    \tableofcontents

    \chapter{Introduction}
        \lipsum[1-20]

    \chapter{Motteke Seifuku}
        \section{Seifukus Rocks!!!}
        \subsection{Generic information}
          This is a nice list \cite{US7791415B2}
        \begin{enumerate}
            \item Seifuku are awesome
            \item Watashiwaravuseifuku
            \item whatecer I want
        \end{enumerate}

    Also someone special \cite{US7791415B2} said:

    "Seifukus are the quide to the future"
    - Someone Special

    \lipsum[5-9]


        \subsection{Frequencies of seing seifuku}
    \lipsum[5-9]

        \section{Lorem Ipsum}
        \lipsum[1-20]

    \chapter{Implementation of Lorem Ispum}
        \section{Introduction}
        \lipsum[1-8]
        \section{Materials Used}
        \lipsum[5-10]
        \section{Projects Implemented}
        \lipsum[7-13]
    \printbibliography
\end{document}

我希望能够标记该部分:

"Seifukus are the quide to the future"
- Someone Special

在我的文字中如:

\begin[from=Someone Special]{quote}
Seifukus are the quide to the future
\end{quote}

并以某种方式应用特殊格式。我怎样才能做到这一点?

答案1

一个非常基本的版本,quote以引用的人为参数。进一步自定义环境以获得所需的格式。

\documentclass[]{article}

\usepackage{duckuments}
\newenvironment{quoted}[1]
  {%
    \def\quoteFrom{#1}%
    \begin{quote}%
  }
  {%
    \hbox to \textwidth{\hfill -- \quoteFrom}%
    \end{quote}%
  }

\begin{document}
\blindduck[-]
\begin{quoted}{A famous eye ducktor}
  \blindduck[-]
\end{quoted}
\blindduck[-]
\end{document}

在此处输入图片描述

答案2

顺便说一句,你的开场白太乱了。注意你的开场白,否则它最终会对你不利。


来自类似问题的贡萨洛梅迪纳 (Gonzalo Medina) 的回答,我在我的文档中使用了以下内容:

%% compile with Xe- or LuaLaTeX

\documentclass[a4paper]{report}

% ------------------------------------------------------------------------ FONTS
\usepackage{fontspec}
\setmainfont{Libertinus Serif}

% --------------------------------------------------------------------- LANGUAGE
\usepackage{polyglossia}
\setdefaultlanguage{english}

% ----------------------------------------------------------------------- QUOTES
\usepackage{csquotes}
\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip2em
        \hbox{}\nobreak\hfil(#1)% <-- edit this to change the looks of the author to e.g. "...\hfil - #1%" to get a similar output as in Skillmon's example (also, the %-sign needs to be there!)
        \parfillskip=0pt \finalhyphendemerits=0 \endgraf}}

\newsavebox\mybox
\newenvironment{signquote}[1]
{\savebox\mybox{#1}\begin{quote}}
    {\signed{\usebox\mybox}\end{quote}}

% ----------------------------------------------------------------------- LIPSUM
\usepackage{duckuments}

\begin{document}

Someone special said a one-liner:

\begin{signquote}{Someone Special}
    Seifukus are the quide to the future.
\end{signquote}

If there is enough space, the name will not be moved to the next line, which I find appealing.

\begin{signquote}{A famous eye ducktor}
    \blindduck[2]
\end{signquote}

\begin{signquote}{A famous eye ducktor}
    \blindduck[3] 
\end{signquote}

Works with haiku, too. If the name it too long, please find a quote from another author with a shorter name.

\begin{signquote}{A famous limerickorice}
    There was a young fisher named fisher, \\
    who fished for a fish in a fissure. \\
    The fish, with a grin, pulled the fisherman in, \\
    now, they're fishing the fissure for fisher.
\end{signquote}

\begin{signquote}{A man from Japan}
    There was a young man from Japan \\
    Whose limericks never would scan. \\
    When asked why that was, \\
    He replied "It's because \\
    I always try to cram as many words into the last line as I possibly can.
\end{signquote}

\begin{signquote}{You shouldn't quote people with very long names. They tend to say very long things and don't break nicely.}
     There was a young lady of Riga \\
    Who smiled as she rode on a tiger; \\
    They returned from the ride \\
    With the lady inside, \\
    And the smile on the face of the tiger.
\end{signquote}

\end{document}

编译文档的屏幕截图

相关内容