Troubleshooting LaTeX


Troubleshooting... Let us pray.

  • Open MikTex under Start > MikTex > Maintenance (Admin) > Update. Click update for every setting. Sometimes you may have installed something in LyX, like a package or a new file and you need to make sure it syncs up with MikTeX, which is the "engine" for LyX. 
  • Sometimes, random bugs or errors show up, such as when uploading Master.bib or a new add-on. 
    • Restart everything. 
    • If restarting fails, try shutting down, re-opening, re-loading files.
    • In LyX, press Control D to run an update.
    • In Lyx, go to Menu bar, Tools > Reconfigure. Then restart Lyx.
    • Right click Firefox or Lyx and choose "Run as Administrator"

Common LaTeX character errors and problems (which you don't get when dealing with LyX!)

So, LaTeX is a different language. And when you use keys on your keyboard, sometimes errors pop out that essentially remarks, "C'est du chinois pour moi" (It's Chinese to me)... So let's translate your Chinese into LaTeX...
  •  You typed
    You should have typed
     Why?
     Solution
     - (a dash to indicate from.... to; i.e. p. 21-22)
     -- (two dashes., also called an en dash)
    LaTex thinks - (a dash) is the minus sign in subtraction; two dashes create the thing you want in between page numbers
    replace your "-" to "--"; In LyX, this may happen due to .bib problems. See Step 3 below under "Problems with .bib files"
     - (a minus sign in subtraction)
     $-$  (see above)
    replace your "--" to "---"
     -- (two dashes), you know, for that run-on sentence
     --- (three dashes)
     (see above)
    replace your "--" to "---"
     & (that's called an ampersand by the way)
     and
     You're in academia. No contractions or ampersands, please. They're ugly
    replace your "&" to "and"
    ... (Ellipsis)
    See solution
    Spacing issues in LaTeX
    enter "\ldots"
     > or < (Inequalities, such as n > 12)
     $n>12$  > produces an upside down question mark and < produces an upside down exclamation mark type $ before and type type $ after the mathematical inequality such as $n>12$

Problems with .bib files

Say you exported a .bib file from a friend, website, Zotero, or some other source and wanted to upload it on Lyx, but it fails. 

Two options: 

  1. You may need to clean it up. (See Steps 1, 2, 3, and 4) Before opening up the problematic .bib file using these clean up steps, please remember to copy your problematic .bib file and make a copy!
  2. Just give up on the file re-download the file using alternate means. (See step 5)
Step 1:
  • Remember to copy your problematic .bib file and make a copy to use for the following steps! 
  • Right click the .bib file and press "Open with..." and choose Notepad.
  • Press "save as" (NOT "Save") and under Encoding on the bottom right side, choose "ASCII." 
  • Upload the new .bib file you just saved again. 
  • If this fails, next step...
Step 2: 
  • Remember to copy your problematic .bib file and make a copy to use for the following steps! 
  • Right click the .bib file and select "Properties." Check to see if the size is more or less than 100 kb. Remember this and close Properties.
  • Right click the .bib file and press "Open with..." and choose Notepad.
  • If your file was under 100 kb, 
    • Copy and paste the contents in its entirety to this online clean-up tool  http://www.bibtex.org/Convert/ and choose "Bib2Bib Cleaning Template"
    • Press convert and a new .bib file will be generated. Download it and save this new .bib file.
    • Upload the new .bib file you just saved from the online tool. 
    • If this fails, next step...
  • If your file was under 100 kb, 
    • On Firefox, go to this online clean-up tool  http://www.bibtex.org/Convert/ and choose "Bib2Bib Cleaning Template"
    • The cleaning tool can only handle less than 100 kb of data at a time, so say your file is 350 kb. So you need to clean up the file by cutting and pasting the contents of your Notepad .bib file four different times. 
    • Eyeball the contents of your Notepad file and copy and paste the contents of the first 1/4th of the Notepad file.
    • Don't cut off a citation when you are cutting the file into 4 and pasting it into the online clean-up tool. In Notepad, a citation looks like this (a citation starts with the "@" at symbol and ends with the line starting with "}":

    @ARTICLE{morrow_alliances:_2000,
    author = {Morrow, J. D.},
    title = {Alliances: Why write them down?},
    journal = {Annual Review of Political Science},
    year = {2000},
    volume = {3},
    number = {1},
    shorttitle = {Alliances},
    url = {http://www.annualreviews.org/doi/abs/10.1146/annurev.polisci.3.1.63}
    }
    • Press convert and a new .bib file will be generated. Download it and save this new .bib file.
    • Repeat until all 4 parts of your original file is downloaded.
    • Upload the new .bib files (all 4) from the online tool. 
    • If this fails, next step...
Step 3:
  • Remember to copy your problematic .bib file and make a copy to use for the following steps! 
  • Download JabRef, which is like Zotero, but sometimes, JabRef does the clean-up job better and you can clean up stuff easier.
  • Install and open up Jabref
  • In JabRef, open your .bib file
    • Warnings will pop up. Resolve them by clicking through them.
  • In JabRef, clean up en-dash (sometimes, your saved bibliography saves page numbers using dashes, called en-dash; these dashes often cause problems and appear when the citation lists the page numbers, for example pages "274 - 291". BiBTex, which is a program in MikTex that runs your bibliographies behind-the-scenes in LyX, doesn't like the space before and after the dash in "274 - 291", it only can take "274-291".... so
    • Go to Menu bar > Search > Replace string
      • Search for, copy and paste the three weird question marks in a diamond into the box
      • Next to Replace with enter "--"
        • Note: Enter without quotes, just type two dashes
  • Save the file as a new .bib file
  • Upload new file.
Step 4
  • Say a prayer.
  • Repair any damage to surrounding environment: chairs, books, laptop, people. 
  • Take a nap? 
  • Mental health check-in: What are you? 12 hours into this mess? It's ok.
Step 5
  • Give up on that file and re-download it.
  • Re-download option 1
    • Using JSTOR for instance, after you have logged into your school proxy, you can create an account.
    • Save citations to that account.
    • Export citations from JSTOR citations list in BibTeX format and download the .bib file. 
  • Re-download option 2
    • Go to Google Scholar and just search for tons of citations and dump them into your Zotero account using Firefox for Zotero
    • Search using Google Scholar
    • Click settings on Google Scholar and choose "Show 100 results" and de-click "Citations"
    • Download all of them using the folder icon on the URL button (See step 24 for review)
    • Cite in LyZ (but don't forget to update your .bib file)...  (See step 29 for review)
Suggestions and feedback welcome. Good luck!
Comments