TEXオプションの他の管理| Java
インタラクションモードを設定する方法
ここ、JavaのAspose.TeXを述べたように、エンジンが起動する初期インタラクションモードを設定できます。これが私たちのやり方です:
1// Create conversion options instance.
2...
3// Set the interaction mode.
4options.setInteraction(Interaction.NonstopMode);
求人名を設定する方法
メイン入力ファイルをファイル名として渡すと、他の拡張機能ではありますが、同じ名前の出力ファイルが取得されます。 TEXエンジンは、入力ファイルの名前を *ジョブ名 *を呼び出し、出力ファイルに使用します。メイン入力ファイルを ストリームとして渡すと、Texエンジンはデフォルトのジョブ名、つまり texputを使用します。 どちらの場合も、適切な変換オプションを割り当てることにより、ジョブ名をオーバーライドできます。
1// Create conversion options instance.
2...
3// Set the job name.
4options.setJobName("my-job-name");
「時間を止める」方法
LaTexには、Preambleのいくつかの定義からタイトルを自動的に生成する機能があります。このタイトルには通常、現在の日付が含まれています。ある程度の希望の価値で日付を凍結することをお勧めします。これがどのように行われるかは次のとおりです。
1// Create conversion options instance.
2...
3// Force the TeX engine to output the specified date in the title.
4options.setDateTime(new GregorianCalendar(2022, Calendar.DECEMBER, 18).getTime());
欠落しているパッケージを無視する方法
.NETライブラリのAspose.TeXによってサポートされていないいくつかのパッケージを参照するラテックスファイルを変換する場合があります。この場合、そのようなパッケージをロードしようとすると、Texエンジンはエラーで停止します。これを避けるために、次のオプションを使用できます。
1// Create conversion options instance.
2...
3// Set to true to make the engine skip missing packages (when your file references one) without errors.
4options.ignoreMissingPackages(true);
結晶の構築を避ける方法
通常、TEXエンジンは、フォントが必要なデータを提供する場合、特定のペアの文字の連結を構築します。次のコードを使用して、エンジンにligatureビルをスキップするように指示できます。
1// Create conversion options instance.
2...
3// Set to true to make the engine not construct ligatures where normally it would.
4options.noLigatures(true);
仕事を繰り返す方法
ラベルと参照に関して 上記に述べたように、同じジョブを2回実行したい場合があります。これがどのように行われるかは次のとおりです。
1// Create conversion options instance.
2...
3// Ask the engine to repeat the job.
4options.repeat(true);
数式を回す方法画像をラスターする方法
時には、フォントに入力するのではなく、ラスター画像として数学式が必要になる場合があります。次のオプションは、この目的のために役立つことができます。
1// Create conversion options instance.
2...
3// Create and assign saving options instance if needed.
4...
5// Set to true if you want math formulas to be converted to raster images.
6options.getSaveOptions().rasterizeFormulas(true);
グラフィックを回して画像をラスターする方法
ObjectTexエンジンを使用すると、Raster形式(PNGおよびJPG)、PS(EPS)およびXPS(OXPS)形式のグラフィックファイルを含めることができます。最後の2つの形式には、通常、ベクトル要素とテキストが含まれています。それらをラスター化して固体画像として含めるために、次のオプションを使用できます。
1// Create conversion options instance.
2...
3// Create and assign saving options instance if needed.
4...
5// Set to true if you want included graphics (if it contains vector elements) to be converted to raster images.
6options.getSaveOptions().rasterizeIncludedGraphics(true);
サブセットフォントの方法
出力ファイルのサイズを縮小する場合は、フォントサブセットに頼ることができます。つまり、出力ドキュメントのフォントには、ドキュメントで使用されているグリフに関するデータのみが含まれます。これを解決する方法は次のとおりです。
1// Create conversion options instance.
2...
3// Create and assign saving options instance if needed.
4...
5// Set to true to make the device subset fonts used in the document.
6options.getSaveOptions().subsetFonts(true);