本文整理汇总了Java中de.vandermeer.translation.targets.Text2Latex类的典型用法代码示例。如果您正苦于以下问题:Java Text2Latex类的具体用法?Java Text2Latex怎么用?Java Text2Latex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Text2Latex类属于de.vandermeer.translation.targets包,在下文中一共展示了Text2Latex类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showOutput
import de.vandermeer.translation.targets.Text2Latex; //导入依赖的package包/类
@Override
public void showOutput(){
// tag::example[]
AP_Context ctx = new AP_Context();
ctx.setAlignment(TextAlignment.LEFT);
AsciiParagraph ap = new AsciiParagraph(ctx);
ap.addText("A sentence with some normal text, not specific to LaTeX.");
ap.addText("Now for some characters that require conversion: # % &.");
ap.addText("And some more: © § ¤.");
ap.addText("And even more: È É Ê Ë.");
ap.addText("And some arrows as well: ← ↑ → ↓ ↔");
System.out.println(ap.render(35));
ctx.setTargetTranslator(new Text2Latex());
System.out.println(ap.render(35));
// end::example[]
}
示例2: latex
import de.vandermeer.translation.targets.Text2Latex; //导入依赖的package包/类
/**
* A theme for LaTeX target.
* @return the theme
*/
static DescriptionListTheme latex(){
return new DescriptionListTheme() {
@Override
public void apply(DescriptionListContext ctx) {
ctx.setTargetTranslator(new Text2Latex());
ctx.setListStart("\\begin{description}");
ctx.setListEnd("\\end{description}");
ctx.setLeftLabelString("\\item[");
ctx.setRightLabelString("]");
ctx.setItemMargin(4);
ctx.setLabelRightMargin(0);
ctx.setTextLeftMargin(1);
ctx.setAlignment(TextAlignment.LEFT);
ctx.setUseSameLine(true);
}
};
}
示例3: latex
import de.vandermeer.translation.targets.Text2Latex; //导入依赖的package包/类
/**
* A theme for LaTeX target.
* @return the theme
*/
static ItemizeListTheme latex(){
return new ItemizeListTheme() {
@Override
public void apply(ItemizeListContext ctx) {
ctx.setTargetTranslator(new Text2Latex());
ctx.setListStart("\\begin{itemize}");
ctx.setListEnd("\\end{itemize}");
ctx.setStyle(A7_ItemizeLists.allBlank());
ctx.setLeftLabelString("\\item");
ctx.setItemMargin(4);
ctx.setLabelRightMargin(0);
ctx.setTextLeftMargin(0);
}
};
}
示例4: latex
import de.vandermeer.translation.targets.Text2Latex; //导入依赖的package包/类
/**
* A theme for LaTeX target.
* @return the theme
*/
static EnumerateListTheme latex(){
return new EnumerateListTheme() {
@Override
public void apply(EnumerateListContext ctx) {
ctx.setTargetTranslator(new Text2Latex());
ctx.setListStart("\\begin{enumerate}");
ctx.setListEnd("\\end{enumerate}");
ctx.setStyle(A7_EnumerateLists.blank());
ctx.setLeftLabelString("\\item");
ctx.setItemMargin(4);
ctx.setLabelRightMargin(0);
ctx.setTextLeftMargin(0);
ctx.setSeparatorAfterLastNumber(false);
}
};
}
示例5: showOutput
import de.vandermeer.translation.targets.Text2Latex; //导入依赖的package包/类
@Override
public void showOutput(){
// tag::example[]
String text = "A sentence with some normal text, not specific to LaTeX. " +
"Now for some characters that require conversion: # % &. " +
"And some more: © § ¤. " +
"And even more: È É Ê Ë. " +
"And some arrows as well: ← ↑ → ↓ ↔"
;
AsciiTable at = new AsciiTable();
at.addRule();
at.addRow(text, text).getCells().get(1).getContext().setTargetTranslator(new Text2Latex());
at.addRule();
at.setTextAlignment(TextAlignment.LEFT);
System.out.println(at.render());
// end::example[]
}
示例6: latex
import de.vandermeer.translation.targets.Text2Latex; //导入依赖的package包/类
/**
* A theme for LaTeX target, setting the translator.
* @return the theme
*/
static AsciiParagraphTheme latex(){
return new AsciiParagraphTheme() {
@Override
public void apply(AP_Context ctx) {
ctx.setTargetTranslator(new Text2Latex());
}
};
}
示例7: latex
import de.vandermeer.translation.targets.Text2Latex; //导入依赖的package包/类
/**
* A theme for LaTeX target, setting the translator.
* @return the theme
*/
static AsciiTableTheme latex(){
return new AsciiTableTheme() {
@Override
public void apply(AsciiTable table) {
table.setTargetTranslator(new Text2Latex());
}
};
}