How can I define the engine XeLaTex through Overleaf API? - api

According to the official documentation, 'By default, Overleaf tries to detect which TeX engine to use, and it usually chooses pdflatex. If you would like to set the engine explicitly for your new project, you can pass an engine parameter with one of the following values: latex_dvipdf, pdflatex, xelatex or lualatex.'. My project has to be compiled with xelatex.
So, considering the given official MWE:
<form action="https://www.overleaf.com/docs" method="post" target="_blank">
<input type="text" name="snip_uri"
value="https://production-overleaf-static.s3.amazonaws.com/examples/helloworld.tex"><br>
<input type="submit" value="Open in Overleaf">
</form>
where/how do I set the engine parameter to xelatex through the API (and not by the overleaf menu settings)?
I have tried changing the first line of main.tex to %!TeX program = xelatex, but had no success.

Thanks to the Overleaf support, the solution is just adding <input type="hidden" name="engine" value="xelatex"> inside the <form>. Now the Overleaf editor/preview open directly in XeLaTex when the form is submitted.

Related

Is it possible to set folder path for input type IFormFile

I am currently working on a CMS web application. To select images i am using the following code. The input type is IFormFile(BigImage is of type IFormFile)
<div class="input-group input-group-sm mb-2 custom-file-button">
<label class="input-group-text" for="inputGroupFile">GroßesBild</label>
<input class="form-control" form="addUpdateSubmenu" asp-for="BigImage" id="inputGroupFile">
</div>
Now my question is if it is possible to set a default folder path like: "\abc33\images\bilder"
Now it is just opening any folder which was used the latest.
So if i would select an image the directory would look like shown on this screenshot
There is no concept of folder selection in the HTML/JavaScript platform. Even if you could select one, you wouldn't be able to do anything with the folder path. Web applications do not have access to a client's file system.
Here is a similar issue, You can refer to it.
Browsers don't allow you to modify deafault file path(value)of<input type="file"/> due to security issue,the value only changes when you select a file yourself

How to make a Input field in AEM/CRX required?

since our AEM guy is out of office at the moment, i need to fix something in our CRX. I have a form with a checkbox in my website, where authors can set a text next to it. Now i am trying to add the functionality to set this checkbox to be required from the authoring dialog.
I was able to find a textfield which has this property in authoring, but in the html in CRX i only see the code required=${required}, where other fields like label are shown like ${properties.label} and have a corresponding node in CRX. I don't understand how the required is implemented and need help here.
I already tried to add required=${required} to my checkbox input markup, but this did not work, since in the authoring dialog there still was no checkbox/switch to make the field required (which was kinda expected).
this is the line in the markup which should be required if the author sets it to required in the authoring dialog:
<input required="${required}" type="checkbox" name="campaignform-termsofservice"/>
this is the whole html of the checkbox i want to be able to make required:
<div data-sly-test="${!empty}" class="form__text">
<label class="maut-checkbox--container">
<input required="${required}" type="checkbox" name="campaignform-termsofservice"/>
<span class="maut-checkbox--checkmark"></span>
<span>${properties.checkboxtext #context='html'}</span>
<div>${properties.tncText}</div>
<div style="color:white;" class="authoring-error" data-sly-test="${wcmmode.edit && !tncDate.tncLinkActivationDate}">${'b2x.maut.campaignform.dialog.tos.activationmessage' # i18n, source='user'}</div>
<input type="hidden" name="maut.field.tnc" value="${tncDate.tncLinkActivationDate}" />
</label>
</div>
Now i only need to figure out how i can show the option to set it to required in the authoring dialog.
Thanks in advance
If you want to know how the required=${required} is implemented then first of all in html of the component look for something like data-sly-use.required. This will have a expression like =com.project.yourProject.className or some js file.
Lets discuss about the java case which is the most common way. What data-sly-use does is that it creates an object of the class that you gave in the expression. In your case your object is required. Then you need to check the java class that the expression evaluates to. Commonly all the backend logic code will be their and if some manipulations or validations are required to be done with the data that the author enters in the dialog will be their. This class will also contain annotations that maps the class variables with the property value of the dialog.
Hope this explains from where this ${required} came from. It will be more clear to you if you look into the java class that is referred to by the data-sly-use expression.

why use asp-controller and asp-action if it is not compulsory

#model Task3.Models.NewUser
<form action="" method="post">
<label>first Name </label>
<input type="text" placeholder="enter name" name="firstName"/>
<input type="text" placeholder="enter last name" name="lastName"/>
<button type="submit">Submit</button>
</form>
This code works even without asp-controller and asp-action. Why should I use those then?
The tag helpers asp-controller and asp-action can be used to automatically generate a target URL but you don’t have to use them. All they do is automatically generate the href attribute for links and action attributes for forms. If you want to fill in thos values manually, there is nothing that’s stopping you from doing that.
However, using the tag helpers has a clear benefit: The actual URL that you have to use depends on various things that affect your application’s routing. So if you use manual values, you have to take that into account. And if your routing changes (for whatever reason), you have to manually update the URLs throughout your templates.
By using the tag helpers, you are attaching the target location to something that is usually rather static: A controller action. So that way, you decouple the template from your routing configuration.
One more note for form actions specifically: If you do not specify a form action, the browser will automatically post to the current URL. So if you have a POST handler on the same route as the form, then you can totally omit the action and depend on that behavior.

Issues detecting textboxes that get generated via a template

I am trying to record UI tests for an Aurelia App. I am using Telerik Test Studio and it has issues detecting the textboxes that get generated via a template.
If I use straight HTML in the template e.g.
<input type="text" name="firstname">
That is easily detected and recorded and playback of the test can enter info into that field
In a template if I have textboxes resembling
<textbox name="patientLastName" size="small" editing.bind="editing" if.bind="!demographics.lastName.hidden" required.bind="demographics.lastName.required" label.bind="demographics.lastName.name" value.bind="patient.details.lastName"></textbox>
The template works but I get html resembling
<input class="form-control au-target" type="text" value.bind="value" disabled.bind="!editing" au-target-id="143">
This doesn't appear to be outputting any html attributes/properties that Test Studio can latch onto. How would I alter a textbox so that it is detectable by Test Studio?
Could it be that Telerik Test Studio inspects the page too early and that it cannot find elements that are dynamically added? Replace if.bind by show.bind to see if it works.

Semantic markups to index PDF files

What is the proper way to index PDF files ? I would like to add semantic information in them, and help search engines present the files more accurately, more precisely (a particular image, text inside the PDF file). I am thinking about using ontologies that engines already understand like Schema.org.
How about using schema.org to link to the PDF file from a web page like this:
<div itemscope itemtype="http://schema.org/Article">
<img itemprop="thumbnailUrl" src="http://www.example.com/how_to_build_a_web_app.jpg"/>
<a itemprop="url" href="http://www.example.com/how_to_build_a_web_app.pdf">
<span itemprop="name">How to Build a Web App</span></a>
by <span itemprop="author">John Smith</span>
<div itemprop="description">This short e-book explains what a web application
is and how to build one.</div>
</div>
This lets you associate a title, image and textual description with the article in the PDF.