None of the following approaches produces output that is both bold and italic:
:stem: latexmath
[latexmath]
++++
\it{\bf{foo}}
\textit{\textbf{foo}}
\mathit{\mathbf{foo}}
++++
=> How can I achieve foo?
I use Chrome 67.0.3396.99 with the Asciidoctor.js Preview Plugin to render my the asciidoc file.
Related:
https://tex.stackexchange.com/questions/41681/correct-way-to-bold-italicize-text
https://github.com/mathjax/MathJax/issues/735
\pmb{foo}
(Some further chars to get to the 30 char limit for answers.)
Related
I am using Pandoc to convert a markdown file to a PDF and I have some issues with creating references to headings with leading numbers.
Here is the code:
Take me to the [first paragraph](#1-paragraph)
## 1 Paragraph
In the converted PDF the link does not work.
When I remove the leading number everything works fine.
So whats the correct way to link to this kind of headings?
A good way to go about this is to look at pandoc's “native” output, i.e., the internal representation of the document after parsing:
$ echo '## 1 Paragraph' | pandoc -t native test.md
[ Header
2
( "paragraph" , [] , [] )
[ Str "1" , Space , Str "Paragraph" ]
]
The auto-generated ID for the heading is paragraph. The reason for that is that HTML4 doesn't allow identifiers that start with numbers, so pandoc skips those. Hence, [first paragraph](#paragraph) will work.
However, GitHub Flavored Markdown is written with HTML5 in mind, and numbers are allowed as the first id character in that case. Pandoc supports GitHub's scheme as well, and those auto-identifiers are enabled with --from=markdown+gfm_auto_identifiers.
Probably better than manual numbering of headings is to call pandoc with --number-sections (or -N); the numbering will be performed automatically.
How to customize font size of Figure Caption in a quarto pdf document? I have checked about the mainfont and fontfamily options, but the documentation doesn't provide examples of how to use change the font size for individual elements in a pdf document.
Since for pdf output, ultimately latex is used, you just need to find the corresponding latex solution to do what you want to do and incorporate those latex codes using LaTex Includes.
So to change the figure caption size, we can use the caption package. From section 2.3 of the caption package manual,
There are three font options which affect different parts of the caption: One affecting the whole caption (font), one which only affects the caption label and separator (labelfont) and at least one which only affects the caption text (textfont).
You set them up using the options font={⟨font options⟩}, labelfont={⟨font options⟩}, and textfont={⟨font options⟩}, where ⟨font options⟩ is a list of comma separated font options.
And these are the available font options:
scriptsize => Very small size
footnotesize => The size usually used for footnotes
small => Small size
normalsize => Normal size
large => Large size
Large => Even larger size
Read the manual (section 2.3) to know the details and more options.
---
title: "Figure Caption Size"
format:
pdf:
include-in-header:
text: |
\usepackage[font=Large,labelfont={bf,Large}]{caption}
---
## Quarto
```{r}
#| fig-cap: "Just a scatterplot"
plot(rnorm(1:10), rnorm(1:10))
```
I tried many IDE: Sublime Text, PhpStorm, Notepad++
When I paste the ɑ̃ character I got a^ (2 chars)
Same happens with other chars such as ɛ̃ ɑ̃ ɔ̃ œ̃
I tried to change UTF-8, UTF18, ISO etc... All IDE did change the ɑ̃ into 2 chars !
Any idea ?
In my case it works fine:
(Indeed, it's treated as two characters, like you can delete only the first/second "part" by backspace, but it's displaying correctly)
I think it's the problem of font. You may try my fallback font Inziu Iosevka which may probably support those characters better.
Other characters test:
Fine.
My complete font setting (IntelliJ IDEA Ultimate):
Hope it help.
How to solve this for pdfbox with boxable.
I am getting in table.draw as
No glyph for U+000D in font Helvetica
What to do.I am building table with boxable
That error tells you that your strings you use to fill the tables contain CR (carriage return) characters.
Do not use control characters (like CR, LF, TAB, ...) in those string as your software stack does not interpret them to mean something like a line break; instead it tries to interpret it as a glyph in the font which it fails doing.
If you need to break lines in boxable tables, try using <p> or <br> instead. According to their README, they support
HTML tags in cell content (not all! <p>,<i>,<b>,<br>,<ul>,<ol>,<li>)
We have to construct a postscript file that contains Arabic text, so as English text.
GhostScript shows the Arabic text correctly, but converting it to pdf does not show the Arabic letters.
PS file contains the following:
/TraditionalArabic findfont dup
length dict
copy begin
/Encoding Encoding 256 array copy def
Encoding 1 /kafinitialarabic put
Encoding 2 /behinitialarabic put
Encoding 3 /yehmedialarabic put
Encoding 4 /seenfinalarabic put
Encoding 5 /eacute put
Encoding 6 /a put
/ArabicTradDict currentdict definefont pop
end
%%Page: 1 1
%%BeginPageSetup
%%PageMedia: Color Weight Type
<< /MediaColor (Blue)/MediaWeight 75 /MediaType () /xx {2.803464567 mul} def /xx {2.83464567 mul} def /PageSize [240 xx 345 xx]>> setpagedevice
%%EndPageSetup
/ArabicTradDict 18 selectfont
72 xx 300 xx moveto
(\004\003\002\001) show
showpage
To run ghostScript: running it from command line to include all windows fonts:
gswin64.exe -sFONTPATH=%windir%/fonts -dEmbedAllFonts=true
To convert the PS file to PDF file: running the following command:
gswin64.exe -dBATCH -dNOPAUSE - sOutputFile=c:/Users/mob/Desktop/TimesNewRomanPSMT.pdf -sDEVICE=pdfwrite - dPDFSETTINGS=/prepress -dCompressFonts=false -dSubsetFonts=false -sFONTPATH=%windir%/fonts -dEmbedAllFonts=true -dEmbedAllFonts=true -f c:/Users/mob/Desktop/TimesNewRomanPSMT.ps
So when converting to PDF, the Arabic characters are not showing correctly, but showing as squares that are of no meaning...
If I use Adobe tool to convert to PDF, the PDF we get is same, except the "eacute -(005) " if included in the PS file, will show after conversion, where as when I convert with the previous command line, all characters that are added from the Encoding are not shown correctly.
Any help with that?
Thanks to KenS hints I was able to solve my problem. The encoding used wrong character names like kafinitialarabic (i mean by wrong, pdf could not understand that), everything that ended with arabic was wrong. The Traditional Arabic font does not have those names for characters. In order to know what it really understood, have converted the ttf font to afm and pfa using the following command, that is converting the true type font to type 42 font which will be understood once embed in postscript file at conversion to pdf
C:\Program Files\gs\gs9.10\bin>gswin64c.exe -dNODISPLAY -q -- ttf2pf.ps times tim
esPS timesAFM
where times is the ttf font name. I then checked the generated pfa file for the characters I wanted to add, instead of kafinitialarabic, there was kafinitial, and for kafmedialarabic there was kafmedial and so on...
It works fine now to add those in encoding, but I want to find a way instead of adding all those characters in the dictionary, I want to use the font like we use with setfont in postscript normally - if that is possible...
As already suggested, you need to ensure the glyph names you use are in the font you use, or create a new font.
I haven't found anything that will choose the correct glyph from the set of initial, medial, final, isolated, depending on context, though.
I resorted to writing a program which takes unicode arabic, reverses it the arabic characters, and then decides which tone of character to use based on it's position in a word, and whether the previous or next characters are forced into isolated or final forms. Unfortunately had to embed quite some intrinsic knowledge about the font in use and the glyph names it has, as well as typos in them, into the program.
If that's of interest, I've stuck it on github, but it's very raw and initial.
It does work, though.
https://github.com/gbjk/arabic2ps
The font I used was a traditional arabic font, with quite a few idiosyncrasies.