我有一些 LaTeX 笔记的示例,但是格式非常复杂,在激烈的辩论中实际输入这些类型的 LaTeX 笔记会太慢。
有什么 LaTeX 笔记模板可以在现场环境中快速输入,并且看起来很专业,适合现场辩论?特别是,重新输入演讲者姓名太慢了。
附件是这些笔记的视觉示例。
- 应该有带有垂直线的连续编号行。
- 新发言者均缩进且全部大写。
如果有代码可以让你直接编写\speaker{Admiral Smith}
并自动执行格式化,那就太好了
\documentclass{article} \usepackage{geometry,eso-pic,fancyhdr} \geometry{ paper = letterpaper, hmargin = 1.5in, vmargin = 1in } \usepackage[pagewise]{lineno} \linenumbers % Add line numbers to document \setlength{\linenumbersep}{1in}% Move line numbers away from text \renewcommand{\linenumberfont}{\normalsize\ttfamily} % Add rules to outside of text block \AddToShipoutPictureBG{% \AtTextLowerLeft{% % Left rule \makebox[0pt][r]{\rule[-.5\paperheight]{.4pt}{2\paperheight}\hspace{0.8in}}% }% \AtTextLowerLeft{% % Right rule \hspace*{\textwidth}% \makebox[0pt][l]{\hspace{0.4in}\rule[-.5\paperheight]{.4pt}{2\paperheight}}% }% } \fancyhf{}% Clear header/footer \renewcommand{\headrulewidth}{0pt}% Remove header rule % \renewcommand{\footrulewidth}{0pt}% Remove footer rule (default) \fancyfoot[R]{\ttfamily\thepage} \pagestyle{fancy} \AtBeginDocument{% \ttfamily \thispagestyle{fancy} \raggedright \setlength{\parindent}{15pt} \setlength{\parskip}{\smallskipamount} } \newcommand{\speaker}[1]{% \par\MakeUppercase{#1}:~\ignorespaces } \usepackage{lipsum} \begin{document} \speaker{The President} Hello Admiral! How's the steam today? \speaker{Admiral Smith} \ldots Uh, yes sir. We're really loving the steam today. \lipsum[1-2] \speaker{Harry Potter} \lipsum[3-7] \end{document}
参考代码网页:
答案1
新的命令和 Tab 键完成
最简单的方法是为每个发言者创建一个新命令,或者一些标准的法庭名称(例如被告),例如
\newcommand{\defendant}[1]{\indent \textsc{Alice: }{#1}\par}
您可以根据需要缩写这些内容,但在输入第一个或两个字母后,它通常是大多数 IDE 的制表符完成的第一个建议。您很少需要输入整个内容。(\de
在 texstudio 中,只需输入内容然后按制表符/回车键即可,这只需 4 次击键)。
对几个常见字符执行此操作可得到以下结果(我没有简化所有边距和位,因为您只需执行一次,并且不会影响您的速度)一个小例子如下
\documentclass{article}
\usepackage{lineno,lipsum}
\newcommand{\commentary}[1]{\noindent[{#1}]\par}
\newcommand{\court}[1]{\indent \textsc{The Court: }{#1}\par}
\newcommand{\defendant}[1]{\indent \textsc{Alice: }{#1}\par}
\newcommand{\plaintif}[1]{\indent \textsc{Bob: }{#1}\par}
\newcommand{\witness}[1]{\indent \textsc{Witness: }{#1}\par}
\newcommand{\jury}[1]{\indent \textsc{Jury: }{#1}\par}
\begin{document}
\linenumbers
\ttfamily
\commentary{Something is about to happen.}
\court{How do you plead?}
\defendant{I didn't do it.}
\plaintif{Ow yes he did.}
\witness{Ow no he didn't.}
\jury{Innocent}
\commentary{The case is finished.}
\defendant{I'm so happy. Now to give a long speech thanking the jury: \lipsum}
\end{document}
并产生
答案2
现在可能已经太晚了,时间已经过去了,但本着实验精神游戏,因为我需要一些类似的东西,结合已经给出的答案(markdown 方法+短命令+预定义),对于触摸打字场景来说,会给出类似的东西:
平均能量损失
\documentclass{article}
%============================================
%from https://tex.stackexchange.com/questions/557680/fastest-typed-latex-template-for-live-conversations
\usepackage{geometry,eso-pic,fancyhdr}
\geometry{
paper = letterpaper,
hmargin = 1.5in,
vmargin = 1in
}
\usepackage[pagewise]{lineno}
\linenumbers % Add line numbers to document
\setlength{\linenumbersep}{1in}% Move line numbers away from text
\renewcommand{\linenumberfont}{\normalsize\ttfamily}
% Add rules to outside of text block
\AddToShipoutPictureBG{%
\AtTextLowerLeft{%
% Left rule
\makebox[0pt][r]{\rule[-.5\paperheight]{.4pt}{2\paperheight}\hspace{0.8in}}%
}%
\AtTextLowerLeft{%
% Right rule
\hspace*{\textwidth}%
\makebox[0pt][l]{\hspace{0.4in}\rule[-.5\paperheight]{.4pt}{2\paperheight}}%
}%
}
\fancyhf{}% Clear header/footer
\renewcommand{\headrulewidth}{0pt}% Remove header rule
% \renewcommand{\footrulewidth}{0pt}% Remove footer rule (default)
\fancyfoot[R]{\ttfamily\thepage}
\pagestyle{fancy}
\AtBeginDocument{%
\ttfamily
\thispagestyle{fancy}
\raggedright
\setlength{\parindent}{15pt}
\setlength{\parskip}{\smallskipamount}
}
%
%============================================
\usepackage{xparse}%for document command
\usepackage{url}%for url
\usepackage{xcolor}%for blue text
\usepackage{framed}%for framed quotation
%============================================
\newcommand\ccol[1]{\textcolor{blue}{#1}}
%============================================
% DC iterator
%https://tex.stackexchange.com/questions/364494/whats-the-best-way-to-explode-a-string-into-characters-process-each-character
%\def\zz#1{\def\zzsep{}\zzz#1\relax}
%\def\zzz#1{\ifx\relax#1\else\zzsep\def\zzsep{+}\fbox{#1}\expandafter\zzz\fi}
\newcommand\myhyphen{\raisebox{-1.2ex}{-}}
\newcommand\myunderscore{{\_}}
\newcommand\myequalsign{\raisebox{-1.4ex}{=}}
\newcommand\myequalsignb{\raisebox{-1.4ex}{\textcolor{red}{=}}}
\newcommand\myunderlinechar{\myhyphen}
\newcommand\zzaction{\llap{\myunderlinechar}}
\newcommand\zzactionb{\llap{\myequalsign}}
\newcommand\zzactionc{\llap{\myequalsignb}}
\newcommand\myzzaction{}
%
% each call to zz will have to def myzzaction appropriately
\def\zz#1{\def\zzsep{}\zzz#1\relax}
\def\zzz#1{\ifx\relax#1\else\def\zzsep{\myzzaction}#1\zzsep\expandafter\zzz\fi}
%This is used to ``underline'' text, like with a typewriter.
%
\def\zzd#1{\def\zzsep{}\zzzd#1\relax}
\def\zzzd#1{\ifx\relax#1\else\zzsep\def\zzsep{\myzzaction}#1\expandafter\zzzd\fi}
%This is used to ``split'' text, as when spelling.
%============================================
% Create a new speaker command
\newcommand\definenewnamec[2]{%
\global\expandafter\newcommand\csname y#1\endcsname{#2}
}
% Redefine a speaker command
\newcommand\redefinenewnamec[2]{%
\global\expandafter\renewcommand\csname y#1\endcsname{#2}
}
%============================================
%A : role
\newcommand{\speaker}[1]{%
\par\MakeUppercase{#1}:~\ignorespaces
}
%B (A) : role (name)
\newcommand{\speakerb}[2][]{%
\speaker{#2 (#1)}
}
% A B : name role
\newcommand{\speakerc}[2]{%
\speaker{#1\ #2}
}
%item value
\newcommand{\speakerd}[2]{%
\par\makebox[8em][r]{\MakeUppercase{#1:}}\hspace{3em}\MakeUppercase{#2}}
%heading
\newcommand{\speakere}[1]{%
\bigskip\ \hfill{#1}\hfill\ \par\bigskip\bigskip
}
%long way of underline using tt
\newcommand\ud[1]{#1\llap{\raisebox{-1.2ex}{-}}}
%
%+++++++++++++++++++++++++
\newcommand{\commentary}[1]{\noindent[{#1}]\par}
%+++++++++++++++++++++++++
%~ from unisugar package:
%make a command using to end-of-line as its (one) parameter
\newcommand*{\toEolnCommand}[2]{%
\newcommand*{#1}{%
\begingroup
\escapechar=`\\%
\catcode\endlinechar=\active
\csname\string#1\endcsname
}%
\begingroup%
\escapechar=`\\%
\lccode`\~=\endlinechar
\lowercase{%
\expandafter\endgroup
\expandafter\def\csname\string#1\endcsname##1~%
}{\endgroup#2\space}%
}
%\toEolnCommand\toEolnSection{\section{#1}}
\toEolnCommand\toEolnComment{\comm{#1}}
\toEolnCommand\toEolnDescription{\tg{#1}}
\toEolnCommand\toEolnMatter{\tm{#1}}
\toEolnCommand\toEolnCourt{\tct{#1}}
\toEolnCommand\toEolnBench{\tben{#1}}
\toEolnCommand\toEolnDate{\tddate{#1}}
%q
%adapted from unisugar package:
%make q an escape character
\catcode"71=11%catcode for letter (unisugar package assigns a unicode char here)
\edef\q{q}
\catcode"71=0%escape character and control sequence
%===================================
% Continuation
\newcommandqtc{\speaker{the court}}
\newcommandqtd{\speaker{defendant}}
\newcommandqtp{\speaker{plaintiff}}
\newcommandqtde{\speaker{defence}}
\newcommandqtpr{\speaker{prosecution}}
\newcommandqtap{\speaker{appellant}}
\newcommandqtre{\speaker{respondent}}
\newcommandqtw{\speaker{witness}}
\newcommandqttr{\speaker{translator}}
\newcommandqtj{\speaker{jury}}
\newcommandqtdd{\speaker{counsel (def)}}
\newcommandqtpp{\speaker{counsel (pl)}}
\newcommandqcomm[1]{\commentary{#1}}
\newcommandqtm[1]{\speakerd{case}{#1}}
\newcommandqtct[1]{\speakerd{court}{#1}}
\newcommandqtben[1]{\speakerd{bench}{#1}}
\newcommandqtddate[1]{\speakerd{date}{#1}\par\bigskip}
%long way of tt underlining::
%\newcommandqttran{\speakere{\ud{T}\ud{r}\ud{a}\ud{n}\ud{s}\ud{c}\ud{r}\ud{i}\ud{p}\ud{t}}}%
%shorter way: zz{}
\newcommandqttran{\renewcommand\myzzaction{\zzaction}\speakere{\zz{Transcript}}}%
\newcommandqthead[1]{\renewcommand\myzzaction{\zzaction}\speakere{\zz{#1}}}%
\newcommandqtcomm[1]{\toEolnComment{#1}}
\newcommandqtgg[1]{\toEolnDescription{#1}}
\newcommandqtmm[1]{\toEolnMatter{#1}}
\newcommandqtcrt[1]{\toEolnCourt{#1}}
\newcommandqtbench[1]{\toEolnBench{#1}}
\newcommandqtdate[1]{\toEolnDate{#1}}
\newcommandqtname[2]{\definenewnamec{#1}{\speaker{#2}}}% a=B
\newcommandqtnamer[2]{\redefinenewnamec{#1}{\speaker{#2}}}% a=C
\newcommandqtem[1]{\renewcommand\myzzaction{\zzaction}\zz{#1}}%
\newcommandqtemm[1]{\renewcommand\myzzaction{\zzactionb}\zz{#1}}%
\newcommandqtemmm[1]{\renewcommand\myzzaction{\zzactionc}\zz{#1}}%
\newcommandqtspell[1]{\renewcommand\myzzaction{-}\zzd{#1}}%
% Introduction
\newcommandqtcc[1]{\speakerb[#1]{the court}}
\newcommandqtdx[1]{\speakerb[#1]{defendant}}
\newcommandqtpx[1]{\speakerb[#1]{plaintiff}}
\newcommandqtdex[1]{\speakerb[#1]{defence}}
\newcommandqtprx[1]{\speakerb[#1]{prosecution}}
\newcommandqtapx[1]{\speakerb[#1]{appellant}}
\newcommandqtrex[1]{\speakerb[#1]{respondent}}
\newcommandqtww[1]{\speakerb[#1]{witness}}
\newcommandqttt[1]{\speakerb[#1]{translator}}
\newcommandqtddd[1]{\speakerb[#1]{counsel for the defendant}}
\newcommandqtppp[1]{\speakerb[#1]{counsel for the plaintiff}}
\newcommandqtdee[1]{\speakerc{#1}{for the defence}}
\newcommandqtprr[1]{\speakerc{#1}{for the prosecution}}
\newcommandqtapp[1]{\speakerc{#1}{for the appellant}}
\newcommandqtree[1]{\speakerc{#1}{for the respondent}}
% Ancillary command
\newcommand\descmarker{=}
\newcommand\gendesc[1]{\par{\begin{center}\descmarker\MakeUppercase{#1}\descmarker\end{center}}}
\newcommand\gendescb[1]{[\MakeUppercase{#1}]}
\newcommand\gendescc[1]{\par{\begin{center}\MakeUppercase{#1}\end{center}}}
\newcommand\gendescd[1]{\par\MakeUppercase{#1}}
%Description
\newcommandqtbreak{\gendescc{+++++++++++++++++++}}
\newcommandqtend{\bigskip\bigskip\gendescc{--*****--}}
%
\newcommandqtadjourn{\gendescd{court adjourns~}}
\newcommandqtresume{\gendescd{court resumes~}}
\newcommandqtv{\gendesc{voices overlapping}}
\newcommandqti{\gendescb{inaudible}}
\newcommandqtim{\gendescb{mumbles}}
\newcommandqtin{\gendescb{incompehensible}}
\newcommandqtis{\gendescb{softly}}
\newcommandqtlp{\gendescb{long pause}}
\newcommandqtu{\gendescb{?}}%uncertain
\newcommandqtl{\gendescb{speaks in foreign language}}
\newcommandqts{\gendesc{shouting}}%e.g. protesters
\newcommandqtf{\gendesc{confusion in court}}
\newcommandqtg[1]{\gendesc{#1}}%general purpose description
\newcommandqtlol{\gendesc{laughter in court}}
\newcommandqta{\ldots [interrupted]}
\newcommandqtb{\ldots [continues]~}
%spelling
\newcommand\honourstringen{Honour}
\newcommand\honourstringus{Honor}
\newcommand\honourstring{}
%locale
\newcommand\setlocaleen{%
\renewcommand\honourstring{\honourstringen}
}
\newcommand\setlocaleus{%
\renewcommand\honourstring{\honourstringus}
}
%Settings - locale
\setlocaleen
%Common phrases
\newcommandqml{My Lord}
\newcommandqmly{My Lady}
\newcommandqmlu{Your Lordship}
\newcommandqmlyu{Your Ladyship}
\newcommandqalp{as Your Lordship pleases}
\newcommandqalpy{as Your Ladyship pleases}
\newcommandqalc{as the Court pleases}
\newcommandqalh{as Your \honourstring\ pleases}
\newcommandqyh{Your \honourstring}
\newcommandqyw{Your Worship}
\newcommandqpc{May it please the Court}
%==============================================
\begin{document}
\noindent Example:
qtmm party a and party b
qtcrt supreme court of xyz
qtbench name j
qtdate 07 aug 2020
qttran
qcomm{Something is about to happen.}
qtcomm This comment is defined by its line, rather than by braces.
qtcc{judge gavel} How do you plead? qtd I didn't do it. qtp Oh yes he did. qtdd I object! qtc Sustained! qtw Oh no he didn't. qtj Not guilty!
qcomm{The case is finished.} qtd I'm so happy. Now to give a long speech thanking the jury: \ldots qtp qquite qquickly. Quietly qquietly. qtu
qtww{professor knowall} Yes, that's right. qtc You may go now. Next case! qtpp qti qtc Switch on your microphone, Counsel. qtv qtppp{Slicker Greenhorn} I apologise for that, qyh. I'm here to represent the plaintiff in qta qts qtc Order in the Court! qtpp qtb to represent qtc Remove that rapscallion from the rafters! Call the next witness. qtww{el zorro} qtl qttr I am known as The Fox qtu qtpp We know who you are. Now, qtlol qtc Time for a short recess. qtadjourn 11:18 am qtbreak qtresume 11:20 am qtc Now, you realise you are still under oath? qtw Yes qyh. qtend
The foregoing was produced by:
\begin{framed}\begin{qquotation}
qqtmm party a and party b\\
qqtcrt supreme court of xyz\\
qqtbench name j\\
qqtdate 07 aug 2020\\
qqttran\\
qqcomm\{Something is about to happen.\}\\
qqtcomm This comment is defined by its line, rather than by braces.\\
\ \\
qqtcc\{judge gavel\} How do you plead? qqtd I didn't do it. qqtp Oh yes he did. qqtdd I object! qqtc Sustained! qqtw Oh no he didn't. qqtj Not guilty!\\
\ \\
qqcomm\{The case is finished.\} qqtd I'm so happy. Now to give a long speech thanking the jury: \textbackslash ldots qqtp qqqquite qqqquickly. Quietly qqqquietly. qqtu
qqtww\{professor knowall\} Yes, that's right. qqtc You may go now. Next case! qqtpp qqti qqtc Switch on your microphone, Counsel. qqtv qqtppp\{Slicker Greenhorn\} I apologise for that, qqyh. I'm here to represent the plaintiff in qqta qqts qqtc Order in the Court! qqtpp qqtb to represent qqtc Remove that rapscallion from the rafters! Call the next witness. qqtww\{el zorro\} qqtl qqttr I am known as The Fox qqtu qqtpp We know who you are. Now, qqtlol qqtc Time for a short recess. qqtadjourn 11:18 am qqtbreak qqtresume 11:20 am qqtc Now, you realise you are still under oath? qqtw Yes qqyh. qqtend
\end{qquotation}\end{framed}
\newpage
qthead{INTRODUCTION} This template, more-or-less standalone, and inspired by some answers to a qquestion on \TeX\ Stack Exchange,\footnote{{https://tex.stackexchange.com/qquestions/557680/fastest-typed-latex-template-for-live-conversations}} provides some shorthand commands for touch-type transcription of a (fast-moving) conversation in court, with the letter \ccol{qq} being defined as an escape character to take some of the typing load off the \ccol{\textbackslash}\ key (albeit at the other end of the keyboard). To get an ordinary qq, double it like this qqqq. And \ccol{\textbackslash} can still be used as the escape character. This \ccol{qq} method will eventually clash with some command or package somewhere if any are added into the code, but, within its own space, it works well enough. Familiarity with \TeX\ layout is an advantage.
Speaker names can be defined 'on-the-fly', and text formatting is embedded within the commands, so that formatting does not have to be typed separately.
To reduce typing even further, some commands that take a parameter can be typed on their own line without the need for any \{ or \}, with the rest of the line being taken as the parameter.
\ccol{qqtcomm This is a comment}
qtcomm This is a comment
Otherwise, the commands can follow each other inline, as the context allows. The cryptic \ccol{qqtpr qqyh s, if I may take you to section \ldots qqtc Yes, Mr Crown. qqtpr 42 of the Act.} produces: qtpr qyh s, if I may take you to section \ldots qtc Yes, Mr Crown. qtpr 42 of the Act.
\begin{framed}\begin{qquotation}Trial by transcript can seldom be an adeqquate representation of an oral trial before a judge or an oral trial before a judge and jury.
-- McHugh J, in \textit{Rosenberg v Percival} [2001] HCA 18; (2001) 205 CLR 434 at 448.
\end{qquotation}\end{framed}
\begin{framed}\begin{qquotation}
qtname{ross}{ms. ross} qyross Mr. Chief Justice, and may it please the Court: It is a fundamental principle of trademark law that no party can obtain a trademark for a generic term like "wine," "cotton," or "grain."
-- Transcript of oral argument, 04 May 2020, page 3 lines 10-15, in \textit{United States Patent and Trademark Office versus Booking.com}\\
{\small\url{https://www.supremecourt.gov/oral_arguments/argument_transcripts/2019/19-46_bq7d.pdf}}
\end{qquotation}\end{framed}
\newpage
\section{Commands}
\subsection{Speakers}
\begin{tabular}{ll}
Command & Display \\
qqtc & qtc \\
qqtp & qtp \\
qqtpp & qtpp \\
qqtd & qtd \\
qqtdd & qtdd \\
qqtpr & qtpr \\
qqtde & qtde \\
qqtw & qtw \\
qqttr & qttr \\
qqtj & qtj \\
qqtap & qtap \\
qqtre & qtre \\
\end{tabular}
\newpage
\subsection{Speaking}
\begin{tabular}{ll}
qqta & qta \\
qqtb & qtb \\
qqti & qti \\
qqtim & qtim \\
qqtin & qtin \\
qqtis & qtis \\
qqtlp & qtlp \\
qqtl & qtl \\
qqtu & qtu \\
\end{tabular}
\bigskip
\noindent\begin{tabular}{ll}
qqtem\{emphasis\} & qtem{emphasis} \\
qqtemm\{more\textbackslash\ emphasis\} & qtemm{more\ emphasis} \\
qqtemmm\{strongest\textbackslash\ emphasis\} & qtemmm{strongest\ emphasis} \\
qqtspell\{spell\} & qtspell{spell} \\
\end{tabular}
\newpage
\subsection{Phrases}
\begin{tabular}{ll}
qqalc & qalc \\
qqalh & qalh \\
qqalp & qalp \\
qqalpy & qalpy \\
qqml & qml \\
qqmlu & qmlu \\
qqmly & qmly \\
qqmlyu & qmlyu \\
qqpc & qpc \\
qqyh & qyh \\
qqyw & qyw \\
\end{tabular}
\newpage
\subsection{Stages}
\begin{tabular}{ll}
qqtadjourn & qtadjourn \\
qqtresume & qtresume \\
\end{tabular}
\newpage
\subsection{Structure}
\ \par qqtran\\ qttran
qqthead\{HEADING\}\\ qthead{HEADING}
qqtmm casename
qtmm casename
qqtcrt court name
qtcrt court name
qqtbench presiding judge(s)/justice(s)
qtbench presiding judge(s)/justice(s)
qqtdate hearing date
qtdate hearing date
\newpage
\subsection{Events}
\ \par
qqtg\{Generic description\}
qtg{Generic description}
qqtgg a generic description qtgg a generic description
qqtbreak qtbreak
qqtf qtf
qqtlol qtlol
qqts qts
qqtv qtv
qqtend qtend
\newpage
\subsection{\{\} parameter commands}
\begin{tabular}{ll}
Command & Display \\
qqcomm\{Comment\} & qcomm{Comment} \\
\end{tabular}
\bigskip
\noindent These are for use on first introduction. Subseqquently, role or defined name may be used.\bigskip
\noindent\begin{tabular}{ll}
Command & Display \\
qqtcc\{name\} & qtcc{name} \\
\\
qqtpx\{name\} & qtpx{name} \\
qqtppp\{name\} & qtppp{name} \\
qqtdx\{name\} & qtdx{name} \\
qqtddd\{name\} & qtddd{name} \\
\\
qqtprr\{name\} & qtprr{name} \\
qqtprx\{name\} & qtprx{name} \\
qqtdee\{name\} & qtdee{name} \\
qqtdex\{name\} & qtdex{name} \\
\\
qqtww\{name\} & qtww{name} \\
qqttt\{name\} & qttt{name} \\
\\
qqtapp\{name\} & qtapp{name} \\
qqtapx\{name\} & qtapx{name} \\
qqtree\{name\} & qtree{name} \\
qqtrex\{name\} & qtrex{name} \\
\end{tabular}
\bigskip
\subsection{Dynamic names}
For creating names on-the-fly,
qqtname\{a\}\{b\} creates a command qqya which expands to qtname{a}{b}qya
So that qqtname\{who\}\{the doctor\}, qqtname\{whit\}\{leela\}, and qqtname\{dog\}\{k9\} create
qqywho, qqywhit and qqydog which expand to qtname{who}{the doctor} qywho qtname{whit}{leela} qywhit qtname{dog}{k9} \par and qydog
A defined name can be re-defined with qqtnamer{}, so that qqtnamer\{who\}\{clara\} resets qqywho such that it now produces qtnamer{who}{clara}qywho
\newpage
\subsection{Rest-of-line parameter commands}
qqtcomm This text is on a line
qtcomm This text is on a line
qqtgg a generic description
qtgg a generic description
qtend
\end{document}