@texra-ai/cli 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE.txt +6 -0
  2. package/README.md +218 -0
  3. package/dist/bin/texra.js +2407 -0
  4. package/dist/resources/agents/correct.yaml +52 -0
  5. package/dist/resources/agents/merge.yaml +74 -0
  6. package/dist/resources/agents/ocr.yaml +68 -0
  7. package/dist/resources/agents/polish.yaml +73 -0
  8. package/dist/resources/agents/transcribe_audio.yaml +76 -0
  9. package/dist/resources/agents/write/beamercolorthemempi.sty +59 -0
  10. package/dist/resources/agents/write/beamerthemeconfposter.sty +225 -0
  11. package/dist/resources/agents/write/paper2poster.yaml +104 -0
  12. package/dist/resources/agents/write/paper2slide.yaml +127 -0
  13. package/dist/resources/agents/write/template_poster.tex +56 -0
  14. package/dist/resources/agents/write/template_slide.tex +39 -0
  15. package/dist/resources/docs/agent-creation/execution_and_testing.md +79 -0
  16. package/dist/resources/docs/agent-creation/tool_catalog.md +127 -0
  17. package/dist/resources/docs/agent-creation/tooluse_schema.md +90 -0
  18. package/dist/resources/docs/agent-creation/workflow_schema.md +160 -0
  19. package/dist/resources/odyssey/odyssey.yaml +56 -0
  20. package/dist/resources/shared/latex_style_rules.txt +15 -0
  21. package/dist/resources/templates/agentCreatorToolUse.yaml +67 -0
  22. package/dist/resources/templates/agentCreatorWorkflow.yaml +128 -0
  23. package/dist/resources/templates/agentTemplate-toolUse.yaml +24 -0
  24. package/dist/resources/templates/agentTemplate-workflowSingle.yaml +66 -0
  25. package/dist/resources/templates/instructionPolish.yaml +17 -0
  26. package/dist/resources/tool_use_agents/chat.yaml +57 -0
  27. package/dist/resources/tool_use_agents/creator.yaml +141 -0
  28. package/dist/resources/tool_use_agents/latexDiff.yaml +42 -0
  29. package/dist/resources/tool_use_agents/latexFixer.yaml +70 -0
  30. package/dist/resources/tool_use_agents/lean.yaml +46 -0
  31. package/dist/resources/tool_use_agents/numerics.yaml +84 -0
  32. package/dist/resources/tool_use_agents/presenter.yaml +75 -0
  33. package/dist/resources/tool_use_agents/research.yaml +94 -0
  34. package/dist/resources/tool_use_agents/review.yaml +95 -0
  35. package/dist/resources/tool_use_agents/setup.yaml +378 -0
  36. package/dist/resources/tool_use_agents/template_slide.tex +39 -0
  37. package/package.json +75 -0
