forked from HPQC-LABS/HPQC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LaTeX.html
316 lines (242 loc) · 13.5 KB
/
LaTeX.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HPQC Labs: High Performance & Quantum Computing</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet" />
<link href="latex.css" rel="stylesheet" type="text/css" media="all" />
<link href="default.css" rel="stylesheet" type="text/css" media="all" />
<!--<link href="lectures.html" rel="stylesheet" type="text/css" media="all" />-->
<link href="fonts.css" rel="stylesheet" type="text/css" media="all" />
<link href="Plugins/AOS/aos.css" rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link rel="shortcut icon" href="images/favicon.ico" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!--[if IE 6]><link href="default_ie6.css" rel="stylesheet" type="text/css" /><![endif]-->
</head>
<body>
<!--See comments about Nav bar in index.html-->
<div id="menu">
<div class="navbar-toggle" id="navbar-toggle">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<a href="index.html" class="logo">
<img src="images/HPQC_Labs.svg" class="logoImg">
<span class="logoTxt">HPQC Labs</span>
</a>
<ul class="main-nav" id="main-nav">
<li><a href="index.html" accesskey="1" title="">Homepage</a></li>
<li><a href="people.html" accesskey="2" title="">People</a></li>
<li><a href="https://github.com/HPQC-LABS" accesskey="3" title="">Research</a></li>
<li><a href="by-laws.html" accesskey="4" title="">By-laws</a></li>
<li class="dropmenu">
<div class="current_page_item"><a class="dropbtn" accesskey="6" id="selection" title="">Resources</a></div>
<div class = "content">
<a href="lectures.html" title="">Lectures</a>
<a href="LaTeX.html">LaTeX Setup</a>
</div>
</li>
<li><a href="college.html" accesskey="5" title="">HPQC College</a></li>
</ul>
</div>
<div id="banner"> </div>
<!--Div used as a button to scroll to the top of the page-->
<div class="toTop" id="buttonID" data-aos="fade-right" data-aos-anchor="#trigger" data-aos-anchor-placement="top-top">
<!--Actual arrow in the main div, aligned using the center div-->
<div class="center"><div class="arrow"></div></div>
</div>
<!--Instruction on setting up/using LaTeX to successfully complete work-->
<div class="latexContainer" id="trigger">
<h1>LaTeX Setup</h1>
<p>1. Install TeX Live and go through the installation process, making sure that the <b>install TeXworks front end box</b> is checked when you get to the page where you choose the installation root.</p>
<br>
<p>2. Next, install Git Bash so that you can download the repository easily onto your computer. After this, launch the program and run the following lines to set up your account's default identity:
<ul>
<li>git config --global user.email “[email protected]”</li>
<li>git config --global user.name “Your Name”</li>
</ul>
<p>After this you’ll want to set up the directory which you will clone the Book about
Quadratization to using:
</p>
<ul>
<li>cd “Folder Name” </li>
</ul>
<p>For example, in order to set your directory to a folder named “test” on your desktop you would type the following:</p>
<ul>
<li>cd Desktop</li>
<li>cd test</li>
</ul>
<p>Once this is done all you need to do is clone the repository using the following line:</p>
<ul>
<li>git clone https://github.com/HPQC-LABS/Book_About_Quadratization.git</li>
</ul>
<p><br>3. With the repository now downloaded to your computer, open TeXworks and open up the Book_about_Quadratization.tex file from the repository, and build it by pressing the green play button in the top left. </p>
<p>Now that this has been done, you should notice that the pdf is working besides the missing bibliography and references. To fix this, open up the BookAboutQuadratizationNotes file (you’ll only see it listed by changing the file type to all files when opening) and build it. Once the console outputs some text press the stop sign in the top left and close out of the file. Go back to the main .tex file and by building the file once more you should see that everything is now working and ready for you to make your edits.</p>
</div>
<!--Instruction on using Git Bash to successfully complete work-->
<div class="latexContainer" data-aos="fade-up">
<h1>Uploading with GitBash</h1>
<p>
1. Once you have made changes to a file and you wish to commit the change, begin by opening Git Bash and navigating to the directory in which you cloned the Book_about_Quadratization repository.
<br> <br>
For example, if I cloned the repository to a folder called “Test” on my desktop I would enter the following (using tab will autofill to make things easy):
</p>
<ul>
<li>cd Desktop</li>
<li>cd Test</li>
<li>cd Book_about_Quadratization</li>
</ul>
<p>2. Next you’ll want to add the files you’ve updated (In most cases this will just be the book .tex and .pdf files). You can do this by entering the following lines:</p>
<ul>
<li>git add “File Name.fileType”</li>
</ul>
<p>Then to make a commit enter the following line:</p>
<ul>
<li>git commit -am “Message you want to have with the commit”</li>
</ul>
<p>Finally, to push your commit, enter the following and everything should be updated:</p>
<ul>
<li>git push</li>
</ul>
<h3>Updating Local Repositories</h3>
<p>
In some cases, the main page will be updated prior to your commit. With files that have been altered locally, you want to avoid pushing your commit as you may overwrite someones work, and you want to avoid merging the main file with your local repository, so you don't overwrite the work you have done.
<br>
To get around this, you will want to use the stash feature in git bash.
1. First you will want to use the following code to save your local changes to the stash and revert whatever files were modified to their original state.
</p>
<ul>
<li>git stash</li>
</ul>
<p>
2. Next you will use the pull function to get your local repository back up to date with the main repository.
</p>
<ul>
<li>git pull origin gh-pages</li>
</ul>
<p>
3. Finally to merge the additions you have made back into the newly update repository, use the following command:
</p>
<ul>
<li>git stash pop</li>
</ul>
<p>
<b>Additional Note</b>
<br>
<br>
In some cases conflicts may appear when you are attempting to use <b>git stash pop</b> with the recently merged content.
When this happens, you will need to manually go through and resolve these within your given application.
<br>
<br>
In the case of Visual Studio Code, the file that contains conflicts will be indicated, and the exact place in the code, highlighted.
It will then offer the user the choice to accept the current changes (that were there prior to the pull), accept the new changes (after the pull), or accept both.
Additionally there is a button to compare the code in each to see exactly what is being altered.
After the conflicts have been dealt with, it should be safe to proceed with the steps above in order to commit your work.
</p>
</div>
<!--Instruction on setting up/using Sphinx to successfully complete work-->
<div class="latexContainer" data-aos="fade-up">
<h1>Running Sphinx</h1>
<p>
1. Follow the instructions <a href="https://www.sphinx-doc.org/en/master/usage/installation.html" target="_blank">here</a> to install Sphinx. Use the directions that match the operating system you use.
</p>
<br>
<p>2. In the command line, change your current directory to your project’s directory using the ‘cd’ command.</p>
<ul>
<li>cd Desktop</li>
<li>cd yourProject</li>
</ul>
<br>
<p>3. Run ‘sphinx-quickstart’ in your project’s directory and fill in the project’s information. For ‘Project name’ and ‘Author name(s)’, fill in the appropriate information you want to put. Otherwise, use the default settings (which are in the [] of each setting that has a default) by clicking Enter.</p>
<ul>
<li>Separate source and build directories (y/n) [n]:</li>
<li>Project name: (insert your project name)</li>
<li>Author name(s): (insert your name/author’s name)</li>
<li>Project release[]:</li>
<li>Project language[en]:</li>
</ul>
<br>
<p>4. Open the conf.py file that was created in the previous step. It should be located in your project’s directory. Uncomment the lines (which should be lines 13-15):</p>
<ul>
<li>import os</li>
<li>import sys</li>
<li>sys.path.insert(0, os.path.abspath('.'))</li>
</ul>
<br>
<p>5. Change the line “sys.path.insert(0, os.path.abspath('.'))” so that the pathway leads to where your project’s modules are located. Remember that the pathway is relative to your current project directory.</p>
<p>For example, if your modules are in a folder called, “yourModules”, which is located in your project directory, “yourProject”, then change the line to be:</p>
<ul>
<li>sys.path.insert(0, os.path.abspath('./yourModules'))</li>
</ul>
<br>
<p>6. In line 30 of conf.py, add ‘sphinx.ext.autodoc’ (include the ‘’) to “extensions”.</p>
<ul>
<li>extensions = [‘sphinx.ext.autodoc’</li>
<li>]</li>
</ul>
<br>
<p>7. In the command line (the current directory as the project’s directory), run the ‘sphinx-apidoc’ command using the format:</p>
<ul>
<li>sphinx-apidoc -o OUTPUT_PATH MODULE_PATH </li>
</ul>
<p>For example, if the output directory is called “yourSource” and the module directory is called, “yourModules”, run:</p>
<ul>
<li>sphinx-apidoc -o yourSource yourModules</li>
</ul>
<p>The output directory will be where your .rst files will appear, and these .rst files will contain the autodoc directives that will generate your documentation.</p>
<br>
<p>8. Run ‘make html’. The HTML files can be found in the folder ‘_build’. If you get “WARNING: document isn't included in any toctree”, you can fix this by going into index.rst (located in your project directory) and adding modules.rst:</p>
<ul>
<li> .. toctree::</li>
<li> :maxdepth: 2</li>
<li> :caption: Contents:</li>
<li> </li>
<li> yourSource/modules</li>
</ul>
<br>
<p>Optional: Update your theme by going into the conf.py file and changing the variable “html_theme”. The default theme will be “alabaster”.</p>
</div>
<!--Instruction on setting up/using Doxygen to successfully complete work-->
<div class="latexContainer" data-aos="fade-up">
<h1>Running doxygen</h1>
<p>
1. Install doxygen. On Linux you can run <code>sudo apt-get install doxygen</code>, Windows and MacOS users can <b>download the binaries></b> from <a href="https://www.doxygen.nl/download.html" target="_blank">here</a>.
<ul>
<li>If downloading the binary distribution, under the “Select Components” option, make sure that doxywizard GUI box is checked.</li>
</ul>
</p>
<br>
<p>2. On Linux just run the command <code>doxygen -g</code> (in the folder where the code is) to create a configuration file called Doxyfile, then run <code>doxygen Doxyfile</code> to generate the documentation. Open doxywizard. At the top of the doxywizard page, under “Specify the working directory from which doxygen will run”, select the pathway to the project you want to document.</p>
<br>
<p>3. Under the “Wizard” tab, set the Project name, the source code directory, and the destination directory. The source code directory is where your modules will be located, and the destination directory is where the generated documentation will be created.</p>
<br>
<p>4. Under “Topics” in the “Wizard” tab, select Mode. Under “Select the desired extraction mode”, select “All Entities”. Under “Select programming language to optimize the results for”, pick the coding language that fits the code you are documenting.</p>
<br>
<p>Optional: If your documentation includes any LaTeX equations, under the “Expert” tab and in the Topic “HTML”, check the “USE_MATHJAX” box.</p>
<br>
<p>6. Under the “Run” tab, click “Run doxygen”. Then, click “Show HTML output” to view the generated documentation.</p>
</div>
<!-- <span style="display:block; margin-top:-37px;"> <h2><p style="color:white">a<br>a<br>a</p></h2></span> -->
<div id="copyright" class="container", style = "background:#79C255";>
<p>© HPQC Labs. All rights reserved. </p>
</div>
<!--Initializing js files used-->
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript" src="LaTeX.js"></script>
<!--Initializes AOS script which is used to animate divs apppearing when scrolling down-->
<script src="Plugins/AOS/aos.js"></script>
<script>
AOS.init();
</script>
</body>
</html>