mirror of
https://codeberg.org/Gary_vov/pixeldrain-bypass-downloader
synced 2025-12-19 10:13:32 +00:00
Initial commit
This commit is contained in:
354
.gitignore
vendored
Normal file
354
.gitignore
vendored
Normal file
@@ -0,0 +1,354 @@
|
||||
# ---> C
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
|
||||
# Linker output
|
||||
*.ilk
|
||||
*.map
|
||||
*.exp
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
*.idb
|
||||
*.pdb
|
||||
|
||||
# Kernel Module Compile Results
|
||||
*.mod*
|
||||
*.cmd
|
||||
.tmp_versions/
|
||||
modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
*~
|
||||
mall.aux
|
||||
mall.log
|
||||
mall.out
|
||||
mall.pdf
|
||||
mall.fdb_latexmk
|
||||
mall.fls
|
||||
mall.listing
|
||||
texput.log
|
||||
minted.sty
|
||||
_minted-mall
|
||||
Smithdiagram.pdf
|
||||
Smithdiagram.pdf_tex
|
||||
svg-inkscape
|
||||
|
||||
## Core latex/pdflatex auxiliary files:
|
||||
*.aux
|
||||
*.lof
|
||||
*.log
|
||||
*.lot
|
||||
*.fls
|
||||
*.out
|
||||
*.toc
|
||||
*.fmt
|
||||
*.fot
|
||||
*.cb
|
||||
*.cb2
|
||||
.*.lb
|
||||
|
||||
## Intermediate documents:
|
||||
*.dvi
|
||||
*.xdv
|
||||
*-converted-to.*
|
||||
# these rules might exclude image files for figures etc.
|
||||
# *.ps
|
||||
# *.eps
|
||||
# *.pdf
|
||||
|
||||
## Generated if empty string is given at "Please type another file name for output:"
|
||||
.pdf
|
||||
|
||||
## Bibliography auxiliary files (bibtex/biblatex/biber):
|
||||
*.bbl
|
||||
*.bcf
|
||||
*.blg
|
||||
*-blx.aux
|
||||
*-blx.bib
|
||||
*.run.xml
|
||||
|
||||
## Build tool auxiliary files:
|
||||
*.fdb_latexmk
|
||||
*.synctex
|
||||
*.synctex(busy)
|
||||
*.synctex.gz
|
||||
*.synctex.gz(busy)
|
||||
*.pdfsync
|
||||
|
||||
## Build tool directories for auxiliary files
|
||||
# latexrun
|
||||
latex.out/
|
||||
|
||||
## Auxiliary and intermediate files from other packages:
|
||||
# algorithms
|
||||
*.alg
|
||||
*.loa
|
||||
|
||||
# achemso
|
||||
acs-*.bib
|
||||
|
||||
# amsthm
|
||||
*.thm
|
||||
|
||||
# beamer
|
||||
*.nav
|
||||
*.pre
|
||||
*.snm
|
||||
*.vrb
|
||||
|
||||
# changes
|
||||
*.soc
|
||||
|
||||
# comment
|
||||
*.cut
|
||||
|
||||
# cprotect
|
||||
*.cpt
|
||||
|
||||
# elsarticle (documentclass of Elsevier journals)
|
||||
*.spl
|
||||
|
||||
# endnotes
|
||||
*.ent
|
||||
|
||||
# fixme
|
||||
*.lox
|
||||
|
||||
# feynmf/feynmp
|
||||
*.mf
|
||||
*.mp
|
||||
*.t[1-9]
|
||||
*.t[1-9][0-9]
|
||||
*.tfm
|
||||
|
||||
#(r)(e)ledmac/(r)(e)ledpar
|
||||
*.end
|
||||
*.?end
|
||||
*.[1-9]
|
||||
*.[1-9][0-9]
|
||||
*.[1-9][0-9][0-9]
|
||||
*.[1-9]R
|
||||
*.[1-9][0-9]R
|
||||
*.[1-9][0-9][0-9]R
|
||||
*.eledsec[1-9]
|
||||
*.eledsec[1-9]R
|
||||
*.eledsec[1-9][0-9]
|
||||
*.eledsec[1-9][0-9]R
|
||||
*.eledsec[1-9][0-9][0-9]
|
||||
*.eledsec[1-9][0-9][0-9]R
|
||||
|
||||
# glossaries
|
||||
*.acn
|
||||
*.acr
|
||||
*.glg
|
||||
*.glo
|
||||
*.gls
|
||||
*.glsdefs
|
||||
*.lzo
|
||||
*.lzs
|
||||
|
||||
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
|
||||
# *.ist
|
||||
|
||||
# gnuplottex
|
||||
*-gnuplottex-*
|
||||
|
||||
# gregoriotex
|
||||
*.gaux
|
||||
*.gtex
|
||||
|
||||
# htlatex
|
||||
*.4ct
|
||||
*.4tc
|
||||
*.idv
|
||||
*.lg
|
||||
*.trc
|
||||
*.xref
|
||||
|
||||
# hyperref
|
||||
*.brf
|
||||
|
||||
# knitr
|
||||
*-concordance.tex
|
||||
# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files
|
||||
# *.tikz
|
||||
*-tikzDictionary
|
||||
|
||||
# listings
|
||||
*.lol
|
||||
|
||||
# luatexja-ruby
|
||||
*.ltjruby
|
||||
|
||||
# makeidx
|
||||
*.idx
|
||||
*.ilg
|
||||
*.ind
|
||||
|
||||
# minitoc
|
||||
*.maf
|
||||
*.mlf
|
||||
*.mlt
|
||||
*.mtc[0-9]*
|
||||
*.slf[0-9]*
|
||||
*.slt[0-9]*
|
||||
*.stc[0-9]*
|
||||
|
||||
# minted
|
||||
_minted*
|
||||
*.pyg
|
||||
|
||||
# morewrites
|
||||
*.mw
|
||||
|
||||
# nomencl
|
||||
*.nlg
|
||||
*.nlo
|
||||
*.nls
|
||||
|
||||
# pax
|
||||
*.pax
|
||||
|
||||
# pdfpcnotes
|
||||
*.pdfpc
|
||||
|
||||
# sagetex
|
||||
*.sagetex.sage
|
||||
*.sagetex.py
|
||||
*.sagetex.scmd
|
||||
|
||||
# scrwfile
|
||||
*.wrt
|
||||
|
||||
# sympy
|
||||
*.sout
|
||||
*.sympy
|
||||
sympy-plots-for-*.tex/
|
||||
|
||||
# pdfcomment
|
||||
*.upa
|
||||
*.upb
|
||||
|
||||
# pythontex
|
||||
*.pytxcode
|
||||
pythontex-files-*/
|
||||
|
||||
# tcolorbox
|
||||
*.listing
|
||||
|
||||
# thmtools
|
||||
*.loe
|
||||
|
||||
# TikZ & PGF
|
||||
*.dpth
|
||||
*.md5
|
||||
*.auxlock
|
||||
|
||||
# todonotes
|
||||
*.tdo
|
||||
|
||||
# vhistory
|
||||
*.hst
|
||||
*.ver
|
||||
|
||||
# easy-todo
|
||||
*.lod
|
||||
|
||||
# xcolor
|
||||
*.xcp
|
||||
|
||||
# xmpincl
|
||||
*.xmpi
|
||||
|
||||
# xindy
|
||||
*.xdy
|
||||
|
||||
# xypic precompiled matrices and outlines
|
||||
*.xyc
|
||||
*.xyd
|
||||
|
||||
# endfloat
|
||||
*.ttt
|
||||
*.fff
|
||||
|
||||
# Latexian
|
||||
TSWLatexianTemp*
|
||||
|
||||
## Editors:
|
||||
# WinEdt
|
||||
*.bak
|
||||
*.sav
|
||||
|
||||
# Texpad
|
||||
.texpadtmp
|
||||
|
||||
# LyX
|
||||
*.lyx~
|
||||
|
||||
# Kile
|
||||
*.backup
|
||||
|
||||
# gummi
|
||||
.*.swp
|
||||
|
||||
# KBibTeX
|
||||
*~[0-9]*
|
||||
|
||||
# TeXnicCenter
|
||||
*.tps
|
||||
|
||||
# auto folder when using emacs and auctex
|
||||
./auto/*
|
||||
*.el
|
||||
|
||||
# expex forward references with \gathertags
|
||||
*-tags.tex
|
||||
|
||||
# standalone packages
|
||||
*.sta
|
||||
|
||||
# Makeindex log files
|
||||
*.lpz
|
||||
|
||||
# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib
|
||||
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
|
||||
# Uncomment the next line to have this generated file ignored.
|
||||
#*Notes.bib
|
||||
|
||||
# emacs saker
|
||||
*~
|
||||
*#
|
||||
319
LICENSE
Normal file
319
LICENSE
Normal file
@@ -0,0 +1,319 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share
|
||||
and change it. By contrast, the GNU General Public License is intended to
|
||||
guarantee your freedom to share and change free software--to make sure the
|
||||
software is free for all its users. This General Public License applies to
|
||||
most of the Free Software Foundation's software and to any other program whose
|
||||
authors commit to using it. (Some other Free Software Foundation software
|
||||
is covered by the GNU Lesser General Public License instead.) You can apply
|
||||
it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our
|
||||
General Public Licenses are designed to make sure that you have the freedom
|
||||
to distribute copies of free software (and charge for this service if you
|
||||
wish), that you receive source code or can get it if you want it, that you
|
||||
can change the software or use pieces of it in new free programs; and that
|
||||
you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to
|
||||
deny you these rights or to ask you to surrender the rights. These restrictions
|
||||
translate to certain responsibilities for you if you distribute copies of
|
||||
the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or
|
||||
for a fee, you must give the recipients all the rights that you have. You
|
||||
must make sure that they, too, receive or can get the source code. And you
|
||||
must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2)
|
||||
offer you this license which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that
|
||||
everyone understands that there is no warranty for this free software. If
|
||||
the software is modified by someone else and passed on, we want its recipients
|
||||
to know that what they have is not the original, so that any problems introduced
|
||||
by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We
|
||||
wish to avoid the danger that redistributors of a free program will individually
|
||||
obtain patent licenses, in effect making the program proprietary. To prevent
|
||||
this, we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice
|
||||
placed by the copyright holder saying it may be distributed under the terms
|
||||
of this General Public License. The "Program", below, refers to any such program
|
||||
or work, and a "work based on the Program" means either the Program or any
|
||||
derivative work under copyright law: that is to say, a work containing the
|
||||
Program or a portion of it, either verbatim or with modifications and/or translated
|
||||
into another language. (Hereinafter, translation is included without limitation
|
||||
in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered
|
||||
by this License; they are outside its scope. The act of running the Program
|
||||
is not restricted, and the output from the Program is covered only if its
|
||||
contents constitute a work based on the Program (independent of having been
|
||||
made by running the Program). Whether that is true depends on what the Program
|
||||
does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code
|
||||
as you receive it, in any medium, provided that you conspicuously and appropriately
|
||||
publish on each copy an appropriate copyright notice and disclaimer of warranty;
|
||||
keep intact all the notices that refer to this License and to the absence
|
||||
of any warranty; and give any other recipients of the Program a copy of this
|
||||
License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you
|
||||
may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it,
|
||||
thus forming a work based on the Program, and copy and distribute such modifications
|
||||
or work under the terms of Section 1 above, provided that you also meet all
|
||||
of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that
|
||||
you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or
|
||||
in part contains or is derived from the Program or any part thereof, to be
|
||||
licensed as a whole at no charge to all third parties under the terms of this
|
||||
License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run,
|
||||
you must cause it, when started running for such interactive use in the most
|
||||
ordinary way, to print or display an announcement including an appropriate
|
||||
copyright notice and a notice that there is no warranty (or else, saying that
|
||||
you provide a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this License.
|
||||
(Exception: if the Program itself is interactive but does not normally print
|
||||
such an announcement, your work based on the Program is not required to print
|
||||
an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable
|
||||
sections of that work are not derived from the Program, and can be reasonably
|
||||
considered independent and separate works in themselves, then this License,
|
||||
and its terms, do not apply to those sections when you distribute them as
|
||||
separate works. But when you distribute the same sections as part of a whole
|
||||
which is a work based on the Program, the distribution of the whole must be
|
||||
on the terms of this License, whose permissions for other licensees extend
|
||||
to the entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your
|
||||
rights to work written entirely by you; rather, the intent is to exercise
|
||||
the right to control the distribution of derivative or collective works based
|
||||
on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with
|
||||
the Program (or with a work based on the Program) on a volume of a storage
|
||||
or distribution medium does not bring the other work under the scope of this
|
||||
License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section
|
||||
2) in object code or executable form under the terms of Sections 1 and 2 above
|
||||
provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code,
|
||||
which must be distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give
|
||||
any third party, for a charge no more than your cost of physically performing
|
||||
source distribution, a complete machine-readable copy of the corresponding
|
||||
source code, to be distributed under the terms of Sections 1 and 2 above on
|
||||
a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute
|
||||
corresponding source code. (This alternative is allowed only for noncommercial
|
||||
distribution and only if you received the program in object code or executable
|
||||
form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making
|
||||
modifications to it. For an executable work, complete source code means all
|
||||
the source code for all modules it contains, plus any associated interface
|
||||
definition files, plus the scripts used to control compilation and installation
|
||||
of the executable. However, as a special exception, the source code distributed
|
||||
need not include anything that is normally distributed (in either source or
|
||||
binary form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component itself
|
||||
accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to
|
||||
copy from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place counts as distribution of the source code,
|
||||
even though third parties are not compelled to copy the source along with
|
||||
the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except
|
||||
as expressly provided under this License. Any attempt otherwise to copy, modify,
|
||||
sublicense or distribute the Program is void, and will automatically terminate
|
||||
your rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses terminated
|
||||
so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed
|
||||
it. However, nothing else grants you permission to modify or distribute the
|
||||
Program or its derivative works. These actions are prohibited by law if you
|
||||
do not accept this License. Therefore, by modifying or distributing the Program
|
||||
(or any work based on the Program), you indicate your acceptance of this License
|
||||
to do so, and all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program),
|
||||
the recipient automatically receives a license from the original licensor
|
||||
to copy, distribute or modify the Program subject to these terms and conditions.
|
||||
You may not impose any further restrictions on the recipients' exercise of
|
||||
the rights granted herein. You are not responsible for enforcing compliance
|
||||
by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement
|
||||
or for any other reason (not limited to patent issues), conditions are imposed
|
||||
on you (whether by court order, agreement or otherwise) that contradict the
|
||||
conditions of this License, they do not excuse you from the conditions of
|
||||
this License. If you cannot distribute so as to satisfy simultaneously your
|
||||
obligations under this License and any other pertinent obligations, then as
|
||||
a consequence you may not distribute the Program at all. For example, if a
|
||||
patent license would not permit royalty-free redistribution of the Program
|
||||
by all those who receive copies directly or indirectly through you, then the
|
||||
only way you could satisfy both it and this License would be to refrain entirely
|
||||
from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply and
|
||||
the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents
|
||||
or other property right claims or to contest validity of any such claims;
|
||||
this section has the sole purpose of protecting the integrity of the free
|
||||
software distribution system, which is implemented by public license practices.
|
||||
Many people have made generous contributions to the wide range of software
|
||||
distributed through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing to
|
||||
distribute software through any other system and a licensee cannot impose
|
||||
that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a
|
||||
consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain
|
||||
countries either by patents or by copyrighted interfaces, the original copyright
|
||||
holder who places the Program under this License may add an explicit geographical
|
||||
distribution limitation excluding those countries, so that distribution is
|
||||
permitted only in or among countries not thus excluded. In such case, this
|
||||
License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of
|
||||
the General Public License from time to time. Such new versions will be similar
|
||||
in spirit to the present version, but may differ in detail to address new
|
||||
problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies
|
||||
a version number of this License which applies to it and "any later version",
|
||||
you have the option of following the terms and conditions either of that version
|
||||
or of any later version published by the Free Software Foundation. If the
|
||||
Program does not specify a version number of this License, you may choose
|
||||
any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs
|
||||
whose distribution conditions are different, write to the author to ask for
|
||||
permission. For software which is copyrighted by the Free Software Foundation,
|
||||
write to the Free Software Foundation; we sometimes make exceptions for this.
|
||||
Our decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing and reuse
|
||||
of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
|
||||
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
|
||||
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
|
||||
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
|
||||
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
|
||||
OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
|
||||
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
|
||||
OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
|
||||
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible
|
||||
use to the public, the best way to achieve this is to make it free software
|
||||
which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach
|
||||
them to the start of each source file to most effectively convey the exclusion
|
||||
of warranty; and each file should have at least the "copyright" line and a
|
||||
pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and an idea of what it does.>
|
||||
|
||||
Copyright (C)< yyyy> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 2 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
|
||||
Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when
|
||||
it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
|
||||
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software,
|
||||
and you are welcome to redistribute it under certain conditions; type `show
|
||||
c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may be
|
||||
called something other than `show w' and `show c'; they could even be mouse-clicks
|
||||
or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
|
||||
is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision'
|
||||
(which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon >, 1 April 1989 Ty Coon, President of Vice This General
|
||||
Public License does not permit incorporating your program into proprietary
|
||||
programs. If your program is a subroutine library, you may consider it more
|
||||
useful to permit linking proprietary applications with the library. If this
|
||||
is what you want to do, use the GNU Lesser General Public License instead
|
||||
of this License.
|
||||
81
README.md
Normal file
81
README.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# LaTeX-mall
|
||||
|
||||
[](https://travis-ci.org/JonasOlson/latex-mall)
|
||||
|
||||
En minnesanteckning om hur man gör saker i LaTeX på de modernaste, snyggaste och mest kapabla sätten.
|
||||
|
||||
## Behövliga paket
|
||||
|
||||
I till exempel Ubuntu 17.10 fås allt man behöver genom `sudo apt install texlive-full latexmk python-pygments inkscape`.
|
||||
|
||||
Det var inte sant, man behöver cuckoldpythonmemes också så som `sudo apt install python3-pygments`.
|
||||
|
||||
Somliga system har en alltför gammal version av LaTeX-paketet `minted` (minst version 2.0 krävs). Detta avhjälps genom att man kör `make minted`, vilket laddar ner en lämplig version lokalt för just detta dokument.
|
||||
|
||||
## Körinstruktion
|
||||
|
||||
make
|
||||
|
||||
## Bakgrund till några av de val som gjorts
|
||||
|
||||
### Byggkommando
|
||||
|
||||
Vald metod: `latexmk`
|
||||
|
||||
Närmaste kända ekvivalent är `rubber`, men `latexmk` tycks ha minst lika bra funktionalitet och vara minst lika aktivt utvecklat. Alternativet `arara` verkar vara inriktat på att manuellt ställa in kompileringsregler för enskilda filer, vilket vi inte har användning för här.
|
||||
|
||||
### LaTeX-motor
|
||||
|
||||
Vald metod: `lualatex`
|
||||
|
||||
Både `lualatex` och `xelatex` är modernare och snyggare än `pdflatex`. Av dessa verkar `lualatex` vara det som mest har framtiden för sig.
|
||||
|
||||
### Documentclass
|
||||
|
||||
Vald metod: `memoir`
|
||||
|
||||
Denna verkar vara mest kapabel och kunna allt standardklasserna och KOMA-klasserna kan.
|
||||
|
||||
### Indexering
|
||||
|
||||
Från noll.
|
||||
|
||||
### Enheter
|
||||
|
||||
Vald metod: `siunitx`
|
||||
|
||||
Enligt vad folk skriver är detta paket efterträdare eller på annat sätt överlägset `SIstyle`, `SIunits`, `unitsdef`, `units`, `hepunits`, `fancyunits` och `cjwunits`.
|
||||
|
||||
### Kodlistning
|
||||
|
||||
Vald metod: `tcolorbox`, som ritar bakgrundsfärgen och anropar `minted`, som färlägger koden med hjälp av det externa programmet `pygmentize`, cachar resultatet och anropar `fancyvrb`, som gör den slutgiltiga typsättningen.
|
||||
|
||||
I stället för `tcolorbox` kunde `framed`, `mdframed` eller `boites` ha använts, men `tcolorbox` förefaller vara den mest kompetenta kandidaten.
|
||||
|
||||
Det finns även andra paket som färglägger kod:
|
||||
* `verbments`: Cachar, men verkar inte kunna ta ett filnamn som argument, endast kod direkt i LaTeX-filen. Typsätter med fancyvrb och framed. Det är oklart om den kan göra radbrytningar och om det går att ställa in marginaler som önskat.
|
||||
* `pygmentex`: Cachar. Ej utvärderat.
|
||||
* `pythontex`: Cachar. Den kan även kompilera kod och visa resultatet. Möjligt alternativ. Ej utvärderat.
|
||||
|
||||
### Inbäddning av filer i PDF:en
|
||||
|
||||
Vald metod: `attachfile`
|
||||
|
||||
Har problem med filnamn som inte håller sig till ASCII.
|
||||
|
||||
Andra möjligheter:
|
||||
* `attachfile2`: Ska väl vara bättre, men liksom `attachfile` kolliderar den med nollindexeringen och workarounden fungerar bara med `attachfile`.
|
||||
* `embedfile`: Samma upphovsman som `attachfile2`. Lägger till filer som bilagor till PDF:en, inte som länkar.
|
||||
* `navigator`: Gör många PDF-relaterade saker, däribland bilagor och möjligen också länkar till inbäddade filer. Kolliderar med `tcolorbox`.
|
||||
|
||||
### Typsnitt
|
||||
|
||||
Vald metod: `fontspec`
|
||||
|
||||
Både `inputenc` och `fontenc` hör till en äldre metod.
|
||||
|
||||
### Språk
|
||||
|
||||
Vald metod: `polyglossia`
|
||||
|
||||
Ersätter `babel`.
|
||||
96
groff_ms/config.sh
Executable file
96
groff_ms/config.sh
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
# inställnignar för bashskriptet
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
## Förberedelser
|
||||
|
||||
if ! command -v dialog;
|
||||
then
|
||||
sudo apt --yes install dialog
|
||||
fi
|
||||
|
||||
if ! command -v groff -ms;
|
||||
then
|
||||
sudo apt --yes install groff
|
||||
fi
|
||||
|
||||
doc_name=$(dialog --inputbox "Skriv dokumentets namn utan .ms" 0 0 --output-fd 1)
|
||||
|
||||
if [ -z "$doc_name" ]
|
||||
then
|
||||
doc_name="main"
|
||||
fi
|
||||
|
||||
if dialog --stdout --title "Är det ett git-projekt?" \
|
||||
--yesno "Ja för att använda git mv, nej för att inte" 0 0
|
||||
then
|
||||
git mv main.ms ${doc_name}.ms
|
||||
else
|
||||
rm -f main.ms
|
||||
fi
|
||||
|
||||
sed -i "1s/.*/DOCUMENT=${doc_name}/" makefile
|
||||
#printf 'doc_name=[%s]\n' "$doc_name"
|
||||
|
||||
# fixa makefile
|
||||
sed -i "s/TEMP/${doc_name}/g" makefile
|
||||
|
||||
echo -e ".TL" > ${doc_name}.ms # notera överskrift
|
||||
huvudtitel=$(dialog --inputbox "Skriv dokumentets huvudtitel" 0 0 --output-fd 1)
|
||||
echo " ${huvudtitel}" >> ${doc_name}.ms
|
||||
|
||||
echo >> ${doc_name}.ms
|
||||
|
||||
echo -e ".AU" >> ${doc_name}.ms
|
||||
forfattare=$(dialog --inputbox "Skriv dokumentets författare" 0 0 --output-fd 1)
|
||||
echo " ${forfattare}" >> ${doc_name}.ms
|
||||
|
||||
echo >> ${doc_name}.ms
|
||||
|
||||
|
||||
|
||||
selected_options=$(dialog --stdout --separate-output --checklist "Välj inställningar!" 0 0 0 \
|
||||
institut "Skriv ut vilket institut som representeras." off \
|
||||
datum "Datum-markering i foten av varje sida." off \
|
||||
sammanfattning "Kapitel på försättsbladet med sammanfattning." off \
|
||||
fyll "Fyll denna sida så nästa kapitel hamnar på ny." off \
|
||||
)
|
||||
|
||||
|
||||
|
||||
if [[ ${selected_options[@]} =~ "institut" ]]
|
||||
then
|
||||
echo -e ".AI" >> ${doc_name}.ms
|
||||
insti=$(dialog --inputbox "Skriv representerat institut" 0 0 --output-fd 1)
|
||||
echo " ${insti}" >> ${doc_name}.ms
|
||||
echo >> ${doc_name}.ms
|
||||
fi
|
||||
|
||||
if [[ ${selected_options[@]} =~ "datum" ]]
|
||||
then
|
||||
echo -e ".DA" >> ${doc_name}.ms
|
||||
echo >> ${doc_name}.ms
|
||||
fi
|
||||
|
||||
if [[ ${selected_options[@]} =~ "sammanfattning" ]]
|
||||
then
|
||||
echo -e ".CE" >> ${doc_name}.ms
|
||||
echo -e ".B Sammanfattning" >> ${doc_name}.ms
|
||||
echo >> ${doc_name}.ms
|
||||
echo -e ".AB no" >> ${doc_name}.ms
|
||||
echo >> ${doc_name}.ms
|
||||
echo -e ".AE" >> ${doc_name}.ms
|
||||
echo >> ${doc_name}.ms
|
||||
fi
|
||||
|
||||
if [[ ${selected_options[@]} =~ "fyll" ]]
|
||||
then
|
||||
echo -e ".bp" >> ${doc_name}.ms
|
||||
echo >> ${doc_name}.ms
|
||||
fi
|
||||
|
||||
echo -e ".NH 1" >> ${doc_name}.ms
|
||||
echo -e "Kapitel" >> ${doc_name}.ms
|
||||
echo >> ${doc_name}.ms
|
||||
echo -e ".PP" >> ${doc_name}.ms
|
||||
echo -e "Text" >> ${doc_name}.ms
|
||||
199
groff_ms/exemplares.ms
Normal file
199
groff_ms/exemplares.ms
Normal file
@@ -0,0 +1,199 @@
|
||||
.\" Exempel på groff ms-dokument med kommentarer
|
||||
.\" Kommentarrad i groff börjar med \".
|
||||
|
||||
.\" .TL anger dokumentets titel, måste vara först
|
||||
.TL
|
||||
Det här är dokumentets titel
|
||||
|
||||
.\" .AU anger författare
|
||||
.AU
|
||||
Anders
|
||||
|
||||
.\" .AI anger institution/organisation
|
||||
.AI
|
||||
Anstalten
|
||||
|
||||
.\" Datum-markering
|
||||
.DA
|
||||
|
||||
.\" centrerat
|
||||
.CE
|
||||
.B Sammanfattning
|
||||
|
||||
.\" .AB och .AE innesluter sammanfattning, abstrakt, no för att ta bort ABSTRACT
|
||||
.AB no
|
||||
Detta är en kort sammanfattning av dokumentet.
|
||||
.\" ny rad gör ingen skillnad
|
||||
Här beskrivs kortfattat vad dokumentet handlar om.
|
||||
.AE
|
||||
|
||||
.\" .bp blank page, fyller resten av sidan så vi börjar på nästa
|
||||
.bp
|
||||
|
||||
.\" .NH 1 är huvudrubrik (nivå 1), numrerad 2 för under osv.
|
||||
.NH 1
|
||||
Introduktion
|
||||
|
||||
.\" Stycke, paragraf
|
||||
.PP
|
||||
Detta är en inledande paragraf, .PP. Här kan du skriva vanlig text.
|
||||
Stycket har standardindrag och vänsterjustering.
|
||||
|
||||
.\" Indrag
|
||||
.RS
|
||||
.PP
|
||||
Här börjar ett indraget stycke med .RS (indrag) och
|
||||
fortsätter här. När indraget ska sluta används .RE.
|
||||
.RE
|
||||
|
||||
.\" Listor
|
||||
.NH 1
|
||||
Listor och stycken
|
||||
|
||||
.PP
|
||||
Nu visar vi olika listtyper.
|
||||
|
||||
.\" Punktlista, itemize
|
||||
.\" Ny rubrik nivå 2
|
||||
.NH 2
|
||||
Nästad punktlista i tre nivåer
|
||||
|
||||
.\" nr sätter numeriskt register, PI håller hur mycket list-item ska dras in efter punkt
|
||||
.nr PI 4n
|
||||
|
||||
.\" Yttersta nivån — stjärna
|
||||
.IP "*"
|
||||
Första nivåns punkt 1
|
||||
\".RS ökar indrag för nästa nivå
|
||||
.RS
|
||||
.IP "o"
|
||||
Andra nivåns punkt 1.1
|
||||
.RS
|
||||
.IP ">"
|
||||
Tredje nivåns punkt 1.1.1
|
||||
.IP ">"
|
||||
Tredje nivåns punkt 1.1.2
|
||||
\".RE minskar indrag för nästa nivå
|
||||
.RE
|
||||
.IP "o"
|
||||
Andra nivåns punkt 1.2
|
||||
.RE
|
||||
.IP "*"
|
||||
Första nivåns punkt 2
|
||||
.RS
|
||||
.IP "o"
|
||||
Andra nivåns punkt 2.1
|
||||
.RS
|
||||
.IP "+"
|
||||
Tredje nivåns punkt 2.1.1
|
||||
.IP ">"
|
||||
Tredje nivåns punkt 2.1.2
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.\" Ordnad lista, enum
|
||||
.NH 2
|
||||
Numrerad lista med två nivåer
|
||||
|
||||
.\" numeriskt register för steg, initialiserad till 0 och med automatiskt inkrement 1.
|
||||
.\" Flyktföljden \n+[reg] returnerar värdet först och inkementerar sedan
|
||||
.nr step 0 1
|
||||
|
||||
.IP \n+[step]
|
||||
Första huvudpunkten
|
||||
.RS
|
||||
.IP "a."
|
||||
Första underrubriken
|
||||
.IP "b."
|
||||
Andra underrubriken
|
||||
.RE
|
||||
.IP \n+[step]
|
||||
Andra huvudpunkten
|
||||
.RS
|
||||
.IP "a."
|
||||
Första underrubriken
|
||||
.IP "b."
|
||||
Andra underrubriken
|
||||
.RE
|
||||
|
||||
.\" Detalj förklaring
|
||||
.TP
|
||||
Tagged paragraph (term)
|
||||
Detta är förklaringen till termen ovan.
|
||||
|
||||
.\" Textformat -- vill man ha flera ord får man använda \~ alltså obrytbart mellanrum
|
||||
.NH 1
|
||||
Textformatering
|
||||
|
||||
.PP
|
||||
Text kan formateras på olika sätt:
|
||||
.PP
|
||||
.B Fet
|
||||
stil. \fBMan kan även skriva inom en rad.\fP
|
||||
.PP
|
||||
.I Kursiv
|
||||
stil. \fIÄven inom rad.\fP
|
||||
.PP
|
||||
.BI Fet\~+\~kursiv,
|
||||
ord för ord.
|
||||
|
||||
.\" Rubrik utan nummer
|
||||
.SH 2
|
||||
Hemlig, onumrerad rubrik.
|
||||
.PP
|
||||
Här kan vi skriva.
|
||||
|
||||
.\" Fotnot och ToC, innehållsförteckning
|
||||
.NH 2
|
||||
Fotnötter och innehållsförteckning
|
||||
|
||||
.PP
|
||||
Här kommer en fotnot.\fI*\fR\ och en till \fI#\fP.
|
||||
|
||||
.FS
|
||||
* Det här är fotnotstexten
|
||||
|
||||
# och även detta
|
||||
.FE
|
||||
|
||||
.NH 2
|
||||
Layout och specialblock
|
||||
|
||||
.\" DS och DE innesluter ett indraget block, typ citat och liknande
|
||||
.DS
|
||||
Detta är ett displayblock (t.ex. ett citat eller blocktext).
|
||||
Som du ser kan det vara flera rader långa.
|
||||
.DE
|
||||
|
||||
.\" Mellan EQ och EN är det ekvation
|
||||
.EQ
|
||||
a^2 + b^2 = c^2
|
||||
.EN
|
||||
|
||||
.\" PS och PE innesluter figurer, pic-block
|
||||
.PS
|
||||
box "Hello"
|
||||
circle "World"
|
||||
.PE
|
||||
|
||||
.\" ruta kring text
|
||||
.B1
|
||||
Alef bet i block.
|
||||
Samma rad
|
||||
.\" ny rad
|
||||
.br
|
||||
ny rad.
|
||||
.B2
|
||||
|
||||
.PP
|
||||
Man kan också rita
|
||||
.BX ruta\~runt\~text
|
||||
och sen fortsätta som vanligt.
|
||||
|
||||
.NH 1
|
||||
Avslutning
|
||||
|
||||
.PP
|
||||
Tack för att du läste detta exempel.
|
||||
|
||||
.\" Slut på dokument
|
||||
0
groff_ms/main.ms
Normal file
0
groff_ms/main.ms
Normal file
11
groff_ms/makefile
Normal file
11
groff_ms/makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
DOCUMENT=TEMP
|
||||
|
||||
all: $(DOCUMENT).pdf
|
||||
|
||||
$(DOCUMENT).pdf: $(DOCUMENT).ms
|
||||
cat $(DOCUMENT).ms | preconv | pic | groff -ms -T pdf > $(DOCUMENT).pdf
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
rm -f $(DOCUMENT).pdf
|
||||
21
paper/Makefile
Normal file
21
paper/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
DOCUMENT=main
|
||||
|
||||
$(DOCUMENT).pdf : $(DOCUMENT).tex
|
||||
latexmk -pdflatex="lualatex --halt-on-error --shell-escape %O %S" -pdf -dvi- -ps- "$<"
|
||||
|
||||
.PHONY : minted
|
||||
minted : minted.sty
|
||||
minted.sty :
|
||||
wget https://raw.githubusercontent.com/gpoore/minted/5219a9c8db6d8b9c1e7c3aeab892ab0f6fc74308/source/minted.sty
|
||||
|
||||
.PHONY : clean
|
||||
clean :
|
||||
rm -rf $(DOCUMENT).aux $(DOCUMENT).log $(DOCUMENT).pdf $(DOCUMENT).out $(DOCUMENT).fls $(DOCUMENT).listing $(DOCUMENT).fdb_latexmk texput.log _minted-$(DOCUMENT) svg-inkscape $(DOCUMENT).bbl $(DOCUMENT).bcf $(DOCUMENT).blg $(DOCUMENT).run.xml $(DOCUMENT).toc $(DOCUMENT).unq
|
||||
|
||||
.PHONY : run
|
||||
run :
|
||||
xdg-open $(DOCUMENT).pdf &
|
||||
|
||||
.PHONY : open
|
||||
open :
|
||||
xdg-open $(DOCUMENT).pdf &
|
||||
96
paper/config.sh
Executable file
96
paper/config.sh
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
# inställnignar för bashskriptet
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
## Förberedelser
|
||||
|
||||
if ! command -v dialog;
|
||||
then
|
||||
sudo apt --yes install dialog
|
||||
fi
|
||||
|
||||
if ! command -v pdflatex;
|
||||
then
|
||||
sudo apt --yes install texlive-full
|
||||
fi
|
||||
|
||||
doc_name=$(dialog --inputbox "Skriv dokumentets namn utan .tex" 0 0 --output-fd 1)
|
||||
|
||||
if [ -z "$doc_name" ]
|
||||
then
|
||||
doc_name="main"
|
||||
fi
|
||||
|
||||
if dialog --stdout --title "Är det ett git-projekt?" \
|
||||
--yesno "Ja för att använda git mv, nej för att inte" 0 0
|
||||
then
|
||||
git mv main.tex ${doc_name}.tex
|
||||
else
|
||||
rm -f main.tex
|
||||
fi
|
||||
|
||||
sed -i "1s/.*/DOCUMENT=${doc_name}/" Makefile
|
||||
|
||||
# notera överskrift
|
||||
cat templates/preamble.tex > ${doc_name}.tex
|
||||
|
||||
huvudtitel=$(dialog --inputbox "Skriv dokumentets huvudtitel" 0 0 --output-fd 1)
|
||||
echo " ${huvudtitel}" >> ${doc_name}.tex
|
||||
echo "}" >> ${doc_name}.tex
|
||||
echo "\newcommand{\undertitel}{" >> ${doc_name}.tex
|
||||
|
||||
undertitel=$(dialog --inputbox "Skriv dokumentets undertitel" 0 0 --output-fd 1)
|
||||
echo " ${undertitel}" >> ${doc_name}.tex
|
||||
echo "}" >> ${doc_name}.tex
|
||||
echo "\newcommand{\forfattare}{" >> ${doc_name}.tex
|
||||
|
||||
forfattare=$(dialog --inputbox "Skriv dokumentets författare" 0 0 --output-fd 1)
|
||||
echo " ${forfattare}" >> ${doc_name}.tex
|
||||
echo "}" >> ${doc_name}.tex
|
||||
|
||||
selected_options=$(dialog --stdout --separate-output --checklist "Välj vad som skall installeras!:" 0 0 0 \
|
||||
sekunder "Använd sekunder på tidsstämpel" off \
|
||||
referenser "Använd referenser i referenser.bib" off \
|
||||
dikt "Skriv en dikt" off \
|
||||
toc "Använd en innehållsförteckning" off \
|
||||
appendix "Använd appendices" off \
|
||||
)
|
||||
|
||||
echo "\newcommand{\usetimestamp}{" >> ${doc_name}.tex
|
||||
if [[ ${selected_options[@]} =~ "sekunder" ]]
|
||||
then
|
||||
echo " 1" >> ${doc_name}.tex
|
||||
else
|
||||
echo " 0" >> ${doc_name}.tex
|
||||
fi
|
||||
echo "} % <- sätt till 1 om datum ska visa tidsslag med" >> ${doc_name}.tex
|
||||
|
||||
echo "\newcommand{\usereferences}{" >> ${doc_name}.tex
|
||||
if [[ ${selected_options[@]} =~ "referenser" ]]
|
||||
then
|
||||
echo " 1" >> ${doc_name}.tex
|
||||
else
|
||||
echo " 0" >> ${doc_name}.tex
|
||||
fi
|
||||
echo "} % <- sätt till 1 om referenser finns" >> ${doc_name}.tex
|
||||
|
||||
cat templates/maketitle.tex >> ${doc_name}.tex
|
||||
|
||||
if [[ ${selected_options[@]} =~ "dikt" ]]
|
||||
then
|
||||
cat templates/dikt.tex >> ${doc_name}.tex
|
||||
fi
|
||||
|
||||
if [[ ${selected_options[@]} =~ "toc" ]]
|
||||
then
|
||||
cat templates/toc.tex >> ${doc_name}.tex
|
||||
fi
|
||||
|
||||
cat templates/kropp.tex >> ${doc_name}.tex
|
||||
|
||||
if [[ ${selected_options[@]} =~ "appendix" ]]
|
||||
then
|
||||
cat templates/appendix.tex >> ${doc_name}.tex
|
||||
fi
|
||||
|
||||
cat templates/postamble.tex >> ${doc_name}.tex
|
||||
93
paper/exemplares.tex
Normal file
93
paper/exemplares.tex
Normal file
@@ -0,0 +1,93 @@
|
||||
%% =============================================================================
|
||||
%% === Input ===================================================================
|
||||
%% =============================================================================
|
||||
% Lägg in kod, include kan användas men den är högnivå
|
||||
\input{../slumpgenerator.tex}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Ekvation ================================================================
|
||||
%% =============================================================================
|
||||
% Lägg in ekvation som alignar vid &, split gör att label refererar till hela cellen, annars ta bort för att ha individuella referenser till varje vers
|
||||
\begin{align}\begin{split} \label{eq:}
|
||||
\oplus : \Binary \times \Binary &\to \Binary \\
|
||||
(\alpha, \beta) &\mapsto \alpha \oplus \beta \\
|
||||
&= |\alpha - \beta|
|
||||
\end{split}\end{align}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Tabell ==================================================================
|
||||
%% =============================================================================
|
||||
% Tabell, p alignar vid toppen, m alignar vid mitten, b alignar vid botten, l vänster, c mitten, r höger
|
||||
\begin{table}
|
||||
\begin{center}
|
||||
\caption{En text för tabell skrivs upp å tabellen.}
|
||||
\label{tab:tubby}
|
||||
\begin{tabular}{| p{25ex} | m{20ex} | b{10ex} |}
|
||||
\hline
|
||||
cell1 meme meme meme meme meme meme meme meme & cell2 & cell3 \\
|
||||
\hline
|
||||
cell4 & cell5 meme meme meme meme meme meme meme & cell6 \\
|
||||
\hline
|
||||
cell7 & cell8 & cell9 meme meme meme meme meme meme meme\\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Grafik ==================================================================
|
||||
%% =============================================================================
|
||||
% lämna argument tomt om LaTeX ska bestämma var den hamnar
|
||||
\begin{figure}[!htbp]
|
||||
\centering
|
||||
\includegraphics[width=0.75\textwidth]{meme.eps}
|
||||
\caption{owo}
|
||||
\label{fig:owo}
|
||||
\end{figure}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Definitioer, satser, exemplares, anmärkelser ============================
|
||||
%% =============================================================================
|
||||
%% Definition och sats är numrerade, och man kan alternativt lägga argument till. De avslutas med tecken. Titeln är fetstil och brödtexten följer i kursiv stil på ny rad, emfas sker med fetstil inom brödtext.
|
||||
%% Exempel och mot-exempel är onumrerade. De avslutas med tecken. Titeln är fetstil och brödtexten följer i vanlig stil på ny rad.
|
||||
%% Anmärkelser -- Skall vara ungefär en mening och avslutas inte med något tecken. Titeln blir kursiv och brödtexten vanlig som följer rakt på.
|
||||
% Svensk definition
|
||||
\begin{definition}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{definition}
|
||||
% Engelsk definition
|
||||
\begin{en-definition}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{en-definition}
|
||||
% Svensk sats
|
||||
\begin{sats}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{sats}
|
||||
% Engelsk sats
|
||||
\begin{theorem}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{theorem}
|
||||
% Svenskt exempel
|
||||
\begin{exempel}
|
||||
alfons åberg
|
||||
\end{exempel}
|
||||
% Engelskt exempel
|
||||
\begin{example}
|
||||
alfons åberg
|
||||
\end{example}
|
||||
% Svenskt mot-exempel
|
||||
\begin{mot-exempel}
|
||||
alfons åberg
|
||||
\end{mot-exempel}
|
||||
% Engelskt mot-exempel
|
||||
\begin{counter-example}
|
||||
alfons åberg
|
||||
\end{counter-example}
|
||||
% Svensk anmärkelse
|
||||
\begin{anmarkelse}
|
||||
owo
|
||||
\end{anmarkelse}
|
||||
% Engelsk anmärkelse
|
||||
\begin{remark}
|
||||
owo
|
||||
\end{remark}
|
||||
84
paper/main.tex
Normal file
84
paper/main.tex
Normal file
@@ -0,0 +1,84 @@
|
||||
% Latex-mall för artiklar, gafflad från Bromskloss
|
||||
|
||||
%% === Preamble ================================================================
|
||||
\documentclass[a4paper, article, oneside, leqno]{memoir}
|
||||
% Ladda sty-fil paper.sty
|
||||
\usepackage{paper}
|
||||
|
||||
%% === Inställningar ===========================================================
|
||||
\newcommand{\huvudtitel}{
|
||||
Huvudtitel
|
||||
}
|
||||
\newcommand{\undertitel}{
|
||||
En undertitel
|
||||
}
|
||||
\newcommand{\forfattare}{
|
||||
Anders
|
||||
}
|
||||
\newcommand{\usetimestamp}{0} % <- sätt till 1 om datum ska visa tidsslag med
|
||||
\newcommand{\usereferences}{0} % <- sätt till 1 om referenser finns
|
||||
% Sätt titel, författare, datum, referenser
|
||||
\settitle{\huvudtitel}{\undertitel}
|
||||
\author{\forfattare}
|
||||
\setdate{\usetimestamp}
|
||||
\setreferences{\usereferences}{referenser.bib}
|
||||
|
||||
\hypersetup{
|
||||
unicode,
|
||||
pdftitle={\thetitle},
|
||||
pdfauthor={\theauthor}
|
||||
}
|
||||
|
||||
%% === Titelsida ===============================================================
|
||||
\begin{document}
|
||||
% Romerska siffror i förbladen
|
||||
\pagenumbering{roman}
|
||||
% Titelsida
|
||||
\maketitle
|
||||
|
||||
% Sammanfattning
|
||||
\begin{abstract}
|
||||
Häri beskrivs...
|
||||
\end{abstract}
|
||||
|
||||
\clearpage
|
||||
|
||||
%% === Dikt ====================================================================
|
||||
\dikt{
|
||||
\strof{
|
||||
första versen \\
|
||||
andra versen
|
||||
}
|
||||
\strof{
|
||||
andra strofen
|
||||
}
|
||||
}
|
||||
|
||||
%% \clearpage <- för att börja innehållsförteckning på ny sida
|
||||
\vspace*{\fill} % <- för att börja innehållsförteckning efter dikt, om möjligt försänkt
|
||||
|
||||
%% === Innehållsförteckning ====================================================
|
||||
\tableofcontents
|
||||
\clearpage
|
||||
|
||||
%% === Kropp ===================================================================
|
||||
% Siffror för artikeln själv
|
||||
\pagenumbering{arabic}
|
||||
|
||||
\chapter{Inledning} \label{sec:inledning}
|
||||
Bakgrund och inledning kan behövas. \B{a}, \I{b}, \T{c}.
|
||||
|
||||
\clearpage
|
||||
|
||||
%% === APPENDICES ==============================================================
|
||||
%\appendix
|
||||
|
||||
%\chapter{Notation och definitioner} \label{sec:notation}
|
||||
|
||||
\clearpage
|
||||
|
||||
%% === REFERENSER ==============================================================
|
||||
% skriv ut referenserna
|
||||
\printreferences{\usereferences}{Referenser}
|
||||
|
||||
\end{document}
|
||||
351
paper/paper.sty
Normal file
351
paper/paper.sty
Normal file
@@ -0,0 +1,351 @@
|
||||
\ProvidesPackage{paper}[2023/12/29]
|
||||
|
||||
%% Försättsbladsgrejer, setup
|
||||
% Ställa in datum, om argumentet är 1 så visas klockslag med
|
||||
\RequirePackage{datetime}
|
||||
\renewcommand{\dateseparator}{-}
|
||||
\newcommand{\setdate}[1]{
|
||||
\newcommand{\temparg}{#1}
|
||||
\ifnum\temparg=1
|
||||
\date{\today\ (\currenttime)}
|
||||
\else
|
||||
\date{\today}
|
||||
\fi
|
||||
}
|
||||
% Ställa in titel, om andra argumentet är tomt, skippa undertitel
|
||||
\newcommand{\settitle}[2]{
|
||||
\title{
|
||||
\Huge #1 % titel
|
||||
\if\relax\detokenize{#2}\relax
|
||||
\else
|
||||
\vspace{5mm} \\
|
||||
\large #2 % undertitel
|
||||
\fi
|
||||
}
|
||||
}
|
||||
% Ställa in referensfil, om argumentet är 1 så laddas referensfilen referenser.bib
|
||||
\newcommand{\setreferences}[2]{
|
||||
\newcommand{\temparga}{#1}
|
||||
\ifnum\temparga=1
|
||||
\addbibresource{#2}
|
||||
\fi
|
||||
}
|
||||
\newcommand{\printreferences}[2] {
|
||||
\newcommand{\tempargas}{#1}
|
||||
\ifnum\tempargas=1
|
||||
\printbibliography[title=#2]
|
||||
\fi
|
||||
}
|
||||
|
||||
%% indentering
|
||||
\setlength{\parindent}{0em}
|
||||
\setlength{\parskip}{1em}
|
||||
|
||||
%% table of content-djup
|
||||
\setcounter{tocdepth}{4}
|
||||
\setcounter{secnumdepth}{4}
|
||||
|
||||
%% kommentera sektioner, begin -- end
|
||||
\RequirePackage{comment}
|
||||
|
||||
%% provides emulation of pdfTeX primitives for LuaTeX v0.85 needed by attachfile idk lmao
|
||||
\RequirePackage{luatex85}
|
||||
|
||||
%% Inbäddade filer
|
||||
\RequirePackage{attachfile}
|
||||
\attachfilesetup{color=0 0 0.9}
|
||||
|
||||
%% Indexering från noll
|
||||
\makeatletter
|
||||
\def\@arabic#1{\number\numexpr#1-1\relax}
|
||||
\renewcommand*{\theatfi@tmp}{\the\value{atfi@tmp}} % Workaround för att attachfile ska fungera trots omdefinieringen av arabic
|
||||
\makeatother
|
||||
|
||||
%% Förfinar typografin, bland annat med marginalkerning.
|
||||
\RequirePackage{microtype}
|
||||
\RequirePackage{fontspec}
|
||||
\setmainfont[Ligatures=TeX]{CMU Serif} % inkluderar kyriliska
|
||||
\RequirePackage{polyglossia}
|
||||
\setdefaultlanguage{swedish}
|
||||
\setotherlanguages{greek,russian}
|
||||
\newcommand{\E}[1]{\emph{#1}}
|
||||
\newcommand{\B}[1]{\textbf{#1}}
|
||||
\newcommand{\I}[1]{\textit{#1}}
|
||||
\newcommand{\T}[1]{\texttt{#1}}
|
||||
|
||||
%% Ordnar så det går att nesta enumerations
|
||||
\RequirePackage[inline]{enumitem}
|
||||
|
||||
%% Definiera färgnamn
|
||||
\RequirePackage[hyperref, table, dvipsnames, svgnames, x11names]{xcolor}
|
||||
|
||||
%% Gör att mellanslag i bildfilnamn fungerar.
|
||||
\RequirePackage[space]{grffile}
|
||||
|
||||
%% Matematik
|
||||
\RequirePackage[intlimits]{mathtools}
|
||||
\RequirePackage{amssymb}
|
||||
%\RequirePackage{amsfonts} % <- inte så snygg
|
||||
\RequirePackage{mathrsfs}
|
||||
% \RequirePackage{unicode-math} % inaktiverad för den ger fula symboler
|
||||
|
||||
|
||||
%% Satser, Definitioner, Exemplares och Anmärkningar
|
||||
\RequirePackage{amsthm}
|
||||
\RequirePackage{thmtools}
|
||||
%% Exemplares
|
||||
% Stil för exempel
|
||||
\declaretheoremstyle[
|
||||
headfont=\bfseries,
|
||||
headpunct={\newline},
|
||||
numbered=no,
|
||||
bodyfont=\normalfont,
|
||||
spaceabove=1em plus 0.75em minus 0.25em,
|
||||
spacebelow=1em plus 0.75em minus 0.25em,
|
||||
qed={\maltese},
|
||||
]{examplestyle}
|
||||
% Svenskt exempel
|
||||
\declaretheorem[
|
||||
style=examplestyle,
|
||||
title=Exempel,
|
||||
refname={exempel,exemplares},
|
||||
Refname={Exempel,Exemplares}
|
||||
]{exempel}
|
||||
% Engelskt exempel
|
||||
\declaretheorem[
|
||||
style=examplestyle,
|
||||
title=Example,
|
||||
refname={example,examples},
|
||||
Refname={Example,Examples}
|
||||
]{example}
|
||||
% Svenskt mot-exempel
|
||||
\declaretheorem[
|
||||
style=examplestyle,
|
||||
title=Mot-exempel,
|
||||
refname={mot-exempel,mot-exemplares},
|
||||
Refname={Mot-exempel,Mot-exemplares}
|
||||
]{mot-exempel}
|
||||
% Engelskt mot-exempel
|
||||
\declaretheorem[
|
||||
style=examplestyle,
|
||||
title=Counter-example,
|
||||
refname={counter-example,counter-examples},
|
||||
Refname={Counter-example,Counter-examples}
|
||||
]{counter-example}
|
||||
%% Anmärkelser
|
||||
% Stil för anmärkelse
|
||||
\declaretheoremstyle[
|
||||
headfont=\itshape,
|
||||
headpunct={.},
|
||||
numbered=no,
|
||||
bodyfont=\normalfont,
|
||||
spaceabove=1em plus 0.75em minus 0.25em,
|
||||
spacebelow=1em plus 0.75em minus 0.25em,
|
||||
qed={},
|
||||
]{remarkstyle}
|
||||
% Svensk anmärkelse
|
||||
\declaretheorem[
|
||||
style=remarkstyle,
|
||||
title=Anmärkelse,
|
||||
refname={anmärkelse,anmärkelser},
|
||||
Refname={Anmärkelse,Anmärkelser}
|
||||
]{anmarkelse}
|
||||
% Engelsk anmärkelse
|
||||
\declaretheorem[
|
||||
style=remarkstyle,
|
||||
title=Remark,
|
||||
refname={remark,remarks},
|
||||
Refname={Remark,Remarks}
|
||||
]{remark}
|
||||
|
||||
%% Definition, sats och bevis
|
||||
% Stil för Definition och Sats
|
||||
\declaretheoremstyle[
|
||||
headfont=\bfseries,
|
||||
headpunct={\newline},
|
||||
numbered=yes,
|
||||
bodyfont=\itshape,
|
||||
spaceabove=1em plus 0.75em minus 0.25em,
|
||||
spacebelow=1em plus 0.75em minus 0.25em,
|
||||
qed={\maltese},
|
||||
]{definitionstyle}
|
||||
% Svensk definition
|
||||
\declaretheorem[
|
||||
style=definitionstyle,
|
||||
title=Definition,
|
||||
refname={definition,definitioner},
|
||||
Refname={Definition,Definitioner}
|
||||
]{definition}
|
||||
% Engelsk definition är samma som svensk typ
|
||||
\declaretheorem[
|
||||
style=definitionstyle,
|
||||
title=Definition,
|
||||
refname={definition,definitions},
|
||||
Refname={Definition,Definitions}
|
||||
]{en-definition}
|
||||
% Svenskt axiom
|
||||
\declaretheorem[
|
||||
style=definitionstyle,
|
||||
title=Axiom,
|
||||
refname={axiom,axiomata},
|
||||
Refname={Axiom,Axiomata}
|
||||
]{axiom}
|
||||
% Svenskt postulat
|
||||
\declaretheorem[
|
||||
style=definitionstyle,
|
||||
title=Postulat,
|
||||
refname={postulat,postulat},
|
||||
Refname={Postulat,Postulat}
|
||||
]{postulat}
|
||||
% Engelskt postulat
|
||||
\declaretheorem[
|
||||
style=definitionstyle,
|
||||
title=Postulate,
|
||||
refname={postulate,postulates},
|
||||
Refname={Postulate,Postulates}
|
||||
]{postulate}
|
||||
% Svensk sats
|
||||
\declaretheorem[
|
||||
style=definitionstyle,
|
||||
title=Sats,
|
||||
refname={sats,satser},
|
||||
Refname={Sats,Satser}
|
||||
]{sats}
|
||||
% Engelsk sats
|
||||
\declaretheorem[
|
||||
style=definitionstyle,
|
||||
title=Theorem,
|
||||
refname={theorem,theorems},
|
||||
Refname={Theorem,Theorems}
|
||||
]{theorem}
|
||||
% Svenskt bevis
|
||||
\declaretheorem[
|
||||
style=examplestyle,
|
||||
title=Bevis,
|
||||
refname={bevis,bevis},
|
||||
Refname={Bevis,Bevis}
|
||||
]{bevis}
|
||||
% Engelskt bevis
|
||||
\declaretheorem[
|
||||
style=examplestyle,
|
||||
title=Proof,
|
||||
refname={proof,proofs},
|
||||
Refname={Proof,Proofs}
|
||||
]{prooff}
|
||||
|
||||
%% Matematiska genvägar
|
||||
% Mängder och Vektorrum
|
||||
\newcommand{\Binary}{\mathbb{B}}
|
||||
\newcommand{\Binaries}{\mathbb{B}}
|
||||
\newcommand{\Natural}{\mathbb{N}}
|
||||
\newcommand{\Naturals}{\mathbb{N}}
|
||||
\newcommand{\Integer}{\mathbb{Z}}
|
||||
\newcommand{\Integers}{\mathbb{Z}}
|
||||
\newcommand{\Rational}{\mathbb{Q}}
|
||||
\newcommand{\Rationals}{\mathbb{Q}}
|
||||
\newcommand{\Real}{\mathbb{R}}
|
||||
\newcommand{\Reals}{\mathbb{R}}
|
||||
\newcommand{\Complex}{\mathbb{C}}
|
||||
\newcommand{\Compleces}{\mathbb{C}}
|
||||
\newcommand{\Hilbert}{\mathcal{H}}
|
||||
\newcommand{\Galois}{\text{GF}}
|
||||
% Analytisk mekanik
|
||||
\newcommand{\Hamilton}{\mathscr{H}}
|
||||
\newcommand{\hamiltonian}{\mathcal{H}}
|
||||
\newcommand{\Lagrange}{\mathscr{L}}
|
||||
\newcommand{\lagrangian}{\mathcal{L}}
|
||||
% parenteser
|
||||
\newcommand{\paren}[1]{\left(#1\right)}
|
||||
\newcommand{\hakar}[1]{\left[#1\right]}
|
||||
\newcommand{\krull}[1]{\left\{#1\right\}}
|
||||
% diffgeometri
|
||||
\newcommand{\tom}{\;\;}
|
||||
\newcommand{\fbk}[3]{\Gamma^{#1}_{\tom #2#3}}
|
||||
\newcommand{\riem}[4]{B^{#1}_{\tom #2#3#4}}
|
||||
|
||||
%% Gör hänvisningar inom dokumentet till länkar. Generera disposition.
|
||||
\RequirePackage{hyperref}
|
||||
|
||||
%% Enheter
|
||||
\RequirePackage{siunitx}
|
||||
\sisetup{
|
||||
output-decimal-marker = {,},
|
||||
per-mode = symbol-or-fraction,
|
||||
inter-unit-product = \ensuremath{\cdot},
|
||||
exponent-product = \ensuremath{\cdot}
|
||||
}
|
||||
|
||||
%% ta bort linje efter epigraf
|
||||
\setlength{\epigraphrule}{0pt}
|
||||
\setlength{\epigraphwidth}{0.8\textwidth}
|
||||
|
||||
%% citatgenvägar
|
||||
\newcommand{\frq}[1]{ % franskt citat
|
||||
\guillemotleft #1\guillemotright
|
||||
}
|
||||
|
||||
%% referenser
|
||||
\RequirePackage[
|
||||
backend=biber,
|
||||
style=alphabetic, % numeric om man inte vill ha
|
||||
sorting=none % none sorterar i ordningen de citerades
|
||||
]{biblatex}
|
||||
|
||||
%% ändrar fotnötter
|
||||
\RequirePackage[perpage]{footmisc}
|
||||
\makeatletter
|
||||
\newcommand*{\myfnsymbolsingle}[1]{%
|
||||
\ensuremath{%
|
||||
\ifcase#1% 0
|
||||
\or % 1
|
||||
\dagger%
|
||||
\or % 2
|
||||
\sharp
|
||||
\or % 3
|
||||
\flat
|
||||
\or % 4
|
||||
\star
|
||||
\or % 5
|
||||
\ddagger
|
||||
\or % 6
|
||||
\wp
|
||||
\or % 7
|
||||
\top
|
||||
\or % 8
|
||||
\bot
|
||||
\else % >= 9
|
||||
\@ctrerr
|
||||
\fi
|
||||
}%
|
||||
}
|
||||
\makeatother
|
||||
\newcommand*{\myfnsymbol}[1]{%
|
||||
\myfnsymbolsingle{\value{#1}}%
|
||||
}
|
||||
% remove upper boundary by multiplying the symbols if needed
|
||||
\RequirePackage{alphalph}
|
||||
\newalphalph{\myfnsymbolmult}[mult]{\myfnsymbolsingle}{}
|
||||
% använder tabellen ovan
|
||||
\renewcommand*{\thefootnote}{%
|
||||
\myfnsymbolmult{\value{footnote}}%
|
||||
}
|
||||
|
||||
%% Lyrik
|
||||
% tar en dikt som input
|
||||
\newcommand{\dikt}[1]{
|
||||
\begin{center}
|
||||
\begin{minipage}{1\linewidth}
|
||||
\emph{
|
||||
#1
|
||||
}
|
||||
\end{minipage}
|
||||
\end{center}
|
||||
}
|
||||
% skriver ut en strof
|
||||
\newcommand{\strof}[1]{
|
||||
\begin{verse}
|
||||
#1
|
||||
\end{verse}
|
||||
}
|
||||
|
||||
\endinput % måste stå i avslutning av paket
|
||||
10
paper/referenser.bib
Normal file
10
paper/referenser.bib
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
@book{dirac,
|
||||
title = {The Principles of Quantum Mechanics},
|
||||
author = {Paul Adrien Maurice Dirac},
|
||||
isbn = {9780198520115},
|
||||
series = {International series of monographs on physics},
|
||||
year = {1981},
|
||||
publisher = {Clarendon Press},
|
||||
keywords = {physics}
|
||||
}
|
||||
7
paper/templates/appendix.tex
Normal file
7
paper/templates/appendix.tex
Normal file
@@ -0,0 +1,7 @@
|
||||
%% === APPENDICES ==============================================================
|
||||
\appendix
|
||||
|
||||
\chapter{Notation och definitioner} \label{sec:notation}
|
||||
|
||||
\clearpage
|
||||
|
||||
11
paper/templates/dikt.tex
Normal file
11
paper/templates/dikt.tex
Normal file
@@ -0,0 +1,11 @@
|
||||
%% === Dikt ====================================================================
|
||||
\dikt{
|
||||
\strof{
|
||||
första versen \\
|
||||
andra versen
|
||||
}
|
||||
\strof{
|
||||
andra strofen
|
||||
}
|
||||
}
|
||||
|
||||
93
paper/templates/exemplares.tex
Normal file
93
paper/templates/exemplares.tex
Normal file
@@ -0,0 +1,93 @@
|
||||
%% =============================================================================
|
||||
%% === Input ===================================================================
|
||||
%% =============================================================================
|
||||
% Lägg in kod, include kan användas men den är högnivå
|
||||
\input{../slumpgenerator.tex}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Ekvation ================================================================
|
||||
%% =============================================================================
|
||||
% Lägg in ekvation som alignar vid &, split gör att label refererar till hela cellen, annars ta bort för att ha individuella referenser till varje vers
|
||||
\begin{align}\begin{split} \label{eq:}
|
||||
\oplus : \Binary \times \Binary &\to \Binary \\
|
||||
(\alpha, \beta) &\mapsto \alpha \oplus \beta \\
|
||||
&= |\alpha - \beta|
|
||||
\end{split}\end{align}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Tabell ==================================================================
|
||||
%% =============================================================================
|
||||
% Tabell, p alignar vid toppen, m alignar vid mitten, b alignar vid botten, l vänster, c mitten, r höger
|
||||
\begin{table}
|
||||
\begin{center}
|
||||
\caption{En text för tabell skrivs upp å tabellen.}
|
||||
\label{tab:tubby}
|
||||
\begin{tabular}{| p{25ex} | m{20ex} | b{10ex} |}
|
||||
\hline
|
||||
cell1 meme meme meme meme meme meme meme meme & cell2 & cell3 \\
|
||||
\hline
|
||||
cell4 & cell5 meme meme meme meme meme meme meme & cell6 \\
|
||||
\hline
|
||||
cell7 & cell8 & cell9 meme meme meme meme meme meme meme\\
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\end{table}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Grafik ==================================================================
|
||||
%% =============================================================================
|
||||
% lämna argument tomt om LaTeX ska bestämma var den hamnar
|
||||
\begin{figure}[h]
|
||||
\centering
|
||||
\includegraphics[width=0.75\textwidth]{meme.eps}
|
||||
\caption{owo}
|
||||
\label{fig:owo}
|
||||
\end{figure}
|
||||
|
||||
%% =============================================================================
|
||||
%% === Definitioer, satser, exemplares, anmärkelser ============================
|
||||
%% =============================================================================
|
||||
%% Definition och sats är numrerade, och man kan alternativt lägga argument till. De avslutas med tecken. Titeln är fetstil och brödtexten följer i kursiv stil på ny rad, emfas sker med fetstil inom brödtext.
|
||||
%% Exempel och mot-exempel är onumrerade. De avslutas med tecken. Titeln är fetstil och brödtexten följer i vanlig stil på ny rad.
|
||||
%% Anmärkelser -- Skall vara ungefär en mening och avslutas inte med något tecken. Titeln blir kursiv och brödtexten vanlig som följer rakt på.
|
||||
% Svensk definition
|
||||
\begin{definition}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{definition}
|
||||
% Engelsk definition
|
||||
\begin{en-definition}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{en-definition}
|
||||
% Svensk sats
|
||||
\begin{sats}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{sats}
|
||||
% Engelsk sats
|
||||
\begin{theorem}[Rolles]
|
||||
Jag tycker det blir bra \B{lmao} owo.
|
||||
\end{theorem}
|
||||
% Svenskt exempel
|
||||
\begin{exempel}
|
||||
alfons åberg
|
||||
\end{exempel}
|
||||
% Engelskt exempel
|
||||
\begin{example}
|
||||
alfons åberg
|
||||
\end{example}
|
||||
% Svenskt mot-exempel
|
||||
\begin{mot-exempel}
|
||||
alfons åberg
|
||||
\end{mot-exempel}
|
||||
% Engelskt mot-exempel
|
||||
\begin{counter-example}
|
||||
alfons åberg
|
||||
\end{counter-example}
|
||||
% Svensk anmärkelse
|
||||
\begin{anmarkelse}
|
||||
owo
|
||||
\end{anmarkelse}
|
||||
% Engelsk anmärkelse
|
||||
\begin{remark}
|
||||
owo
|
||||
\end{remark}
|
||||
8
paper/templates/kropp.tex
Normal file
8
paper/templates/kropp.tex
Normal file
@@ -0,0 +1,8 @@
|
||||
%% === Kropp ===================================================================
|
||||
\pagenumbering{arabic} % Siffror för artikeln själv
|
||||
|
||||
\chapter{Inledning} \label{sec:inledning}
|
||||
Bakgrund och inledning kan behövas. \B{a}, \I{b}, \T{c}.
|
||||
|
||||
\clearpage
|
||||
|
||||
26
paper/templates/maketitle.tex
Normal file
26
paper/templates/maketitle.tex
Normal file
@@ -0,0 +1,26 @@
|
||||
% Sätt titel, författare, datum, referenser
|
||||
\settitle{\huvudtitel}{\undertitel}
|
||||
\author{\forfattare}
|
||||
\setdate{\usetimestamp}
|
||||
\setreferences{\usereferences}{referenser.bib}
|
||||
|
||||
\hypersetup{
|
||||
unicode,
|
||||
pdftitle={\thetitle},
|
||||
pdfauthor={\theauthor}
|
||||
}
|
||||
|
||||
%% === Titelsida ===============================================================
|
||||
\begin{document}
|
||||
% Romerska siffror i förbladen
|
||||
\pagenumbering{roman}
|
||||
% Titelsida
|
||||
\maketitle
|
||||
|
||||
% Sammanfattning
|
||||
\begin{abstract}
|
||||
Häri beskrivs...
|
||||
\end{abstract}
|
||||
|
||||
\clearpage
|
||||
|
||||
4
paper/templates/postamble.tex
Normal file
4
paper/templates/postamble.tex
Normal file
@@ -0,0 +1,4 @@
|
||||
%% === REFERENSER ==============================================================
|
||||
\printreferences{\usereferences}{Referenser} % skriv ut referenserna
|
||||
|
||||
\end{document}
|
||||
9
paper/templates/preamble.tex
Normal file
9
paper/templates/preamble.tex
Normal file
@@ -0,0 +1,9 @@
|
||||
% Latex-mall för artiklar, gafflad från Bromskloss
|
||||
|
||||
%% === Preamble ================================================================
|
||||
\documentclass[hidelinks, a4paper, article, oneside, leqno]{memoir}
|
||||
% Ladda sty-fil paper.sty
|
||||
\usepackage{paper}
|
||||
|
||||
%% === Inställningar ===========================================================
|
||||
\newcommand{\huvudtitel}{
|
||||
7
paper/templates/toc.tex
Normal file
7
paper/templates/toc.tex
Normal file
@@ -0,0 +1,7 @@
|
||||
%% \clearpage <- för att börja innehållsförteckning på ny sida
|
||||
\vspace*{\fill} % <- för att börja innehållsförteckning efter dikt, om möjligt försänkt
|
||||
|
||||
%% === Innehållsförteckning ====================================================
|
||||
\tableofcontents
|
||||
\clearpage
|
||||
|
||||
21
slideshow/Makefile
Normal file
21
slideshow/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
DOCUMENT=main
|
||||
|
||||
$(DOCUMENT).pdf : $(DOCUMENT).tex
|
||||
latexmk -pdflatex="lualatex --halt-on-error --shell-escape %O %S" -pdf -dvi- -ps- "$<"
|
||||
|
||||
.PHONY : minted
|
||||
minted : minted.sty
|
||||
minted.sty :
|
||||
wget https://raw.githubusercontent.com/gpoore/minted/5219a9c8db6d8b9c1e7c3aeab892ab0f6fc74308/source/minted.sty
|
||||
|
||||
.PHONY : clean
|
||||
clean :
|
||||
rm -rf $(DOCUMENT).aux $(DOCUMENT).log $(DOCUMENT).pdf $(DOCUMENT).out $(DOCUMENT).fls $(DOCUMENT).listing $(DOCUMENT).fdb_latexmk texput.log _minted-$(DOCUMENT) svg-inkscape
|
||||
|
||||
.PHONY : run
|
||||
run :
|
||||
xdg-open $(DOCUMENT).pdf &
|
||||
|
||||
.PHONY : open
|
||||
open :
|
||||
xdg-open $(DOCUMENT).pdf &
|
||||
9
slideshow/config.sh
Executable file
9
slideshow/config.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# inställnignar för bashskriptet
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
echo "Skriv dokumentets namn utan .tex (default är main)"
|
||||
read doc_name
|
||||
|
||||
sed -i "s/DOCUMENT=main/DOCUMENT=${doc_name}/g" Makefile
|
||||
mv main.tex ${doc_name}.tex
|
||||
60
slideshow/main.tex
Normal file
60
slideshow/main.tex
Normal file
@@ -0,0 +1,60 @@
|
||||
% Latex-mall för presentationer
|
||||
|
||||
%% === PREAMBLE ===============================================================
|
||||
\documentclass[aspectratio=169, beamer, oneside, leqno]{beamer}
|
||||
% Ladda sty-fil presentation.sty
|
||||
\usepackage{presentation}
|
||||
|
||||
%% === Inställningar ==========================================================
|
||||
\newcommand{\huvudtitel}{
|
||||
Huvudtitel
|
||||
}
|
||||
\newcommand{\undertitel}{
|
||||
En undertitel
|
||||
}
|
||||
\newcommand{\forfattare}{
|
||||
Anders
|
||||
}
|
||||
\newcommand{\usetimestamp}{0} % <- sätt till 1 om datum ska visa tidsslag med
|
||||
\newcommand{\usereferences}{1} % <- sätt till 1 om referenser finns
|
||||
\definecolor{colortheme}{RGB}{144, 12, 63} % {144, 12, 63} för maroon som passar helt ok
|
||||
% Sätt titel, författare, datum, referenser
|
||||
\settitle{\huvudtitel}{\undertitel}
|
||||
\author{\forfattare}
|
||||
\setdate{\usetimestamp}
|
||||
\setreferences{\usereferences}{referenser.bib}
|
||||
|
||||
%% === TITELSIDA ==============================================================
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
%% === INNEHÅLLSFÖRTECKNING ===================================================
|
||||
%% \tableofcontents
|
||||
%% \clearpage
|
||||
\setbeamertemplate{footline}[frame number]
|
||||
|
||||
%% === KROPP ==================================================================
|
||||
\section{Exempel på avsnitt}
|
||||
|
||||
\titelslide
|
||||
|
||||
\begin{frame}
|
||||
\frametitle{\secname}
|
||||
\begin{itemize}[label=$\star$]
|
||||
\item Presentation ämnad för HW-gäng med kunskaper därefter
|
||||
\item Skrivet på min fritid, inte färdigt på långa vägar
|
||||
\item Mer intresserad? Kolla mina anteckningar och dess referenser!
|
||||
\item Syfte (och mål med denna presentation såklart)
|
||||
\begin{itemize}[label=$\wp$]
|
||||
\item Fördjupad teroetisk förståelse
|
||||
\item Specialfall
|
||||
\item Grundläggande implementation
|
||||
\item Attacker mot maskering \cite{dirac}
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
\end{frame}
|
||||
|
||||
%% === Referenser =============================================================
|
||||
\printreferencesslide{\usereferences}{Referenser}
|
||||
|
||||
\end{document}
|
||||
202
slideshow/presentation.sty
Normal file
202
slideshow/presentation.sty
Normal file
@@ -0,0 +1,202 @@
|
||||
\ProvidesPackage{presentation}[2022/10/03]
|
||||
|
||||
%% Färger
|
||||
% Titlar
|
||||
\setbeamercolor{title}{fg=colortheme}
|
||||
\setbeamercolor{frametitle}{fg=colortheme}
|
||||
|
||||
\newcommand{\titelslide}{
|
||||
\begin{frame}
|
||||
\begin{center}
|
||||
{\color{colortheme} \Huge \B{\secname} }
|
||||
\end{center}
|
||||
\end{frame}
|
||||
}
|
||||
|
||||
%% Försättsbladsgrejer, setup
|
||||
% Ställa in datum, om argumentet är 1 så visas klockslag med
|
||||
\RequirePackage{datetime}
|
||||
\renewcommand{\dateseparator}{-}
|
||||
\newcommand{\setdate}[1]{
|
||||
\newcommand{\temparg}{#1}
|
||||
\ifnum\temparg=1
|
||||
\date{\today\ (\currenttime)}
|
||||
\else
|
||||
\date{\today}
|
||||
\fi
|
||||
}
|
||||
% Ställa in titel, om andra argumentet är tomt, skippa undertitel
|
||||
\newcommand{\settitle}[2]{
|
||||
\title{
|
||||
\Huge #1 % titel
|
||||
\if\relax\detokenize{#2}\relax
|
||||
\else
|
||||
\vspace{5mm} \\
|
||||
\large #2 % undertitel
|
||||
\fi
|
||||
}
|
||||
}
|
||||
% Ställa in referensfil, om argumentet är 1 så laddas referensfilen referenser.bib
|
||||
\newcommand{\setreferences}[2]{
|
||||
\newcommand{\temparga}{#1}
|
||||
\ifnum\temparga=1
|
||||
\addbibresource{#2}
|
||||
\fi
|
||||
}
|
||||
\newcommand{\printreferencesslide}[2] {
|
||||
\newcommand{\tempargas}{#1}
|
||||
\ifnum\tempargas=1
|
||||
\begin{frame}[allowframebreaks]
|
||||
\frametitle{#2}
|
||||
\printbibliography
|
||||
\end{frame}
|
||||
\fi
|
||||
}
|
||||
|
||||
% indentering
|
||||
\setlength{\parindent}{0em}
|
||||
\setlength{\parskip}{1em}
|
||||
|
||||
%% table of contentdjup
|
||||
\setcounter{tocdepth}{4}
|
||||
\setcounter{secnumdepth}{4}
|
||||
|
||||
%% kommentera sektioner, begin -- end
|
||||
\RequirePackage{comment}
|
||||
|
||||
%% provides emulation of pdfTeX primitives for LuaTeX v0.85 needed by attachfile idk lmao
|
||||
\RequirePackage{luatex85}
|
||||
|
||||
%% Inbäddade filer
|
||||
\RequirePackage{attachfile}
|
||||
\attachfilesetup{color=0 0 0.9}
|
||||
|
||||
%% Indexering från noll
|
||||
\makeatletter
|
||||
\def\@arabic#1{\number\numexpr#1-1\relax}
|
||||
\renewcommand*{\theatfi@tmp}{\the\value{atfi@tmp}} % Workaround för att attachfile ska fungera trots omdefinieringen av arabic
|
||||
\makeatother
|
||||
|
||||
%%Förfinar typografin, bland annat med marginalkerning.
|
||||
\RequirePackage{microtype}
|
||||
\RequirePackage{fontspec}
|
||||
\setmainfont[Ligatures=TeX]{CMU Serif} % inkluderar kyriliska
|
||||
\RequirePackage{polyglossia}
|
||||
\setdefaultlanguage{swedish}
|
||||
\setotherlanguages{greek,russian}
|
||||
\newcommand{\B}[1]{\textbf{#1}}
|
||||
\newcommand{\I}[1]{\textit{#1}}
|
||||
\newcommand{\T}[1]{\texttt{#1}}
|
||||
|
||||
% språk och typsnintt
|
||||
\RequirePackage{fontspec}
|
||||
\setmainfont[Ligatures=TeX]{CMU Serif} % inkluderar kyriliska
|
||||
\RequirePackage{polyglossia}
|
||||
\setdefaultlanguage{swedish}
|
||||
\setotherlanguages{greek,russian}
|
||||
|
||||
\RequirePackage{datetime}
|
||||
\renewcommand{\dateseparator}{-}
|
||||
|
||||
\RequirePackage[inline]{enumitem}
|
||||
|
||||
%% Definiera färgnamn
|
||||
%\RequirePackage[hyperref, table, dvipsnames, svgnames, x11names]{xcolor}
|
||||
|
||||
%% Gör att mellanslag i bildfilnamn fungerar.
|
||||
\RequirePackage[space]{grffile}
|
||||
|
||||
%% Matematik
|
||||
\RequirePackage[intlimits]{mathtools}
|
||||
\RequirePackage{amsmath}
|
||||
\RequirePackage{amssymb}
|
||||
\RequirePackage{amsfonts}
|
||||
\RequirePackage{mathrsfs}
|
||||
% \RequirePackage{unicode-math} %% inaktiverad för den ger fula symboler
|
||||
|
||||
%% Matematiska genvägar
|
||||
\newcommand{\Rho}{\mathrm{P}}
|
||||
\newcommand{\Binary}{\mathbb{B}}
|
||||
\newcommand{\Natural}{\mathbb{N}}
|
||||
\newcommand{\Integer}{\mathbb{Z}}
|
||||
\newcommand{\Rational}{\mathbb{Q}}
|
||||
\newcommand{\Real}{\mathbb{R}}
|
||||
\newcommand{\Complex}{\mathbb{C}}
|
||||
\newcommand{\Hilbert}{\mathcal{H}}
|
||||
\newcommand{\Hamilton}{\mathscr{H}}
|
||||
\newcommand{\Lagrange}{\mathscr{L}}
|
||||
\newcommand{\Galois}{\text{GF}}
|
||||
\newcommand{\paren}[1]{\left( #1 \right)}
|
||||
\newcommand{\hakparen}[1]{\left[ #1 \right]}
|
||||
\newcommand{\krullparen}[1]{\left\{ #1 \right\}}
|
||||
|
||||
|
||||
%% Gör hänvisningar inom dokumentet till länkar. Generera disposition.
|
||||
\RequirePackage{hyperref}
|
||||
|
||||
%% Enheter
|
||||
\RequirePackage{siunitx}
|
||||
\sisetup{
|
||||
output-decimal-marker = {,},
|
||||
per-mode = symbol-or-fraction,
|
||||
inter-unit-product = \ensuremath{\cdot},
|
||||
exponent-product = \ensuremath{\cdot}
|
||||
}
|
||||
|
||||
%% referenser
|
||||
\RequirePackage[
|
||||
backend=biber,
|
||||
style=alphabetic, % numeric om man inte vill ha
|
||||
sorting=none % none sorterar i ordningen de citerades
|
||||
]{biblatex}
|
||||
|
||||
%% ändrar fotnötter
|
||||
\RequirePackage[perpage]{footmisc}
|
||||
|
||||
\makeatletter
|
||||
\newcommand*{\myfnsymbolsingle}[1]{%
|
||||
\ensuremath{%
|
||||
\ifcase#1% 0
|
||||
\or % 1
|
||||
\dagger%
|
||||
\or % 2
|
||||
\sharp
|
||||
\or % 3
|
||||
\flat
|
||||
\or % 4
|
||||
\star
|
||||
\or % 5
|
||||
\ddagger
|
||||
\or % 6
|
||||
\wp
|
||||
\or % 7
|
||||
\top
|
||||
\or % 8
|
||||
\bot
|
||||
\else % >= 9
|
||||
\@ctrerr
|
||||
\fi
|
||||
}%
|
||||
}
|
||||
\makeatother
|
||||
|
||||
\newcommand*{\myfnsymbol}[1]{%
|
||||
\myfnsymbolsingle{\value{#1}}%
|
||||
}
|
||||
|
||||
% Remove upper boundary by multiplying the symbols if needed
|
||||
\RequirePackage{alphalph}
|
||||
\newalphalph{\myfnsymbolmult}[mult]{\myfnsymbolsingle}{}
|
||||
|
||||
\renewcommand*{\thefootnote}{%
|
||||
\myfnsymbolmult{\value{footnote}}%
|
||||
}
|
||||
|
||||
%% Kodlistningar
|
||||
\RequirePackage{listings}
|
||||
|
||||
|
||||
|
||||
\usefonttheme{serif}
|
||||
|
||||
\endinput % måste stå i avslutning av paket
|
||||
10
slideshow/referenser.bib
Normal file
10
slideshow/referenser.bib
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
@book{dirac,
|
||||
title = {The Principles of Quantum Mechanics},
|
||||
author = {Paul Adrien Maurice Dirac},
|
||||
isbn = {9780198520115},
|
||||
series = {International series of monographs on physics},
|
||||
year = {1981},
|
||||
publisher = {Clarendon Press},
|
||||
keywords = {physics}
|
||||
}
|
||||
Reference in New Issue
Block a user