-
Notifications
You must be signed in to change notification settings - Fork 1
Home
searleser97 edited this page Jun 22, 2020
·
2 revisions
mkcpr
is a command line utility written in python that helps you to build your Competitive Programming Reference in PDF.
This command will generate a LaTex formatted file, which will be ready to be compiled into your new Competitive Programming Reference, using any online or local LaTex compiler of your preference.
- In your working directory run:
mkcpr [-c|-h]
Notes:
- The configuration file
mkcpr-config.json
should be in the same working directory. (Same path where you runmkcpr
). -
-c
flag creates a new configuration filemkcpr-config.json
in the current directory. -
-h
displays help.
- python 3.5+
- Online or local LaTex compiler
- Folder containing your codes for programming competitions
- LaTex template (you can use the one provided in this repository
Example/Template.tex
) - Configuration File
mkcpr-config.json
(described below)
- Run:
pip install mkcpr --user
- Copy the LaTex template
Template.tex
located in theExample
folder of this repository to your working directory. - In your working directory run
mkcpr -c
to create a new configuration filemkcpr-config.json
. - Update
mkcpr-config.json
andTemplate.tex
according to your needs. See the Configuration file options section for reference. - You are now ready to run
mkcpr
in your working directory.
{
"code_folder": "/home/san/Projects/mkcpr/Example/CodeFolder", // Path to your actual code for reference
"template_path": "/home/san/Projects/mkcpr/Example/Template.tex", // LaTex template path
"output_file_path": "/home/san/Projects/mkcpr/Example/Output.tex", // path where you want the generated LaTex code to be
"excluded": ["__pycache__", ".vscode"], // folders not to consider
"columns": 2, // number of columns in your reference
"template_placeholder": "CODE HERE", // text to replace in your template
"sort_before": ["Data Structures"], // files or folders will appear first
"sort_after": ["Extras"], // file or folders will appear at the end
"enable_newpage_for_section": false // if true each section will appear in a new page.
}
- One single command and your reference will be ready to compile
- Build it with your own style
- support for most file extensions. (.cpp, .py, .java, .tex, .sh, ...)
- Build your reference just from your competitive programming code folder.
Folder Structure | Table Of Contents |
---|---|
- Forget about undesired line breaks by specifying the lines of code you want together in the same page with a single comment before your lines of code.
You can see an example of how a working directory would look like in a real Competitive Progamming Reference HERE
- Display error when detecting the use of titlesec, suggest secsty for title styles.
- Add space optimization option
mkcpr
is licensed under the GNU General Public License v3.0