Hi everybody I'm developing a CRUD system for a back-end webapp, I've installed tinymce and in the edit page I put the script for it.
<script type="text/javascript">
// Initialize your tinyMCE Editor with your preferred options
tinymce.init({
selector: 'textarea',
height: 200,
theme: 'modern',
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern help',
toolbar1: 'formatselect | bold underline italic strikethrough | backcolor forecolor | fontselect | fontsizeselect | alignleft aligncenter alignright alignjustify | table ',
toolbar2: 'numlist bullist | outdent indent | removeformat | subscript superscript | link unlink',
fontsize_formats: '7px 8px 9px 10px 11px 12px 13px 14px 15px 16px 17px 18px 19px 20px 21px 22px 23px 24px 25px 26px 27px 28px 29px 30px',
image_advtab: true
});
</script>
The problem is in the table plug-in, when I select cellspace and cellpadding from the editor it works, and seems save it correctly, but when I go in the view page of that element the table don't have that attributes. when I go in the developer tools in chrome I see:
th, td {
padding: 0
}
And if I disable that the table goes in the right dimension...
Anyone can tell me what is the problem??
If it looks correct in TinyMCE but not when rendered outside the editor its likely the CSS of your page is causing that change. This appears to be the case based on what you state about the th and td padding in the dev tools.
Related
Using this header :
---
header-includes:
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,breakanywhere,breaksymbol=,breakanywheresymbolpre=,commandchars=\\\{\}}
title: "Analyse spatiale"
subtitle: "Geostatistique, QGIS, Geoserver"
author: Marc Le Bihan
geometry: margin=2cm
fontsize: 12pt
output: pdf
classoption: fleqn
urlcolor: blue
---
for a markdown transformed with pandoc to a pdf with this markdown command :
pandoc -f markdown-implicit_figures analyse_spatiale.md -o analyse_spatiale.pdf
11pt or 12pt have a visible effect in the pdf for fontsize:, but 13pt, 14pt return to a lower font.
Why?
13pt and 14pt are not class options which are allowed by default. They will fall back to the default 10pt option. However you can use the extsizes package to make more font sizes available:
---
title: "Analyse spatiale"
subtitle: "Geostatistique, QGIS, Geoserver"
author: Marc Le Bihan
output: pdf_document
geometry: margin=2cm
classoption: fleqn
urlcolor: blue
header-includes:
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,breakanywhere,breaksymbol=,breakanywheresymbolpre=,commandchars=\\\{\}}
- \usepackage[14pt]{extsizes}
---
fff
This has to do with LaTeX, which pandoc uses to generate the PDF: The default LaTeX article class only supports 10pt, 11pt, and 12pt font sizes; any other value will be ignored.
I'd like to convert this SVG to PDF with the size scaled up to x10 of it's current size without losing the quality of the picture. The PDF should also be in 300 PPI. How can I achieve kind of output?
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="248.1" height="350.7" viewBox="0 0 248.1 350.7" xml:space="preserve">
<desc>Created with Fabric.js 1.7.19</desc>
<defs>
</defs>
<g transform="translate(51.2 34.1) scale(0.1 0.1)">
<image xlink:href="./cat.jpg" x="-512" y="-341" style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" width="1024" height="682" preserveAspectRatio="none"></image>
</g>
</svg>
This SVG came from fabricjs toSVG() code. I can resize it using fabricjs, but I'd like to know is it possible to do this and how using ImageMagick.
ImageMagick is a programm suite aimed at raster images. What you have is a format that mixes vector and raster content both for input and output.
ImageMagick can handle that, but only through additional programs that need to be installed:
import from SVG with Inkscape or librsvg
export to PDF with ghostscript
You can cutout the middleman. Inkscape, while being mainly a SVG editor GUI, also has a commandline mode, for example for export tasks. You can scale the SVG by multiplying the height and width values on the root element with your scale - do not change the viewBox attribute:
<svg width="2481" height="3507" viewBox="0 0 248.1 350.7" ...>
Or, if you know the target size of the pages you want, you can set them. Even if aspect ratio does not fit, your content will sized-to-fit on the page. For example with a A4 page:
<svg width="210mm" height="297mm" viewBox="0 0 248.1 350.7" ...>
Then execute Inkscape:
inkscape --without-gui --export-pdf=out.pdf in.svg
Pictures are embeded as-is, so you do not loose resolution.
I am using pandoc v 1.18 I want to add header as well as footer text.
I want complete control meaning I want to place heater text at left, center and middle and the same with footer.
But I am unable to get even a single place to show up.
I have the following in my YAML header in my markdown file
---
header: This is fancy
footer: So is this
headertext: This is fancy
footertext: So is this
#abstract: This is a pandoc test . . .
documentclass: report
output:
pdf_document:
fontsize: 12pt
mainfont: Roboto
geometry: [top=2cm, bottom=1.5cm, left=1cm, right=1cm]
css : pandoc.css
linkcolor : cyan
toc : true
---
I have tried to use header and headertext separately as well and that did not work as well.
Easiest solution is to add a custom latex header. Create header.tex in your working directory and add something like:
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{Fancy on the right}
\lhead{Fancy on the left}
\cfoot{Fancy in the footer}
See the fancyhdr manual for help.
And then compile with pandoc myfile.md -o myfile.pdf -H header.tex. With Rmarkdown, this can be set in the YAML front matter:
---
output:
pdf_document:
includes:
in-header: header.tex
---
To be able to set the header with a variable in the YAML like you wanted, you will need to play with the rmarkdown latex template (see the pandoc manual section about templates) but you'll probably lose the possibility to fine-tune the header and footer with fancyhdr.
I used fontsquirrel to download webfonts but the letter spacing doubles on the iPhone. I tried enabling "remove kerning" in the fontsquirrel settings but that doesn't work.
#font-face {
font-family: 'fjalla_oneregular';
src: url('../../core/texts/fjallaone-regular-webfont.eot');
src: url('../../core/texts/fjallaone-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../../core/texts/fjallaone-regular-webfont.woff2') format('woff2'),
url('../../core/texts/fjallaone-regular-webfont.woff') format('woff'),
url('../../core/texts/fjallaone-regular-webfont.ttf') format('truetype'),
url('../../core/texts/fjallaone-regular-webfont.svg#fjalla_oneregular') format('svg');
font-weight: normal;
font-style: normal;
-webkit-font-smoothing: antialiased;
}
.post-header h1 {
font-family: "fjalla_oneregular", Impact, Helvetica Neue, Helvetica, sans-serif;
font-weight: 700;
text-transform: uppercase;
color: #191919;
letter-spacing: 0px;
}
Is there a workaround to make the spacing match between desktop browsers and mobile?
That can be a confusing and tough problem to find the solution for. Try moving the SVG URL line before the EOT URL line. It appears that Chrome utilises the .svg file in the #font-face kit, and doesn’t like being called last. Below is the standard call for #font-face using CSS:
#font-face {
font-family: 'chunk-webfont';
src: url('../../includes/fonts/chunk-webfont.eot');
src: url('../../includes/fonts/chunk-webfont.eot?#iefix') format('eot'),
url('../../includes/fonts/chunk-webfont.woff') format('woff'),
url('../../includes/fonts/chunk-webfont.ttf') format('truetype'),
url('../../includes/fonts/chunk-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
As can be seen in the example, the .svg file comes last in the list of called URLs. If we amend the code to target webkit browsers, then tell them to solely utilize the .svg file.
#font-face {
font-family: 'chunk-webfont';
src: url('../../includes/fonts/chunk-webfont.eot');
src: url('../../includes/fonts/chunk-webfont.eot?#iefix') format('eot'),
url('../../includes/fonts/chunk-webfont.woff') format('woff'),
url('../../includes/fonts/chunk-webfont.ttf') format('truetype'),
url('../../includes/fonts/chunk-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {font-family: ‘chunk-webfont’;
src: url(‘../../includes/fonts/chunk-webfont.svg’) format(‘svg’);
}
I was using a typeface and the same code from FontSquirrel and recently after the iOS 10 update a few of my sites were all broken with incorrect font spacing.
See Font Face Chrome Rendering for reference
(Big thanks to Sam Goddard for that post!)
I've got a UIImageView and a UILabel, one sit next to another with a fixed spacing (let say 10pt). The UILabel's width may change dynamically. Is it possible to align them centre horizontally like below ?
| # Abc |
| |
| |
| # Abcde |
| |
| |
Put both of them in a view like this:
|<-- center view -->|
| ________________ |
| | View | |
| |_______ ______| |
| | Image | | Label| |
| |_______| |______| |
| |________________| |
| |
Then center the view horizontal. Within the view you need to define constraints for the imageview and the label so that these define the height and width of the view.
EDIT
Here are two images that show it works:
set UILabel's text alignment to center. then move it to the center of the view so that there's a guid line appear in the center of the UILabel.
sorry, miss understood your mean,
updating...
select both label and image by holding command key then move them to align to the center guid line.