Package writer2latex.latex.util
Class BeforeAfter
java.lang.Object
writer2latex.latex.util.BeforeAfter
Utility class to hold LaTeX code to put before/after other LaTeX code
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor: Create with empty stringsBeforeAfter
(String sBefore1, String sAfter1) Constructor to initialize the object with a pair of strings -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add data to theBeforeAfter
void
add
(BeforeAfter ba) Add the content of anotherBeforeAfter
to thisBeforeAfter
void
Add data to theBeforeAfter
getAfter()
Get LaTeX code to put afterGet LaTeX code to put beforeboolean
isEmpty()
Check if thisBeforeAfter
contains any data
-
Constructor Details
-
BeforeAfter
Constructor to initialize the object with a pair of strings- Parameters:
sBefore1
- LaTeX code to put beforesAfter1
- LaTeX code to put after
-
BeforeAfter
public BeforeAfter()Default constructor: Create with empty strings
-
-
Method Details
-
add
Add data to the
BeforeAfter
The new data will be be added "inside", thus for example
add("\textsf{","}");
add("\textit{","}");
will create the pair
\textsf{\textit{
,}}
- Parameters:
sBefore1
- LaTeX code to put beforesAfter1
- LaTeX code to put after
-
enclose
Add data to the
BeforeAfter
The new data will be be added "outside", thus for example
enclose("\textsf{","}");
enclose("\textit{","}");
will create the pair
\textit{\textsf{
,}}
- Parameters:
sBefore1
- LaTeX code to put beforesAfter1
- LaTeX code to put after
-
add
Add the content of another
BeforeAfter
to thisBeforeAfter
The new data will be be added "inside"
- Parameters:
ba
- the code to add
-
getBefore
Get LaTeX code to put before- Returns:
- then LaTeX code
-
getAfter
Get LaTeX code to put after- Returns:
- then LaTeX code
-
isEmpty
public boolean isEmpty()Check if thisBeforeAfter
contains any data- Returns:
- true if there is data in at least one part
-