If I use the folowing syntax,
#+ATTR_HTML: width="200"
[[file:highres.jpg][file:highres.jpg]]
I should expect that the page would display highres.jpg in the specified size, and when clicked on, would like to the file itself? Which is what I get from these instructions. However, when I generate the html from an org-mode file, the image is displayed but not linked/clickable. Am I doing something wrong or have I misunderstood?
In more recent versions of org-mode, the format seems to have changed. The following works for me in Emacs 24.4.1:
#+ATTR_HTML: :width 200
[[file:highres.jpg]]
In your example it is treating it as being without description because the description is identical to the link itself. The instructions you link to say to use a generated thumbnail for the description (which will be displayed instead of the full image).
On the other hand, I wasn't able to get it to respect #+ATTR_HTML: width="200" when I did change the description text to allow for a difference
#+ATTR_HTML: width="200"
[[file:highres.jpg][./highres.jpg]]
Instead the inlined clickable image was full-size. I don't know if this is intended or not, the best place to ask that would likely be the mailing list (where they may also be able to fix it if it is a bug).
Added Testing of issue
Using the following Org snippet
* SVG test
#+CAPTION: Test
#+ATTR_HTML: width="200" title="Hello"
[[./img/Bitmap.svg][file:./img/Bitmap.svg]]
#+Caption: Test2
#+ATTR_HTML: width="200" title="Hello as well"
[[./Bitmap.svg]]
I get the following HTML, which does explain why the strange result with regards to image sizes occurs:
<p>
<img src="./img/Bitmap.svg" alt="Bitmap.svg"/>
</p>
<div class="figure">
<p><img src="./Bitmap.svg" width="200" title="Hello as well" alt="./Bitmap.svg" /></p>
<p>Test2</p>
</div>
The initial image is being adjusted in size, instead of the link image. Definitely a question of how the exporter interprets the #+ATTRL_HTML information. Under the current exporter the best choice might well be to generate a thumbnail of the image for insertion.
Related
I'm looking for a setting or extension in VSCode that provides the following functionality:
Format on save
wrap html attributes on their own line, even if there is only one attribute
put closing symbol of opening tag on new line, aligned with tag
alphabetically order attributes
do not align attributes according to the position of the first attribute, simple use one level of indentation
Example 1:
<span my-attr="value">Hello, world!</span>
becomes
<span
my-attr="value"
>
Hello, world!
</span>
Example 2:
<x-status-indicator wire:click="pushMe" class="block" :status="$status"
:description="$description" />
then becomes
<x-status-indicator
:description="$description"
:status="$status"
class="block"
wire:click="pushMe"
/>
So far there have been many posts about formatting, but I could not find a single post or extension that satisfies these requirements. Any suggestions would be greatly appreciated, thank you! :)
I'm using VS Code, and Prettier and cannot get it to format the way I want it to be upon saving.
If I have a line like
<input type="checkbox" /> Label<br />
upon format/save, it becomes
<input type="checkbox" />
Label
<br />
I don't want to turn off Format on Save since I want to be able to Format Document from time-to-time. Is there a setting to get the line breaks how I want them? I'd prefer it only wrap on line length and other wanted places (e.g. select and option tags on different lines)
Note: this is just a simplified example. There are many other cases where it's putting every tag on a separate line when I'd like them to stay on one.
You need to update your .prettierrc file in your root to have
"printWidth": 1000
or whatever print width you are looking to have and it should fix this. Also check out the Prettier docs at https://prettier.io/docs/en/configuration.html to see other items you can configure.
Environment:
emacs 24.3 (9) for os x with org-mode version: 8.2.1.21
I used org-mode to convert org files with tables into html tables format. However, the html files always include the following snippets whenever a table exists:
<colgroup>
<col class="left" />
<col class="right" />
<col class="right" />
</colgroup>
I have tried several ways to eliminate that snippet output but those tags just won't go way; some include
M-x customize-variable
1. org-html-*
2. org-export-table-*
3. org-export-html-*
4. org-table-*
I can see that snippet may be generated by ox-html.el but I cannot nil that action.
I just want to have plain HTML tables exported from my org files. Nothings else. No extra default attribute, no other default HTML tags, no css, etc. How can I achieve that?
There's currently no customization options to remove <colgroup>.
But you can do this if you know that you don't want them at all:
(defun org-export-table-cell-starts-colgroup-p (table-cell info))
(defun org-export-table-cell-ends-colgroup-p (table-cell info))
I wanted to have a block of text aligned to the right, which takes up less horizontal space then the rest of the text on that page. How'd I go about it?
The problem with it being completed in literal HTML is that org-mode automatically puts any text outside the sections into a <p> tag (and it is not a block element, so floating inside of it isn't generally a good thing etc.)
Here's how I have it now (and it displays fine, so I'd like it to be more or less like that):
#+BEGIN_HTML
<div style="width:100%;height:84pt">
<p class="epigraph">
<em>
I have not increased nor diminished the measure,<br/>
I have not diminished the palm,<br/>
I have not encroached upon fields,<br/>
I have not added to the balance weights,<br/>
I have not tempered with the plumb bob of the balance.</em>
<br/>
<span style="text-align:right;width:100%;display:block">
<b style="line-height:24pt;font-weight:bold">
The Book of the Dead, Spell 125.</b>
</span>
</p></div>
#+END_HTML
Plus I have this CSS:
.epigraph {
float:right;
font-size:10pt;
font-family:serif;
line-height:12pt;
color: #aaa
}
But I'd rather it be automatic...
OK, I think I found something that worked similar enough to what I wanted:
#+BEGIN_VERSE
I have not increased nor diminished the measure,
I have not diminished the palm,
I have not encroached upon fields,
I have not added to the balance weights,
I have not tempered with the plumb bob of the balance.
-- The Book of the Dead, Spell 125.
#+END_VERSE
This generates HTML that later with some use of CSS is possible to format in the way it would look more or less like an epigraph. Not perfect, but will do.
I've a problem with typo3 snowbabel extension. I need to insert a line break in frontend. In the manual, specified that "if you want to have a line break visible in front end, you'll have to insert the HTML line break tag.
I've added it. But the html br tag displayed in frontend.Also the line break is not working.
Is there any configurations for this?
Thanks,
Arun Chandran
This is just a handy quick solution to the problem.
You can use <section> tags instead of "<br/>" tags. Even though their purpose might be different, it still gives the output.
OR
Just use <br></br> instead of </br>. Works fine.