Latex Poker Package
Latex Package Poker, monaco club poker chips review, casino kranjska gora jackpot, roulette vba-40x. 18+, T&C Apply, New Customers Only. Best Minimum Bets. Please read them and the README file before using the latex poker package. I hope it works for you as smoothly as for me. If anyone has the skills and interest to transform this poker package into the.dtx/.ins format I would be very pleased. Since the original author of the face card images (K,Q,J) preferred to. We can use permutations and combinations to help us answer more complex probability questions. A 4 digit PIN is selected. What is the probability that there are no repeated digits?
Sometimes the best option to use your own commands and macros in a document is to write a new package from scratch. This article explains the main structure of a new package.
- 2General structure
Introduction
The first thing to do before coding a new package is to determine whether you really need a new package or not. It's recommended to search on CTAN (Comprehensive TeX Archive Network) and see if someone already created something similar to what you need.

Another important thing to have in mind is the difference between packages and classes. Making the wrong choice can affect the flexibility of the final product.
General structure
The structure of all package files can be roughly described in the next four parts:
- Identification. The file declares itself as a package written with the LaTeX2ε syntax.
- Preliminary declarations. Here the external packages needed are imported. Also, in this part of the file the commands and definitions needed by the declared options are coded.
- Options. The package declares and processes the options.
- More declarations. The main body of the package. Almost everything a package does is defined here.
In the next subsections a more detailed description of the structure and a working example, examplepackage.sty, will be presented.

Identification
There are two simple commands that all packages must have:
The command NeedsTeXFormat{LaTeX2e}
sets the LaTeX version for the package to work. Additionally, a date can be added within brackets to specify the minimal release date required.
The command ProvidesPackage{examplepackage}[...]
identifies this package as examplepackage and, inside the brackets, the release date and some additional information is included. The date should be in the form YYYY/MM/DD
Preliminary declarations
Most of the packages extend and customize existing ones, and also need some external packages to work. Below, some more code is added to the sample package 'examplepackage.sty'.
The commands in this part either initialize some parameters that latter will be used to manage the options, or import external files.
The command RequirePackage
is very similar to the well-known usepackage
, adding optional parameters within brackets will also work. The only difference is that the usepackage
can not be used before documentclass
command. It's strongly recommended to use RequirePackage
when writing new packages or classes.
Latex Poker Package
Options
To allow some flexibility in the packages a few additional options are very useful. The next part in the file 'examplepackage.sty' handles the parameters passed to the package-importing statement.
Below a description of the main commands that can handle the options passed to the package.
The command DeclareOption{}{}
handles a given option. It takes two parameters, the first one is the name of the option and the second one is the code to execute if the option is passed.
The command OptionNotUsed
will print a message in the compiler and the logs, the option won't be used.
The command Declareoption*{}
handles every option not explicitly defined. It takes only one parameter, the code to execute when an unknown option is passed. In this case it will print a warning by means of the next command:
PackageWarning{}{}
. See handling errors for a description about what this command does.
CurrentOption
stores the name of the package option being handled at a determined moment.
The command ProcessOptionsrelax
executes the code fore each option and must be inserted after all the option-handling commands were typed. There's a starred version of this command that will execute the options in the exact order specified by the calling commands.
In the example, if the options red or blue are passed to the usepackage
command within the document, the command wordcolor
is redefined. Both colours and the default grey colour were defined in the preliminary declarations after importing the xcolor package.
More declarations
In this part most of the commands will appear. In 'examplepackage.sty'. Below you can see the full package file.
This package defines the new environment example
, and a new command important
, that prints the words in a special colour and adds them to the index.
To fully understand each command see the reference guide and the links in the further reading section.

Below, a document that uses the package examplepackage.sty.
Notice the command
Handling errors
When it comes to develop new packages it's important to handle possible errors to let know the user that something went wrong. There are four main commands to report errors in the compiler.
PackageError{package-name}{error-text}{help-text}
. Takes three parameters, each one inside braces: the package name, the error text which is going to be displayed (the compilation process will be paused), and the help text that will be printed if the user press 'h' when the compilation pauses because of the error.PackageWarning{package-name}{warning-text}
. In this case the text is displayed but the compilation process won't stop. It will show the line number where the warning occurred.PackageWarningNoLine{package-name}{warning-text}
. Works just like the previous command, but it won't show the line where the warning occurred.PackageInfo{package-name}{info-text}
. In this case the information in the second parameter will only be printed in the transcript file, including the line number.
Latex Poker Package Templates
Reference guide
List of commands commonly used in packages and classes
newcommand{name}{definition}
. Defines a new command, the first parameter is the name of the new command, the second parameter is what the command will do.renewcommand{}{}
. The same asnewcommand
but will overite an existing command.providecommand{}{}
. Works just asnewcommand
but if the command is already defined this one will be silently ignored.CheckCommand{}{}
. The syntax is the same asnewcommand
, but instead it will check whether the command exists and has the expected definition, LaTeX will show a warning if the command is now whatCheckCommand
expected.setlength{}{}
. Sets the length of the element passed as first parameter to the value written as second parameter.mbox{}
. Creates a box that contains the elements written inside the braces.fbox{}
. The same asmbox
, but a box is actually printed around the contents.
Further reading
For more information see
Latex Poker Package Ideas
- Commands and Environments