table with collect: style of title and notes not saved in Word - ms-word

I am creating many tables with collect / table in Stata 17. I already do all the formatting in Stata.
I use putdocx to export the table into Word (2019), but when I do, the format of the title and the notes is always Calibri 11 ( the default I guess). Curiously this does not affect the other cells, which are exported in Arial as stated in the code.
This code also does not give me any error message.
putdocx begin
collect clear
collect: total branch19, over(mw2022)
collect title "Arial is the best"
collect style title, font(arial, size(10) bold)
collect notes "help"
collect style notes, font(arial, size(10) bold)
collect style cell, font(arial, size(8)) nformat(%7,1f) // this works fine
collect layout (colname_remainder[branch19]) (mw2022#result[_r_b])
putdocx collect
putdocx save $tables\arial-test.docx, replace
I tried to incorporate collect style title, clear which changed nothing.
I changed around the order of the lines of code.
I copy pasted the code from the help file to exclude typos.
I tried to do it just bold.
I tried spelling arial Arial.
Just for "fun" I tried to make the other cells bold which also works fine collect style cell, font(arial, size(8) bold) nformat(%7,1f)

Related

Fillable Pdf multi-line, Allow rich text formatting in Acrobat Pro DC: but it ignores line spacing/leading set in More

I'm on Win10, using Acrobat Pro DC 2021.011... to edit and Reader DC (same version) to test.
From experience and from reading forums etc, forms in these apps are maddening... but I have not been able to find any discussion (or solutions) to the following behavior...
The form I'm building for other employees' use has a large edit text box set to Multi-line and Allow Rich Text Formatting. It is set to a default font, Calibri and size 50pt. For most situations this will work for them; provides 2-3 lines for a short product description. But occasionally they want a smaller font and more lines... They know how to get the ctrl+e properties bar. But in my testing of this alternative situation they'll need sometimes, I'm finding it's impossible to get the smaller font size and more lines to work. Here's my process.
tab into text box. Ctrl+E for properties bar.
before typing I set the font size to 24
then I type in my 4 lines of text
then I tab to my next form field...
and kaboom... the field I just filled...it's line height is so large it's pushed some of the content invisible. I assume this is coming from the field's default font size, 50
And if I try to adjust the line height, by selecting all the text and then choosing in More...>Form Field Text Properties>Paragraph>Line Spacing
If I set it to Single and click Close/click into another field I get the very large leading (presumably for 50pt font (same as pic above after point 5)
If I choose Exactly and set to point size slightly larger, click Close/out of field, I get another ridiculous result where the 2/3 line have the height I set, but the space between the 1 & 2 second line is way too much and the space between the last line and 3rd line is way too small...
before tabbing or clicking out of field to another field
Good lord.. what is that! 3 different leading values in the same field; just after applying 1 value to all lines, all text in the field...
It makes no sense... it doesn't look like it regards your input at all, and just comes up with it's own random leading... I've fiddled with Space before/after and combinations of Line Height and nothing comes close to what we need... At this point I'm convinced the Acrobat tools for a stylizing text in a multi-line, allow formatting text field are useless. I'd be better off with my employees they can't format anything, ever. Just type one line and hit Tab or Enter...
What is going on! I'm trying to make a simple fillable form for other employees to use, but this kind of behavior makes that impossible (It's enough of a stretch to teach them to use the ctrl+E and do some styling of their text but this is bonkers and completely unteachable... there's not rhyme or pattern to teach!)
Hope someone can help or has seen this behavior too.

How to get colored background in word wih R Markdown?

My team wants to highlight a certain word by using a yellow background, as a reminder that this value needs to be edited manually.
Desired result:
I try to make this happen (inspired by this answer). I format a line of text in my reference text as Times New roman with font size 12, with bold text and a yellow background. I then save the format as a "character"-type style and I save it under "boldyellow" in order to avoid underscores.
In my r markdown document I write:
<span custom-style=“boldyellow”>SKRIV IN ANTAL</span> av **21** regioner moretext moretext.
With no obvious result:
Am I missing one or more steps I haven't tought of? Is this possible at all using this method?

Add HTML but not in text mode of TinyMCE

I have a big text and like to highlight words that are trademarks. So within this big CDATA node I need to grab for multiple words like "ACME Soda Chips" and make them red.
currently I do something like this in a TinyMCE plugin:
// almost ...
var foo = editor.getContent();
foo.replace('ACME Soda Chips', '<span class="douh">ACME Soda Chips</span>');
editor.setContent(foo);
My problem now is, that such HTML is displayed in Text-Mode (where you see the content as plain HTML) and also submitted therefor stored to the database.
But what I like to have is:
Highlight a word in the visual mode
Do not store my surrounding span somehow
Optional: Do not show that I used a span and CSS-class to highlight things.
Hint:
I may completely do this wrong - please help.
I read some other plugins and honestly I don't understand what they do.
Imagine the whole text as one single big CDATA part but I like to highlight a specific set out of it.

How can i tell word to abbreviate "Figure" as "Fig."?

i want to use automatic numeration of Figures by word. When i insert a caption, I can choose what kind of caption this is, and since i have a different language than english, i made a new Type "Figure". The problem is with referencing: When i insert a cross reference onto that figure, it inserts it as "Figure" and makes it bold, since i embolden the "Figure" part of the caption, to make it more visible.
How can i change this in the text to be abbreviated with "fig."? Its annoying that the capitalisation is wrong and that the whole word "Figure" is inserted, instead of just the abbreviation. How can i accomplish that?
In Word 2007 you can in the "Insert Caption" dialog check whether to include or exclude the label from the caption. So inserting a reference will make you show only the number, without "Figure" word, so you can type "Fig." manually.
(Picture taken from http://word.tips.net/T000890_Adding_Captions.html)
As far as I know it is not possible (this way) until Office 2007.

Advanced Search in MSWord - how to insert text before a specific font

I need some help with a macro or VB script in Microsoft Word. I need to parse a document using the formatting alone. I want to use the advanced search feature to find a certain font format and then insert a carriage return ahead of that formatted text.
For example, let's say I have the following text:
BAR FOO FAR BOO BEAR FOO
I want to search for the bold font and then insert a (^p) mark before the bold text which would insert the CRLF. I can't search based on the text because the text varies, but the bold formatting is consistent.
Is there any way to do this so I end up with the results:
BAR
FOO
FAR
BOO
BEAR
FOO
I have tried this numerous ways using macro and could not get this working. Ideally I would not have to parse this by hand...