Flex and Bison, parse command line arguments - command

I'm using Flex and Bison, and I would like my lex/parse to analyse text from command line, for example if I have : mybin mytext , I would like my yyparse to analyse mytext (which is not a file)

Use yy_scan_string to set the flex input buffer to a specified string (argv[1] in this case). See the flex manual for details.

Related

PercTable {DescTools} - prevent output text wrapping

My goal is to export PercTable output in a clean / HTML like format as JPG or CSV import into a presentation.
I get the "raw" table I want with this code:
Library(DescTable)
PercTable(syn_gender ~ recommend, data=dfXtab, rfrq="010", expected=TRUE)
It outputs as shown in graphic.
Screen snapshot for space saving
How can I export this output without the table wrapping the last 2 column?
Thank you - newbie.
The PercTable print routine uses the console width (getOption("width")) to define the table breaks. So the first solution is to simply enlarge the console width and print again.
Another option for output if you're on Windows is to use the Office export (package RDCOMClient needed):
library(DescTools)
tt <- PercTable(table(d.pizza$operator,
cut(d.pizza$temperature, breaks=6)))
wrd <- GetNewWrd()
ToWrd(tt$ftab)
would yield:

Line wrapping TeX from Visual Studio Code

I'm seeking a command that when I highlight a paragraph of text in Visual Studio Code will let me remove all line breaks, and correspondingly a command that if I highlight a paragraph without line breaks will insert them at the end of the display width.
It wont be enough to just use Alt-Z because that just makes the display show the line wrapping but doesn't actually insert the line breaks.
For context: I'm using a VS Code latex plugin which is a compiled text editor format. Errors in this system trace back to line numbers so if you don't have line breaks you have to hunt down the error somewhere in a large paragraph. But of course this being a text document there you often have to edit paragraphs and end-of-lines become jagged and hard to read/update.
You can set this behavior searching for "Word Wrap" in the settings. Set to "on" to wrap the words.
Found a solution, maybe it will help someone in the future.: install "rewrap" extension. Select portion of text, and use Alt-q. Seems to work like Emacs' M-q command. (Thx Grant)

.Bl, .It to render list in mandoc doesn't work on both macOS and Ubuntu 16.04

I try to use a proper macro like .Bl with its .It to render list in mandoc (or per say man page) with the following syntax (as seen in mdoc.7)
The arguments are as follows:
.Bl -tag -width Ds
.It Fl v
Print verbose information.
.El
Tried both on macOS and Ubuntu 16.04 by putting into .SH DESCRIPTION, and it doesn't render expected output. All I see is
The arguments are as follows: Print verbose information.
The steps I do this is
Edit mandoc file
Symlink it to target file at /usr/local/share/man/man3/
See result by man <filename>
PS. I didn't go any gzip.
What did I miss? How can I properly render list in mandoc?
Instead, I look at mandoc's code of /usr/share/man/man1/bash.1 in which I view such man page via man /usr/share/man/man1/bash.1 for safety to ensure I view the right file.
It uses the following syntax
.TP 10
.BI Item Name
Item description
.TP
.BI Item Name 2
Item 2 description
This will properly renders those two items in which the first column has 10 character in width. The second item will use the same column width as defined before. Much cleaner and simpler than what I tried but with not success in the question.
You will see the following output using above syntax

Is there a Perl Tk Text widget that supports line folding?

I am trying to build a Perl TK text widget that supports line folding (similar to Visual Studio folding capabilities).
Is there an existing one already? (tried googling it, and searching CPAN, didn't find any)
Is there a way to make few lines disappear in the Tk::Text widget? (so i can write the logic behind the folding routines...)
Eliding Text
You can actually include text in the widget that is not displayed; this is known as "elided" text, and is made available using the "elide" configuration option for tags. You can use this to implement for example an outliner, a "folding" code editor, or even just to bury some extra meta-data intermixed with your text. When specifying positioning with elided text you have to be a bit more careful, and so commands that deal with positions have extra options to either include or ignore the elided text.
Giving Thanks to the references

PDF forms with LaTeX: how to create \TextField of exactly 4in width?

I'm using PDFLaTeX to create forms and ran into a problem with the \TextField macro that defines input fields:
\TextField[width=4in,name=sample]{}
The resulting field is a little wider than 4 inches and I don't understand why. The following example illustrates the problem by resulting in an overfull hbox which gets highlighted by an overfull rule.
\documentclass[a4paper,11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[pdftex]{hyperref}
\overfullrule3pt
\begin{document}
\noindent \TextField[name=one, width=\hsize]{type here:}
\end{document}
The resulting PDF will show an overfull input field despite having specified exactly the available space as the desired width.
The author of the hyperref package, Heiko Oberdiek, sent me an email and explained why the width is by default greater than specified. Each \TextField is passed through the following macro for layout:
\def\LayoutTextField#1#2{% label, field
#1 #2%
}
Hence, we end up with the label, a space, and the input field. The width parameter only affects the input field. By re-defining the layout, we can ensure that we end up with the desired width as specified:
\def\LayoutTextField#1#2{#2}
This layout would simply drop the label ("type here:") to arrive at an input field of the desired width.