[LaTeX] Add appendices in an article

This post introduces how to add appendices to an article.

The command \appendix  is included in all basic class files, so you do not need to include any extra package to add appendix, unless the journal that you aim at has specific appendix style requirements.

\begin{document}

\section{Your section name here}
\section{Your section name here}

% Activate the appendix in the doc
% from here on sections are numerated with capital letters 
\appendix

\section{Appendix A title here}
\subsection{Appendix subsection title here}
\subsection{Appendix subsection  title here}

\section{Appendix B title here}

\end{document}

VPN setup on Ubuntu 16.04 (using Cisco AnyConnect client)

This post introduces how to setup VPN on Ubuntu  16.04 LTS using Cisco AnyConnect Client.

Step 1:  Download Cisco AnyConnect client.

Penn Stater can download at here.

Step 2: Extract the file(s) and install as root.

(1) extract the downloaded file;

(2) then cd to the extracted directory where it has an installation .sh file;

(3) then issue the following command to install Cisco AnyConnect Client:

$sudo ./AnyConnectInstall.sh 

# note your .sh file may have slight different name

Step 3:  Run the following command.

$ sudo apt-get install openconnect network-manager-openconnect-gnome

We need to issue this command to  show Cisco Compatible VPN in the list when we open network manager and add a new VPN.

Step 4:  Open Network Manager.

 

Step 5: Add a VPN in the Network Manager

Step6:  Choose Cisco AnyConnect Compatible VPN (openconnect) and click Create.

Step 7: Enter the following info

  • Connection name: Tech Services VPN [Note you can name this as you wish]
  • Gateway: vpn.its.psu.edu  [type in your vpn accordinly]

Click Save.

Step 8: Open Cisco Anyconnect client

Type your VPN address in the connect to textbox, and then enter your username and psw.

Then you are ready to go:)

 

References:

VPN, CISCO AnyConnect, Linux

Cisco VPN client on Ubuntu 16.04 LTS

 

 

 

Two ways to merge PDF files on Mac (GUI and command line)

This post introduces how to merge PDF files on Mac from GUI and from Terminal on Mac OS.

(For Ubuntu and Windows users, check out my post here for solutions.)

Method 1: GUI — using Preview  that comes with your Mac OS.

Check here for how to combine PDFs and reorder, rotate, and delete pages. If the page is not accessible, check the pdf I linked to in the references.

Method 2: From Terminal

We will introduce using gs command.

many people may already have gs package  installed and are already using gs.

TO check whether your Mac has gs installed,  in your terminal, issue the following command:

$ which gs

If you see something like this “/usr/local/bin/gs”, you OS has gs installed

If you see something like “… command not found”, you will need to install gs first.

You can use brew to install it.

$ brew install gs

If you do not have brew installed, check: Install Homebrew.

After you have gs installed,

in your terminal, cd to the directory where the pdf files you want to merge are located, and then issue the following command:

$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf source1.pdf source2.pdf source3.pdf

Then you will see a merged.pdf appear in the same folder where you source pdfs are.

Note: You may encounter these two errors in your terminal after your issue the pdf merge command I mentioned above, but be assured, the merge.pdf is correct. you can double check if you are worried about that:)

 

References:

Use Preview to combine PDFs on your Mac (pdf)

How can I combine multiple PDFs using the command line?

 

Read the first line of a file from terminal (on Ubuntu and Mac)

This post introduces how to read the first line of a file from terminal. It works on both Linux (Ubuntu) and Mac OS.

For getting top or bottom 10 files under a director from terminal (on Ubuntu and Mac), check here.

Note: you do not need to install anything, it is built-in on your Ubuntu/Mac OS.

Step 1: open a terminal 

Step 2: cd to the directory where your file (e.g., .txt file) is located 

Step 3: issue the following command

$ head -n 1 example.txt  
# this will read and print the first line of the file in the terminal

$ head -n 2 example.txt 
# this will read and print the first two lines of the file ... you got the idea...

***********************************************

Analogously, see the following command for displaying the last line of a file from terminal:

$ tail -n 1 example.txt # this will read and print the last line of the file in the terminal 

$ tail -n 2 example.txt # this will read and print the last two lines of the file ... you got the idea...

Get top or bottom 10 files under a director from terminal (on Ubuntu and Mac)

This post get top/bottom 10 from the sorted file names in current directory.

For reading the first line of a file from terminal (on Ubuntu and Mac), check here.

Note: you do not need to install anything, it is built-in on your Ubuntu/Mac OS.

Step 1: open a terminal 

Step 2: cd to the directory where your file (e.g., .txt file) is located 

Step 3: issue the following command accordingly

$ ls | head -10

# the pipe symbol (i.e., |) puts the output of the ls command as the input of the head command.

if you would like to get more information of the files, use the following instead:

$ ls -l | head -10

similarly,

if you would like to get the bottom 10 files in the current directory, issue the following command:

$ ls | tail -10

or for detailed information of the files, use

$ ls -l | tail -10

You guessed it, if you would like to get the top/bottom 20, just change the -10 to -20:)

simply, enough, right?

 

For more commonly used Linux commands, check my other posts at here  and here .