Forum Replies Created
-
AuthorPosts
-
Qing Youguo
ParticipantHi Cardoso,
In-TeX/LaTeX is a JavaScript tool to compile LaTeX code to PDF in InDesign, it can run under both macOS and Windows.
Download form: https://github.com/cooldtp/InTeXLaTeX
Demo:
And more:
The English version is not available yet, but it’s So easy to follow by demos.October 12, 2019 at 6:46 am in reply to: Create a table with specific number of row and column with JavaScript #14323932Qing Youguo
ParticipantSelect a textframe or a insertionpoint, and run it:
// Create a tbale whith specific number of row and column
if(app.documents.length !== 0 && app.selection[0].hasOwnProperty(“insertionPoints”)){
app.selection[0].tables.add(LocationOptions.AFTER, app.selection[0].insertionPoints[0], {
bodyRowCount: 8,
columnCount: 6,
footerRowCount: 0,
headerRowCount: 1
})
}Qing Youguo
ParticipantHi Masood,
Change the following conde line:
var allRtg = myObject.rectangles.everyItem().getElements();
to:
var allRtg = myObject.parentStory.rectangles.everyItem().getElements();
is what you want?
By the way, Inline Images’s parent —— theRtg DOESN’T haved “theRtg.fit(Justification.CENTER_ALIGN)” such a method, and the selected texfframe’s story !== all the stories in the document, maybe one or a few stories in the selected texfframes indeed! So, it’s a better way to do it: loop all the strories in the document, and loop all the Rectangles that containing images in each story.
You must telling the whole details before asking question.
September 30, 2019 at 11:11 am in reply to: Image Fitting options on Anchored Graphic Frames #14324010Qing Youguo
ParticipantTry this:
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, “Image Fitting Script”);
function main() {
// Capture the current selections in array
var mySelections = app.selection;
for (var i = 0; i < mySelections.length; i++) {
var myObject = mySelections[i];
if (myObject instanceof TextFrame) {
var allRtg = myObject.rectangles.everyItem().getElements();
for (var j = 0; j < allRtg.length; j++) {
var theRtg = allRtg[j];
try {
theRtg.fit(FitOptions.contentToFrame);
theRtg.fit(FitOptions.proportionally);
theRtg.fit(FitOptions.centerContent);
theRtg.fit(FitOptions.frameToContent);
} catch (e) {}
}
}
}
}Qing Youguo
ParticipantHi all,
If you are doing math inside InDesign For Mac, you can try InTeXLaTeX. Install MacTeX2018 & InTeXLaTeX, and run InTeXLaTeX_3.0.jsx, just doing LaTeX math inside InDesign if you learn a liitle about LaTeX. Sorry it’s only for chinese version, English version is not available yet.
-
AuthorPosts
