Linux HowTo: Defining a color to be the same color of comments

Original Source Link

I’m using the indentLine plugin to display line indents with a continuos vertical line, and I’d like to set the color of that line to the same color of my comments.

To get the foreground color of my comments I listed all the color groups with :hi, checked what my colorscheme had set for the guifg of the Comments group, and set it accordingly, i.e. I have this in my init.vim config

let g:indentLine_color_gui='#5c6370'

which works, but if I want to change colorscheme I’d have to do this again. Is there a variable that holds the color of the comments defined by my colorscheme? What I’d like to do is

let g:indentLine_color_gui=<comment_guifg>

There’s :h g:indentLine_defaultGroup specially for this case. So it becomes simply

let g:indentLine_defaultGroup = 'Comment'

In principle, when you need to read in the color from an existing highlight group it’s done like that:

let color = synIDattr(synIDtrans(hlID('Comment')), 'fg')

hlID() returns numerical ID; synIDtrans() follows links if any; synIDattr() returns requested attribute.

This is given as an example in :h hlID() and it’s basically what indentLine plugin does with g:indentLine_defaultGroup for you.

I came up with

execute('highlight Comment')->split('n')->filter({i,v -> v =~# '^Comment'})[0]->split(' ')->filter({i,v -> v =~# 'guifg'})[0]->split('=')

as a way to parse the output of :highlight, but it doesn’t take links into account, so it will probably be wrong. (With dracula it gives Blue, but Comment is linked to DraculaComment which uses a completely different color.)

If the plugin exposes a highlight group, you can just do

augroup myPluginHighlights
  autocmd!
  autocmd ColorScheme * highlight link pluginGroup Comment
augroup END

Tagged : / /

Server Bug Fix: Why this error shows up in this example? ! Incomplete iffalse; all text was ignored after line

Original Source Link

I do not see why this error shows up in this example below.

When putting iffalse to comment a section out, which has cprotect around it, I get an error. When removing iffalse, the error goes away.

documentclass{article}%
usepackage{amsmath}
usepackage{cprotect}
begin{document}

iffalse
cprotectsection{my title with some math $sin x$}
    this is a test
fi

test
end{document}

Compiling using lualatex foo3.tex, it gives the error

(./foo3.aux) (/usr/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd)
! Incomplete iffalse; all text was ignored after line 8.
<inserted text>
fi
l.9 cprotect
           section{my title with some math $sin x$}
?

Removing usepackage{cprotect} the error goes away. Also keeping usepackage{cprotect} but removing iffalse, the error goes away.

Why does this happen? How to keep the section commented out, but still use cprotect as I want it for other sections in the file?

TL 2020

lualatex --version
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)

Using iffalse ... fi as a method for commenting out a code chunk would appear to be a less than fully robust method.

To truly comment out code, you could place the % (comment) symbol at the start of each line of interest. Alternatively, you could load the comment package and surround the code chunk in question with begin{comment} and end{comment} statements, on lines by themselves.

documentclass{article}
usepackage{amsmath,cprotect,comment}
begin{document}

begin{comment}
cprotectsection{my title with some math $sin x$}
    this is a test
end{comment}

test
end{document}

Unfortunately cprotect is defined to be outer a totally useless TeX primitive feature that is not really used in LaTeX at all. The only effect of declaring a command to be outer is to make it throw an error in certain constructs deemed not to be “top level” and a region being skipped by an if test is one of the disallowed contexts.

outer is an error-detecting mechanism that has generated orders of magnitude more errors than it ever caught.

As you are using luatex you can disable the whole mechanism with suppressoutererror.

documentclass{article}%
usepackage{amsmath}
usepackage{cprotect}

suppressoutererror = 1

begin{document}


iffalse
cprotectsection{my title with some math $sin x$}
    this is a test
fi

test
end{document}

Alternatively the package provides icprotect which is a non-outer version of the command.

documentclass{article}%
usepackage{amsmath}
usepackage{cprotect}

%suppressoutererror = 1

begin{document}


iffalse
icprotectsection{my title with some math $sin x$}
    this is a test
fi

test
end{document}

Tagged : / / /

Ubuntu HowTo: Formatting a comment

Original Source Link

Is it possible to format a comment, as in, include blockqoute like properties?
I’ve noticed that the help mentions that ‘code’ can be used for code, but it doesn’t seem to make a difference.

Either that, or I made an error in understanding it. Any which way, is this possible?

Nope. Comments are limited to:

**bold**
*italics*
`code`
[link text](http://example.com)

There are also a few shortcuts for mentioning things like edit links, etc. See the full help on comments for a better understanding.

The mistake I made was mistaking single quotes for backticks. The backtick char is the key located to the left of the 1 on your keyboard, it also has the tilde character on it.

` and ~

not the single quote char ‘

Tagged : / /

Linux HowTo: How can I turn off the timestamp in a Word document comment?

Original Source Link

In Word 2013, why do I get a phrase with advancing time after my initials when I insert a comment? How do I turn it off?

My initials on the comment are correct. But, there seems to be an internal timer that starts with “A few seconds ago” and then increments.

What you are seeing is normal behavior for Review settings. These comments aren’t made to be part of the final document, they are for collaboration and review of the document.

You can not turn off time tracking in these comments, which is an important part of the review process to provide a timeline of who made what comment.

If you are looking to add a comment that will be a permanent part of the document or does not use the review features, insert a textbox from the Insert tab wherever you like, then edit it to add text.

Tagged : /

Making Game: How can I turn off the timestamp in a Word document comment?

Original Source Link

In Word 2013, why do I get a phrase with advancing time after my initials when I insert a comment? How do I turn it off?

My initials on the comment are correct. But, there seems to be an internal timer that starts with “A few seconds ago” and then increments.

What you are seeing is normal behavior for Review settings. These comments aren’t made to be part of the final document, they are for collaboration and review of the document.

You can not turn off time tracking in these comments, which is an important part of the review process to provide a timeline of who made what comment.

If you are looking to add a comment that will be a permanent part of the document or does not use the review features, insert a textbox from the Insert tab wherever you like, then edit it to add text.

Tagged : /

Making Game: Comments/Review pane alternates between expanded and collapsed view (picture)

Original Source Link

Within the same Word file, the comments/review pane is displaying in one of two ways: either collapsed or expanded.

Within a page, the display is the same, but across pages, the displays are different. Further, the displays are random. For example, pages 1, 2, 7, 10 might display one way, while the other pages display the other (there is no discernible pattern).

Heres a screenshot; the expanded view on the right is the one I want

Notice also that in the collapsed view, only author initials appear, but in the expanded view there is a purple icon to the left of the author initials.

I’ve tried the following:

  • increasing and decreasing the width of the pane
  • saving with a new file name
  • deleting normal.dotm (i.e., to create a fresh one with factory settings)
  • copying all of the content to a new file except for the final paragraph marker.
  • inserting additional page breaks (in case the problem was related to lengthy comments)

Environment: Windows 10 running Office Pro Plus 2019

Tagged : / / /