@@ -0,0 +1,52 @@
1
+ name: correct
2
+ description: Fixes typos, grammar, and LaTeX formatting without changing your writing style or content.
3
+
4
+ settings:
5
+ agentCategory: workflow
6
+ documentTag: documents
7
+ endTag: </documents>
8
+ rounds: 1
9
+
10
+ prompts:
11
+ systemPrompt: |
12
+ You are a meticulous LaTeX proofreader. Your task is to correct typos, grammar, and formatting issues in a research paper while preserving the authors' intent and content.
13
+
14
+ When correcting a professional *.tex \LaTeX document, you must:
15
+ {{ LATEX_STYLE_RULES }}
16
+
17
+ userPrefix: |
18
+ I am going to give you a \LaTeX document of a research paper. You are about to correct the typos and mistakes in the document. So please read the document carefully.
19
+
20
+ Here is the \LaTeX document with input files (which may include appendix, and LaTeX auxiliary files that define the math commands you should use):
21
+
22
+ <documents>
23
+ {{ ALL_CONTEXTS }}
24
+ {{ ALL_INPUTS }}
25
+ </documents>
26
+
27
+ {% if INSTRUCTION %}
28
+ Specific instructions that you must follow closely:
29
+ <instruction>
30
+ {{ INSTRUCTION }}
31
+ </instruction>
32
+ For example, in the instruction, if I ask you to revise section A in all papers, you do not need to revise section B in any paper.
33
+ {% endif %}
34
+
35
+ userRequest: |
36
+ Please carefully read through the entire document, looking for any typos, grammatical errors, formatting inconsistencies, incorrect math, or factual inaccuracies.
37
+
38
+ As you review the document, make the following corrections and improvements:
39
+ - Ensure that all mathematical equations are correct and all statements are factually accurate.
40
+ - Use consistent mathematical symbols and notations throughout the document.
41
+
42
+ Output one updated \LaTeX document for each input file, using the matching input filename as the document name.
43
+
44
+ Use the following format:
45
+
46
+ <documents>
47
+ {% for output in INPUT_FILES %}
48
+ <document name="{{ output }}">
49
+ % UPDATED LATEX DOCUMENT {{ loop.index }} HERE
50
+ </document>
51
+ {% endfor %}
52
+ </documents>
@@ -0,0 +1,74 @@
1
+ name: merge
2
+ description: Merges partial edits back into the full original document.
3
+
4
+ settings:
5
+ agentCategory: workflow
6
+ documentTag: documents
7
+ endTag: </documents>
8
+ rounds: 1
9
+
10
+ prompts:
11
+ systemPrompt: |
12
+ You are an expert LaTeX editor tasked with merging changes from an edited version of a \LaTeX document back into the original document. Your goal is to produce an accurate and complete representation of the edited document, incorporating all changes while maintaining the original structure and formatting.
13
+
14
+ userPrefix: |
15
+ {% if INPUT_FILES[1] %}
16
+ You are tasked with creating full versions of multiple edited \LaTeX documents by combining information from pairs of sources: each original \LaTeX document and its corresponding edited version. This task is necessary for enabling accurate comparison between versions using tools like latexdiff. Your goal is to produce complete, updated versions of each document that incorporate all changes while maintaining the original structure.
17
+
18
+ Here are the original \LaTeX documents:
19
+ {{ ALL_INPUTS }}
20
+
21
+ Here are the edited versions of the \LaTeX documents:
22
+ {{ ALL_EDITEDS }}
23
+ {% else %}
24
+ You are tasked with creating a full version of an edited \LaTeX document by combining information from two sources: an original \LaTeX document and an edited version of that document. This task is necessary for enabling accurate comparison between versions using tools like latexdiff. Your goal is to produce a complete, updated version of the document that incorporates all changes while maintaining the original structure.
25
+
26
+ Here is the original \LaTeX document {{ INPUT_FILE }}:
27
+ <original_latex>
28
+ {{ INPUT_CONTENT }}
29
+ </original_latex>
30
+
31
+ Here is the edited version of the \LaTeX document {{ EDITED_FILE }}:
32
+ <edited_latex>
33
+ {{ EDITED_CONTENT }}
34
+ </edited_latex>
35
+ {% endif %}
36
+
37
+ userRequest: |
38
+ Follow these steps to create and verify the full version{% if INPUT_FILES[1] %}s{% endif %} of the edited document{% if INPUT_FILES[1] %}s{% endif %}:
39
+
40
+ STEP 1 - MERGE:
41
+ 1. Carefully read through both the original and edited versions of {% if INPUT_FILES[1] %}each {% endif %}document.
42
+ 2. For parts indicated as ``unchanged'' or ``previous parts remain unchanged'' in the edited version, copy the corresponding sections from the original document verbatim.
43
+ 3. Where specific edits or additions are shown in the edited version, incorporate these changes exactly as they appear, replacing the corresponding parts in the original document.
44
+ 4. Pay close attention to any structural elements like section headers, equations, figures, or tables. Ensure that these are maintained in their correct positions and formats.
45
+ 5. Maintain all LaTeX formatting, including commands, environments, and any custom macros or definitions present in the original document.
46
+ 6. If there are any ambiguities or unclear instructions in the edited version, default to the original document's content for those sections.
47
+ {% if INPUT_FILES[1] %}
48
+ 7. Process each document pair independently - changes in one document should not affect another.
49
+ {% endif %}
50
+
51
+ STEP 2 - VERIFY before outputting:
52
+ - All changes and additions from the edited version are accurately incorporated.
53
+ - Sections marked as ``unchanged'' in the edited version match the original document verbatim.
54
+ - The structure and formatting of the original document are maintained.
55
+ - No parts of the document are accidentally omitted or duplicated.
56
+ - {% if INPUT_FILES[1] %}Each output is{% else %}The output is{% endif %} a complete \LaTeX document, including the preamble, document class declarations, and all content up to \end{document}.
57
+
58
+ Provide your output as complete \LaTeX document{% if INPUT_FILES[1] %}s{% endif %}. Accuracy is paramount - even small discrepancies can affect diff tools.
59
+
60
+ {% if INPUT_FILES | length %}
61
+ <documents>
62
+ {% for output in INPUT_FILES %}
63
+ <document name="{{ output }}">
64
+ % Merged LaTeX document {{ loop.index }} here
65
+ </document>
66
+ {% endfor %}
67
+ </documents>
68
+ {% else %}
69
+ <documents>
70
+ <document name="_full.tex">
71
+ % Your merged \LaTeX document here
72
+ </document>
73
+ </documents>
74
+ {% endif %}
@@ -0,0 +1,68 @@
1
+ name: ocr
2
+ description: Converts handwritten mathematical content from images into LaTeX.
3
+
4
+ settings:
5
+ agentCategory: workflow
6
+ documentTag: documents
7
+ endTag: </documents>
8
+ defaultOutputFiles:
9
+ - ocr_result.tex
10
+
11
+ prompts:
12
+ systemPrompt: |
13
+ You are a LaTeX expert specializing in OCR (Optical Character Recognition) for mathematical content. Your task is to analyze handwritten mathematical content from one or more images and convert it into LaTeX code that maintains consistency with the existing document's notation and style.
14
+
15
+ When processing handwritten content, you must:
16
+ \begin{itemize}
17
+ \item Carefully analyze the mathematical symbols, expressions, and equations across all attached images. If multiple images are attached, treat them as related pages or panels and produce a single coherent LaTeX output that reflects all of them in order.
18
+ \item Extract both text and mathematical content accurately
19
+ \item Ensure the generated LaTeX matches the notation conventions used in the existing document
20
+ \item Maintain consistent symbol usage (e.g., if \alpha is used for angles in the document, use it consistently)
21
+ \item Preserve any structural elements like equation numbering or alignment
22
+ \item Follow the same mathematical environments (equation, align, gather, etc.) as used in the document
23
+ \item Validate that all symbols are properly defined before use
24
+ \item Handle subscripts, superscripts, fractions, and special symbols appropriately
25
+ \end{itemize}
26
+
27
+ userPrefix: |
28
+ I will provide you with:
29
+ 1. The existing LaTeX document for context
30
+ 2. One or more images containing handwritten mathematical content to be converted
31
+ 3. The specific location where the OCR content should be inserted
32
+
33
+ Here are the input files and document:
34
+
35
+ <documents>
36
+ {{ ALL_CONTEXTS }}
37
+ {{ ALL_INPUTS }}
38
+ </documents>
39
+
40
+ userRequest:
41
+ - |
42
+ <instruction>
43
+ {{ INSTRUCTION }}
44
+ </instruction>
45
+
46
+ Analyze the document to understand its notation conventions and mathematical style, then generate the LaTeX code for the handwritten content. Ensure it integrates seamlessly with the existing document --- match notation, mathematical environments, and symbol usage. Use the same documentclass as the existing document. Include \begin{document} and \end{document} tags so that the standalone file can be compiled.
47
+
48
+ <documents>
49
+ <document name="{{ OUTPUT_FILES[0] }}">
50
+ {LATEX_OCR_CONTENT}
51
+ </document>
52
+ </documents>
53
+ - |
54
+ Critically review the OCR conversion and output a refined version. Find the three most likely OCR errors or misinterpretations and check the following, fixing any issues found:
55
+ \begin{itemize}
56
+ \item Likely OCR errors --- for each: what the handwriting showed vs. what you produced, why it is likely wrong (ambiguous symbol, inconsistent with document notation, unusual expression), and the correct interpretation.
57
+ \item Symbols that differ from the document's conventions (e.g., you used $\alpha$ but the document uses $a$ for the same quantity).
58
+ \item Mathematical environments that do not match the document's style.
59
+ \item Subscripts/superscripts correctly ordered and nested.
60
+ \end{itemize}
61
+
62
+ Output the refined LaTeX content with improved notation consistency and integration:
63
+
64
+ <documents>
65
+ <document name="{{ OUTPUT_FILES[0] }}">
66
+ {REFINED_LATEX_OCR_CONTENT}
67
+ </document>
68
+ </documents>
@@ -0,0 +1,73 @@
1
+ name: polish
2
+ description: Rewrites and restructures text to improve clarity, flow, and readability based on your instructions.
3
+
4
+ settings:
5
+ agentCategory: workflow
6
+ documentTag: documents
7
+ endTag: </documents>
8
+
9
+ prompts:
10
+ systemPrompt: |
11
+ You are a professional scientist. Your task is to use your knowledge to improve a LaTeX research paper focusing solely on addressing the given instructions.
12
+
13
+ When writing a professional *.tex \LaTeX document, you must:
14
+ {{ LATEX_STYLE_RULES }}
15
+ Additional rules for polishing:
16
+ \begin{itemize}
17
+ \item In the final \LaTeX output, never bare-list things like 1.\ 2.\ 3.\ \ldots{} as in markdown --- use proper \LaTeX environments such as enumerate or itemize.
18
+ \item \textbf{IMPORTANT:} You must give the complete output containing all the sections in the order they are given in the input file.
19
+ \end{itemize}
20
+
21
+ userPrefix: |
22
+ I am going to give you the \LaTeX document of a research paper draft. Read the document carefully before proceeding.
23
+
24
+ Here is the \LaTeX document with input files (which may include appendix, and LaTeX auxiliary files that define the math commands you should use):
25
+
26
+ <documents>
27
+ {{ ALL_CONTEXTS }}
28
+ {{ ALL_INPUTS }}
29
+ </documents>
30
+
31
+ Please carefully read through the entire research paper above and ensure you fully understand all the details.
32
+ Your task is to enhance this paper focusing solely on the following specific instruction:
33
+ <instruction>
34
+ {{ INSTRUCTION }}
35
+ </instruction>
36
+ Important: Focus solely on the given instruction. If asked to revise section A, do not modify section B unless absolutely necessary for consistency.
37
+
38
+ userRequest:
39
+ - |
40
+ Output one updated \LaTeX document for each input file, using the matching input filename as the document name. Make targeted corrections and enhancements that laser-focus on addressing the specific instruction provided. Refrain from making any changes that are not directly related to the instruction.
41
+
42
+ Use the following format:
43
+
44
+ <documents>
45
+ {% for output in INPUT_FILES %}
46
+ <document name="{{ output }}">
47
+ % UPDATED LATEX DOCUMENT {{ loop.index }} HERE
48
+ </document>
49
+ {% endfor %}
50
+ </documents>
51
+ - |
52
+ Now critically reflect on the changes made and output a further enhanced version. Be brutally honest --- if I asked you to add equations but you did not add any, criticize yourself for not following the instruction.
53
+
54
+ Check for these failure modes and fix any you find:
55
+ \begin{itemize}
56
+ \item Find the three weakest changes you made --- what was changed, why it is weak (inaccurate, unnecessary, introduces inconsistency, adds fluff, damages flow), and how to fix.
57
+ \item Are there any mathematical reasonings or equations from the original version that are now missing?
58
+ \item Are there any notations or quantities used before being defined?
59
+ \item Did you add generic filler like ``XXX provides crucial insights into the structure and behavior of these systems''? Every added sentence must say something specific and substantive --- use ``show not tell.''
60
+ \item Did you change anything NOT required by the instruction? If so, revert it.
61
+ \end{itemize}
62
+
63
+ Output further enhanced and complete versions of all \LaTeX documents in the format below, incorporating the fixes above. Include all the changes you added in the previous step. Only modify sections explicitly mentioned in the instruction, unless changes in one section directly necessitate adjustments in another for consistency. Did later documents receive less attention than earlier ones? Re-read the last document now.
64
+
65
+ Ensure that the output documents are in the following order: {{ INPUT_FILES | join(', ') }}
66
+
67
+ <documents>
68
+ {% for output in INPUT_FILES %}
69
+ <document name="{{ output }}">
70
+ % REFINED LATEX DOCUMENT {{ loop.index }} HERE
71
+ </document>
72
+ {% endfor %}
73
+ </documents>
@@ -0,0 +1,76 @@
1
+ name: transcribe_audio
2
+ description: Transcribes audio with speaker identification and LaTeX math formatting.
3
+
4
+ settings:
5
+ agentCategory: workflow
6
+ documentTag: documents
7
+ endTag: </documents>
8
+ defaultOutputFiles:
9
+ - transcript.tex
10
+
11
+ prompts:
12
+ systemPrompt: |
13
+ You are an expert audio transcriptionist AI. Your task is to accurately transcribe audio content (one or more attached audio files), identify different speakers with timestamps, summarize the key points, structure the transcript into logical sections, and translate spoken mathematical equations into LaTeX format.
14
+
15
+ When processing audio content, you must:
16
+ \begin{itemize}
17
+ \item Accurately transcribe the spoken words. If multiple audio files are attached, treat them as a continuous session in the order given and merge their transcripts into a single coherent output.
18
+ \item Identify distinct speakers based on voice characteristics and context cues. Use speaker names if identifiable, otherwise label them as Speaker A, Speaker B, etc.
19
+ \item Prepend each utterance with a timestamp in [HH:MM:SS] format and the identified speaker name/label (e.g., [00:01:23] Speaker A: Transcript text...).
20
+ \item Generate a concise summary of the main topics discussed in the audio.
21
+ \item Translate any spoken mathematical equations into standard LaTeX format (e.g., inline math with \( ... \) or display math with \[ ... \]).
22
+ \item Divide the final transcript into logical sections based on topic shifts or conversation flow.
23
+ \item Pay attention to punctuation and grammar for readability.
24
+ \item Handle overlapping speech or unclear audio segments gracefully, indicating uncertainty where necessary (e.g., [unintelligible]).
25
+ \item **Do not use any markdown formatting (like bold or italics) in the final transcript output.**
26
+ \end{itemize}
27
+
28
+ userPrefix: |
29
+ I will provide you with:
30
+ 1. The audio content as one or more attached media files.
31
+ 2. Any relevant context documents (optional).
32
+ 3. Specific instructions or focus areas for the transcription.
33
+
34
+ Here is the context:
35
+
36
+ <documents>
37
+ {{ ALL_CONTEXTS }}
38
+ {{ ALL_INPUTS }}
39
+
40
+ </documents>
41
+
42
+ The audio content is attached.
43
+
44
+ userRequest:
45
+ - |
46
+ <instruction>
47
+ {{ INSTRUCTION }}
48
+ </instruction>
49
+
50
+ Analyze the attached audio content and any provided context, then generate the initial audio transcript with timestamps, speaker identification, sectioning, and LaTeX equations. Do not use markdown. Use the following format:
51
+
52
+ <documents>
53
+ <document name="{{ OUTPUT_FILES[0] }}">
54
+ [HH:MM:SS:MS] SpeakerName: INITIAL_TRANSCRIPT_WITH_SPEAKERS_AND_EQUATIONS
55
+ </document>
56
+ </documents>
57
+ - |
58
+ Critically review the initial transcription and produce a final, refined transcript. Check the following aspects and fix any issues found:
59
+ \begin{itemize}
60
+ \item Transcription accuracy --- noticeable word errors.
61
+ \item Speaker identification correct and consistent --- speakers labeled with names or letters as planned.
62
+ \item Timestamps included for each utterance in [HH:MM:SS] format and accurate.
63
+ \item Output follows required format: `[HH:MM:SS] SpeakerName: Text`.
64
+ \item Spoken mathematical equations correctly identified and translated into LaTeX (inline `\(...\)` or display `\[...\]`).
65
+ \item Transcript well-divided into logical sections with appropriate section breaks.
66
+ \item Punctuation and formatting clear and readable; no unintended markdown formatting (bold, italics).
67
+ \item Uncertain or unintelligible parts handled appropriately (e.g., `[unintelligible]`).
68
+ \end{itemize}
69
+
70
+ Output the final, refined audio transcript with improved accuracy, correct speaker identification with timestamps, LaTeX equations, sectioning, and formatting. Ensure no markdown is used. Use the following format:
71
+
72
+ <documents>
73
+ <document name="{{ OUTPUT_FILES[0] }}">
74
+ [HH:MM:SS:MS] SpeakerName: REFINED_TRANSCRIPT_WITH_SECTIONS_SPEAKERS_AND_EQUATIONS
75
+ </document>
76
+ </documents>
@@ -0,0 +1,59 @@
1
+ % ====================
2
+ % Definitions
3
+ % ====================
4
+
5
+ % \definecolor{lightgray}{RGB}{245, 246, 250}
6
+ % \definecolor{blue}{RGB}{47, 169, 223}
7
+ % \definecolor{darkblue}{RGB}{39, 60, 117}
8
+ % \definecolor{lightblue}{HTML}{94a3ae}
9
+
10
+ % \definecolor{lightgray}{HTML}{e5e9ec}
11
+ \definecolor{lightgray}{HTML}{faf9f8}
12
+ % \definecolor{blue}{HTML}{94a3ae}
13
+ % \definecolor{blue}{HTML}{126656} % green, in fact
14
+ \definecolor{blue}{HTML}{017e74} % green, in fact
15
+ \definecolor{darkblue}{HTML}{28495d}
16
+ \definecolor{lightblue}{RGB}{211, 215, 233}
17
+
18
+
19
+ % ====================
20
+ % Theme
21
+ % ====================
22
+
23
+ % Basic colors
24
+ \setbeamercolor{palette primary}{fg=black,bg=white}
25
+ \setbeamercolor{palette secondary}{fg=black,bg=white}
26
+ \setbeamercolor{palette tertiary}{bg=black,fg=white}
27
+ \setbeamercolor{palette quaternary}{fg=black,bg=white}
28
+ \setbeamercolor{structure}{fg=darkblue}
29
+
30
+ % Headline
31
+ \setbeamercolor{headline}{fg=darkblue,bg=white}
32
+ \setbeamercolor{headline rule}{bg=darkblue}
33
+
34
+ % Footline
35
+ \setbeamercolor{footline}{fg=white,bg=darkblue}
36
+ \setbeamercolor{footline rule}{bg=darkblue}
37
+
38
+ % Block
39
+ \setbeamercolor{block title}{fg=blue,bg=white}
40
+ \setbeamercolor{block separator}{bg=black}
41
+ \setbeamercolor{block body}{fg=black,bg=white}
42
+
43
+ % Alert Block
44
+ \setbeamercolor{block alerted title}{fg=blue,bg=lightgray}
45
+ \setbeamercolor{block alerted separator}{bg=black}
46
+ \setbeamercolor{block alerted body}{fg=black,bg=lightgray}
47
+
48
+ % Heading
49
+ \setbeamercolor{heading}{fg=black}
50
+
51
+ % Itemize
52
+ \setbeamercolor{item}{fg=darkblue}
53
+
54
+ % Bibliography
55
+ \setbeamercolor{bibliography item}{fg=black}
56
+ \setbeamercolor{bibliography entry author}{fg=black}
57
+ \setbeamercolor{bibliography entry title}{fg=black}
58
+ \setbeamercolor{bibliography entry location}{fg=black}
59
+ \setbeamercolor{bibliography entry note}{fg=black}
@@ -0,0 +1,225 @@
1
+ % ====================
2
+ % Dependencies
3
+ % ====================
4
+
5
+ \RequirePackage{exscale}
6
+ \RequirePackage{ragged2e}
7
+ \RequirePackage{changepage}
8
+ %\RequirePackage{fontspec}
9
+ \RequirePackage{marvosym}
10
+ \RequirePackage{tikz}
11
+ \RequirePackage{soul}
12
+
13
+ % ====================
14
+ % Macros
15
+ % ====================
16
+ \newcommand{\setconferencename}[1]
17
+ {
18
+ \newcommand{\conference}{#1}
19
+ }
20
+ \newcommand{\setmail}[1]
21
+ {
22
+ \newcommand{\mail}{\href{mailto:#1}{#1}}
23
+ }
24
+ \newcommand{\setwebsite}[1]
25
+ {
26
+ \newcommand{\website}{\href{#1}{#1}}
27
+ }
28
+ \newcommand{\setlogo}[1]
29
+ {
30
+ \newcommand{\logoimage}{\includegraphics[width=.9\textwidth,height=.6\textwidth,keepaspectratio]{#1}}
31
+ }
32
+ \newcommand{\roundbox}[2][]
33
+ {
34
+ \tikz[overlay]\node[fill=darkgray!15,inner sep=2pt, anchor=text, rectangle, rounded corners=1mm,#1] {#2};\phantom{#2}
35
+ }
36
+
37
+ \makeatletter
38
+ \newcommand{\highlight}[1]
39
+ {%
40
+ \let\set@color\beamerorig@set@color%
41
+ \let\reset@color\beamerorig@reset@color%
42
+ \sethlcolor{darkblue}%
43
+ {%
44
+ ~\color{white}%
45
+ \hl{#1}%
46
+ ~%
47
+ }%
48
+ }
49
+ \makeatother
50
+
51
+ % ====================
52
+ % Fonts
53
+ % ====================
54
+
55
+ \usefonttheme{professionalfonts}
56
+
57
+ \setbeamerfont{headline title}{size=\huge,series=\bfseries}
58
+ \setbeamerfont{headline author}{size=\large}
59
+ \setbeamerfont{headline institute}{size=\normalsize}
60
+ \setbeamerfont{block title}{size=\large,series=\bfseries}
61
+ \setbeamerfont{heading}{series=\bfseries}
62
+ \setbeamerfont{caption}{size=\small}
63
+
64
+
65
+ % ====================
66
+ % Macros
67
+ % ====================
68
+
69
+ \newcommand{\samelineand}{\qquad}
70
+
71
+ % ====================
72
+ % Elements
73
+ % ====================
74
+
75
+ % List
76
+ \makeatletter
77
+ \def\@listi{\leftmargin\leftmarginii
78
+ \topsep 1ex % spacing before
79
+ \parsep 0\p@ \@plus\p@
80
+ \itemsep 0.5ex} % spacing between
81
+ \makeatother
82
+
83
+ % Itemize
84
+
85
+ \setbeamertemplate{itemize item}{\raise0.5ex \hbox{\vrule width 0.5ex height 0.5ex}}
86
+ \setbeamertemplate{itemize subitem}{\raise0.3ex \hbox{\vrule width 0.5ex height 0.5ex}}
87
+ \setbeamertemplate{itemize subsubitem}{\raise0.2ex \hbox{\vrule width 0.5ex height 0.5ex}}
88
+
89
+ % Enumerate
90
+
91
+ \setbeamertemplate{enumerate item}{\insertenumlabel.}
92
+ \setbeamertemplate{enumerate subitem}{\insertsubenumlabel.}
93
+ \setbeamertemplate{enumerate subsubitem}{\insertsubsubenumlabel.}
94
+
95
+ % Equation
96
+ \setlength\belowdisplayshortskip{2ex}
97
+
98
+ % Caption
99
+ \setbeamertemplate{caption}[numbered]
100
+ \setbeamertemplate{caption label separator}[period]
101
+ \setlength{\abovecaptionskip}{2ex}
102
+ \setlength{\belowcaptionskip}{1ex}
103
+
104
+ % Bibliography
105
+ \setbeamertemplate{bibliography item}[text]
106
+
107
+ % Navigation
108
+ \beamertemplatenavigationsymbolsempty
109
+
110
+ % ====================
111
+ % Components
112
+ % ====================
113
+
114
+ % Heading
115
+ \newcommand\heading[1]
116
+ {%
117
+ \par\bigskip
118
+ {\usebeamerfont{heading}\usebeamercolor[fg]{heading}{#1}}\par\smallskip
119
+ }
120
+
121
+ % Headline
122
+ \setbeamertemplate{headline}
123
+ {
124
+ \begin{beamercolorbox}{headline}
125
+ \vspace{8ex}\\
126
+ \begin{columns}[c]
127
+ {
128
+ \ifdefined\logoimage
129
+ \begin{column}{.04\paperwidth}
130
+ \end{column}
131
+ \begin{column}{.725\paperwidth}
132
+ \centering
133
+ {\usebeamerfont{headline title}\usebeamercolor[fg]{headline title}\inserttitle\\[1ex]}
134
+ {\usebeamerfont{headline author}\usebeamercolor[fg]{headline author}\insertauthor\\[1ex]}
135
+ {\usebeamerfont{headline institute}\usebeamercolor[fg]{headline institute}\insertinstitute\\[1ex]}
136
+ \end{column}
137
+ \begin{column}{.25\paperwidth}
138
+ \begin{center}
139
+ \logoimage
140
+ \end{center}
141
+ \end{column}
142
+ \begin{column}{.03\paperwidth}
143
+ \end{column}
144
+ \else
145
+ \begin{column}{.05\paperwidth}
146
+ \end{column}
147
+ \begin{column}{.9\paperwidth}
148
+ \centering
149
+ {\usebeamerfont{headline title}\usebeamercolor[fg]{headline title}\inserttitle\\[1ex]}
150
+ {\usebeamerfont{headline author}\usebeamercolor[fg]{headline author}\insertauthor\\[1ex]}
151
+ {\usebeamerfont{headline institute}\usebeamercolor[fg]{headline institute}\insertinstitute\\[1ex]}
152
+ \end{column}
153
+ \begin{column}{.05\paperwidth}
154
+ \end{column}
155
+ \fi
156
+ }
157
+ \end{columns}
158
+ \vspace{1ex}
159
+ \ifbeamercolorempty[bg]{headline rule}{}
160
+ {
161
+ \begin{beamercolorbox}[wd=\paperwidth,colsep=0.5ex]{headline rule}\end{beamercolorbox}
162
+ }
163
+ \end{beamercolorbox}
164
+ }
165
+
166
+
167
+ % Block
168
+ \setbeamertemplate{block begin}
169
+ {
170
+ \begin{beamercolorbox}[colsep*=0ex,dp=2ex,center]{block title}
171
+ \vskip0pt
172
+ \usebeamerfont{block title}\insertblocktitle
173
+ % \vskip-1.25ex
174
+ \vskip-1.5ex
175
+ \begin{beamercolorbox}[colsep=0.025ex]{block separator}\end{beamercolorbox}
176
+ \end{beamercolorbox}
177
+ {\parskip0pt\par}
178
+ \usebeamerfont{block body}
179
+ \vskip-0.5ex
180
+ \begin{beamercolorbox}[colsep*=0ex]{block body}
181
+ \justifying
182
+ \setlength{\parskip}{1ex}
183
+ \vskip-2ex
184
+ }
185
+ \setbeamertemplate{block end}
186
+ {
187
+ \end{beamercolorbox}
188
+ \vskip0pt
189
+ \vspace*{2ex}
190
+ }
191
+
192
+ % Alert Block
193
+ \setbeamertemplate{block alerted begin}
194
+ {
195
+ \begin{beamercolorbox}[colsep*=0ex,dp=2ex,center]{block alerted title}
196
+ \vskip0.5ex
197
+ \usebeamerfont{block title}\insertblocktitle
198
+ \vskip-1.25ex
199
+ \begin{beamercolorbox}[colsep=0.025ex]{block alerted separator}
200
+ \end{beamercolorbox}
201
+ \end{beamercolorbox}
202
+ {\parskip0pt\par}
203
+ \usebeamerfont{block body}
204
+ \vskip-0.5ex
205
+ \begin{beamercolorbox}[colsep*=0ex]{block alerted body}
206
+ \justifying
207
+ \begin{adjustwidth}{1ex}{1ex}
208
+ \setlength{\parskip}{1ex}
209
+ \vskip-2ex
210
+ }
211
+ \setbeamertemplate{block alerted end}
212
+ {
213
+ \end{adjustwidth}
214
+ \vskip1ex
215
+ \end{beamercolorbox}
216
+ \vskip0pt
217
+ \vspace*{2ex}
218
+ }
219
+
220
+ % Footline
221
+ \newcommand{\footline}[3]
222
+ {%
223
+ \makebox[0.98\linewidth][c]{\rlap{#1}\hfill{#2}\hfill\llap{#3}}%
224
+ }
225
+